Skip to content

Commit

Permalink
Fix RTTI in Win64 - offsets are relative to the current module (e.g. …
Browse files Browse the repository at this point in the history
…the DLL), so it needs to be looked up explicitly
  • Loading branch information
quietust committed Jan 21, 2017
1 parent e2fc7d3 commit cc02ced
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/Process-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,14 @@ int Process::adjustOffset(int offset, bool to_file)
return -1;
}


string Process::doReadClassName (void * vptr)
{
char * rtti = readPtr((char *)vptr - sizeof(void*));
#ifdef DFHACK64
char * typeinfo = d->base + readDWord(rtti + 0xC);
void *base;
if (!RtlPcToFileHeader(rtti, &base))
return "dummy";
char * typeinfo = (char *)base + readDWord(rtti + 0xC);
string raw = readCString(typeinfo + 0x10+4); // skips the .?AV
#else
char * typeinfo = readPtr(rtti + 0xC);
Expand Down

0 comments on commit cc02ced

Please sign in to comment.