Esempio n. 1
0
//--------------------------------------------------------------------------
// Handle memory write records
VOID record_mem_write_cb(VOID * ip, VOID * addr)
{
  ADDRINT ea = (ADDRINT)addr;
  segmap_t::iterator p;
  for ( p = seg_bytes.begin(); p != seg_bytes.end() && !p->second.written; ++p )
  {
    ADDRINT start_ea = p->first;
    if ( ea >= start_ea )
    {
      segdata_t *seg = &p->second;
      if ( ea <= start_ea+seg->size )
      {
        fprintf(stderr, "%p: W %p\n", ip, addr);
        write_address.push_back((ADDRINT)addr);
        seg->written = true;
        break;
      }
    }
  }
}
// Print a memory write record
VOID RecordMemWrite(VOID * ip, VOID * addr)
{
    write_address.push_back((ADDRINT)addr);
}