mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-07-09 17:19:26 +00:00
first stage of integrating pdbex
This commit is contained in:
parent
10f029b0cf
commit
4928de6da2
10 changed files with 34 additions and 8 deletions
1
hyperdbg/dependencies/pdbex
Submodule
1
hyperdbg/dependencies/pdbex
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 562ef14af14ac2d8eb36c8a45dd64f3aec1957f7
|
||||
|
|
@ -42,6 +42,11 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kdserial", "kdserial\kdserial.vcxproj", "{2D988267-CC53-41E3-936A-48CEF9049DF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "symbol-parser", "symbol-parser\symbol-parser.vcxproj", "{9CA3E213-C43F-4C1D-A6ED-C6FC568D691B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{06FB1AF7-647C-4BA4-860A-4533763440F9} = {06FB1AF7-647C-4BA4-860A-4533763440F9}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pdbex", "dependencies\pdbex\Source\pdbex.vcxproj", "{06FB1AF7-647C-4BA4-860A-4533763440F9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -77,6 +82,10 @@ Global
|
|||
{9CA3E213-C43F-4C1D-A6ED-C6FC568D691B}.Debug|x64.Build.0 = Debug|x64
|
||||
{9CA3E213-C43F-4C1D-A6ED-C6FC568D691B}.Release|x64.ActiveCfg = Release|x64
|
||||
{9CA3E213-C43F-4C1D-A6ED-C6FC568D691B}.Release|x64.Build.0 = Release|x64
|
||||
{06FB1AF7-647C-4BA4-860A-4533763440F9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{06FB1AF7-647C-4BA4-860A-4533763440F9}.Debug|x64.Build.0 = Debug|x64
|
||||
{06FB1AF7-647C-4BA4-860A-4533763440F9}.Release|x64.ActiveCfg = Release|x64
|
||||
{06FB1AF7-647C-4BA4-860A-4533763440F9}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
BIN
hyperdbg/libraries/pdbex/x86/msdia140.dll
Normal file
BIN
hyperdbg/libraries/pdbex/x86/msdia140.dll
Normal file
Binary file not shown.
BIN
hyperdbg/libraries/pdbex/x86/symsrv.dll
Normal file
BIN
hyperdbg/libraries/pdbex/x86/symsrv.dll
Normal file
Binary file not shown.
|
|
@ -70,12 +70,13 @@ ShowMessages(const char * Fmt, ...)
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Interpret and find module base , based on module name
|
||||
* @brief Interpret and find module base, based on module name
|
||||
* @param SearchMask
|
||||
*
|
||||
* @return DWORD64 NULL means error or not found, otherwise the address
|
||||
* @return PSYMBOL_LOADED_MODULE_DETAILS NULL means error or not found,
|
||||
* otherwise it returns the instance of loaded module based on search mask
|
||||
*/
|
||||
DWORD64
|
||||
PSYMBOL_LOADED_MODULE_DETAILS
|
||||
SymGetModuleBaseFromSearchMask(const char * SearchMask, BOOLEAN SetModuleNameGlobally)
|
||||
{
|
||||
string Token;
|
||||
|
|
@ -171,7 +172,7 @@ SymGetModuleBaseFromSearchMask(const char * SearchMask, BOOLEAN SetModuleNameGlo
|
|||
g_CurrentModuleName = (char *)item->ModuleName;
|
||||
}
|
||||
|
||||
return item->ModuleBase;
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -333,6 +334,8 @@ SymLoadFileSymbol(UINT64 BaseAddress, const char * PdbFileName)
|
|||
char AlternateModuleName[_MAX_FNAME] = {0};
|
||||
PSYMBOL_LOADED_MODULE_DETAILS ModuleDetails = NULL;
|
||||
|
||||
pdbex_main_impl_export(0, NULL);
|
||||
|
||||
//
|
||||
// Get options
|
||||
//
|
||||
|
|
@ -484,6 +487,7 @@ SymLoadFileSymbol(UINT64 BaseAddress, const char * PdbFileName)
|
|||
//
|
||||
ModuleDetails->BaseAddress = BaseAddress;
|
||||
strcpy((char *)ModuleDetails->ModuleName, ModuleName);
|
||||
strcpy((char *)ModuleDetails->PdbFilePath, PdbFileName);
|
||||
|
||||
//
|
||||
// Save it
|
||||
|
|
@ -695,7 +699,7 @@ SymGetFieldOffset(CHAR * TypeName, CHAR * FieldName, DWORD32 * FieldOffset)
|
|||
//
|
||||
// Find module base
|
||||
//
|
||||
ModuleBase = SymGetModuleBaseFromSearchMask(TypeName, TRUE);
|
||||
ModuleBase = SymGetModuleBaseFromSearchMask(TypeName, TRUE)->ModuleBase;
|
||||
|
||||
//
|
||||
// Find the module name
|
||||
|
|
@ -758,7 +762,7 @@ SymSearchSymbolForMask(const char * SearchMask)
|
|||
//
|
||||
// Find module base
|
||||
//
|
||||
ModuleBase = SymGetModuleBaseFromSearchMask(SearchMask, TRUE);
|
||||
ModuleBase = SymGetModuleBaseFromSearchMask(SearchMask, TRUE)->ModuleBase;
|
||||
|
||||
//
|
||||
// Find the module name
|
||||
|
|
|
|||
|
|
@ -30,13 +30,23 @@ typedef struct _SYMBOL_LOADED_MODULE_DETAILS
|
|||
UINT64 BaseAddress;
|
||||
DWORD64 ModuleBase;
|
||||
char ModuleName[_MAX_FNAME];
|
||||
char PdbFilePath[MAX_PATH];
|
||||
|
||||
} SYMBOL_LOADED_MODULE_DETAILS, *PSYMBOL_LOADED_MODULE_DETAILS;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Exports //
|
||||
// Exports & Imports //
|
||||
//////////////////////////////////////////////////
|
||||
extern "C" {
|
||||
|
||||
//
|
||||
// Imports
|
||||
//
|
||||
__declspec(dllimport) int pdbex_main_impl_export(int argc, char ** argv);
|
||||
|
||||
//
|
||||
// Exports
|
||||
//
|
||||
__declspec(dllexport) VOID SymSetTextMessageCallback(PVOID handler);
|
||||
__declspec(dllexport) UINT32 SymLoadFileSymbol(UINT64 BaseAddress, const char * PdbFileName);
|
||||
__declspec(dllexport) UINT32 SymUnloadAllSymbols();
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@
|
|||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>$(SolutionDir)build\debug\pdbex.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
|
@ -85,6 +86,7 @@
|
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>$(SolutionDir)build\release\pdbex.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ def CountLines(start, lines=0, header=True, begin_start=None):
|
|||
for thing in os.listdir(start):
|
||||
thing = os.path.join(start, thing)
|
||||
if os.path.isfile(thing):
|
||||
if ('\dependencies\pdbex' not in thing and '\dependencies\zydis' not in thing and '\dependencies\phnt' not in thing) and (thing.endswith('.c') or thing.endswith('.h') or thing.endswith('.cpp') or thing.endswith('.asm') or thing.endswith('.py') or thing.endswith('.cs')):
|
||||
if ('\dependencies\pdbex' not in thing and '\dependencies\zydis' not in thing and '\dependencies\phnt' not in thing and '\dependencies\ia32-doc' not in thing) and (thing.endswith('.c') or thing.endswith('.h') or thing.endswith('.cpp') or thing.endswith('.asm') or thing.endswith('.py') or thing.endswith('.cs')):
|
||||
|
||||
with open(thing, 'r') as f:
|
||||
newlines = f.readlines()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue