win64 fixes: doReadClassName, ParseVersion

cherry-picked from 2f734ae2317060edb83021f17cffc966c435ad7b
develop
Vitaly Pronkin 2016-07-27 20:21:57 -04:00 committed by lethosor
parent ddd56d7825
commit 223c83071e
2 changed files with 12 additions and 1 deletions

@ -345,9 +345,16 @@ int Process::adjustOffset(int offset, bool to_file)
string Process::doReadClassName (void * vptr)
{
char * rtti = readPtr((char *)vptr - 0x4);
char * rtti = readPtr((char *)vptr - sizeof(void*));
#ifdef DFHACK64
char * typeinfo = d->base + readDWord(rtti + 0xC);
string raw = readCString(typeinfo + 0x10+4); // skips the .?AV
#else
char * typeinfo = readPtr(rtti + 0xC);
string raw = readCString(typeinfo + 0xC); // skips the .?AV
#endif
if (!raw.length())
return "dummy";
raw.resize(raw.length() - 2);// trim @@ from end
return raw;
}

@ -136,7 +136,11 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
}
if ((is_vtable && no_vtables) || (!is_vtable && no_globals))
continue;
#ifdef DFHACK64
uintptr_t addr = strtoull(cstr_value, 0, 0);
#else
uintptr_t addr = strtol(cstr_value, 0, 0);
#endif
if (is_vtable)
mem->setVTable(cstr_key, addr);
else