1
0
Fork 0

DBG: resolved issue #150 (valapifromstring now works again) + correctly use the symbol cache as search path

This commit is contained in:
Mr. eXoDia 2014-08-03 02:36:44 +02:00
parent 6f96d1e0c2
commit c7b9bdc74f
3 changed files with 7 additions and 3 deletions

View File

@ -667,7 +667,9 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
dbload();
SymSetOptions(SYMOPT_DEBUG|SYMOPT_LOAD_LINES|SYMOPT_ALLOW_ABSOLUTE_SYMBOLS|SYMOPT_FAVOR_COMPRESSED|SYMOPT_IGNORE_NT_SYMPATH);
GuiSymbolLogClear();
SymInitialize(fdProcessInfo->hProcess, szSymbolCachePath, false); //initialize symbols
char szServerSearchPath[MAX_PATH * 2] = "";
sprintf_s(szServerSearchPath, "SRV*%s", szSymbolCachePath);
SymInitialize(fdProcessInfo->hProcess, szServerSearchPath, false); //initialize symbols
SymRegisterCallback64(fdProcessInfo->hProcess, SymRegisterCallbackProc64, 0);
SymLoadModuleEx(fdProcessInfo->hProcess, CreateProcessInfo->hFile, DebugFileName, 0, (DWORD64)base, 0, 0, 0);
IMAGEHLP_MODULE64 modInfo;

View File

@ -99,6 +99,7 @@ void symdownloadallsymbols(const char* szSymbolStore)
}
for(int i=0; i<modcount; i++) //reload all modules
{
dprintf("downloading symbols for %s...\n", modList.at(i).name);
uint modbase = modList.at(i).base;
char szModulePath[MAX_PATH] = "";
if(!GetModuleFileNameExA(fdProcessInfo->hProcess, (HMODULE)modbase, szModulePath, MAX_PATH))

View File

@ -1078,8 +1078,8 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print
addrfound[found]=(uint)hMods[i]+rva;
found++;
}
FreeLibrary(hModule);
}
break;
}
}
}
@ -1088,7 +1088,8 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print
}
if(!found)
{
efree(addrfound, "valapifromstring:addrfound");
if(addrfound)
efree(addrfound, "valapifromstring:addrfound");
return false;
}
if(value_size)