DBG: remove unused imports field from MODINFO
This commit is contained in:
parent
4fa1b9a2a1
commit
a2c52260f7
|
|
@ -327,9 +327,6 @@ void GetModuleInfo(MODINFO & Info, ULONG_PTR FileMapVA)
|
|||
Info.sections.push_back(curSection);
|
||||
}
|
||||
|
||||
// Clear imports by default
|
||||
Info.imports.clear();
|
||||
|
||||
ReadTlsCallbacks(Info, FileMapVA);
|
||||
ReadBaseRelocationTable(Info, FileMapVA);
|
||||
ReadDebugDirectory(Info, FileMapVA);
|
||||
|
|
@ -691,20 +688,6 @@ bool ModSectionsFromAddr(duint Address, std::vector<MODSECTIONINFO>* Sections)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ModImportsFromAddr(duint Address, std::vector<MODIMPORTINFO>* Imports)
|
||||
{
|
||||
SHARED_ACQUIRE(LockModules);
|
||||
|
||||
auto module = ModInfoFromAddr(Address);
|
||||
|
||||
if(!module)
|
||||
return false;
|
||||
|
||||
// Copy vector <-> vector
|
||||
*Imports = module->imports;
|
||||
return true;
|
||||
}
|
||||
|
||||
duint ModEntryFromAddr(duint Address)
|
||||
{
|
||||
SHARED_ACQUIRE(LockModules);
|
||||
|
|
@ -751,35 +734,6 @@ void ModEnum(const std::function<void(const MODINFO &)> & cbEnum)
|
|||
cbEnum(mod.second);
|
||||
}
|
||||
|
||||
bool ModAddImportToModule(duint Base, const MODIMPORTINFO & importInfo)
|
||||
{
|
||||
SHARED_ACQUIRE(LockModules);
|
||||
|
||||
if(!Base || !importInfo.addr)
|
||||
return false;
|
||||
|
||||
auto module = ModInfoFromAddr(Base);
|
||||
|
||||
if(!module)
|
||||
return false;
|
||||
|
||||
// Search in Import Vector
|
||||
auto pImports = &(module->imports);
|
||||
auto it = std::find_if(pImports->begin(), pImports->end(), [&importInfo](const MODIMPORTINFO & currentImportInfo)->bool
|
||||
{
|
||||
return (importInfo.addr == currentImportInfo.addr);
|
||||
});
|
||||
|
||||
// Import in the list already
|
||||
if(it != pImports->end())
|
||||
return false;
|
||||
|
||||
// Add import to imports vector
|
||||
pImports->push_back(importInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int ModGetParty(duint Address)
|
||||
{
|
||||
SHARED_ACQUIRE(LockModules);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ struct MODINFO
|
|||
char path[MAX_PATH]; // File path (in UTF8)
|
||||
|
||||
std::vector<MODSECTIONINFO> sections;
|
||||
std::vector<MODIMPORTINFO> imports;
|
||||
std::vector<MODRELOCATIONINFO> relocations;
|
||||
std::vector<duint> tlsCallbacks;
|
||||
|
||||
|
|
@ -94,7 +93,6 @@ duint ModBaseFromName(const char* Module);
|
|||
duint ModSizeFromAddr(duint Address);
|
||||
std::string ModNameFromHash(duint Hash);
|
||||
bool ModSectionsFromAddr(duint Address, std::vector<MODSECTIONINFO>* Sections);
|
||||
bool ModImportsFromAddr(duint Address, std::vector<MODIMPORTINFO>* Imports);
|
||||
duint ModEntryFromAddr(duint Address);
|
||||
int ModPathFromAddr(duint Address, char* Path, int Size);
|
||||
int ModPathFromName(const char* Module, char* Path, int Size);
|
||||
|
|
@ -108,7 +106,6 @@ void ModEnum(const std::function<void(const MODINFO &)> & cbEnum);
|
|||
|
||||
int ModGetParty(duint Address);
|
||||
void ModSetParty(duint Address, int Party);
|
||||
bool ModAddImportToModule(duint Base, const MODIMPORTINFO & importInfo);
|
||||
bool ModRelocationsFromAddr(duint Address, std::vector<MODRELOCATIONINFO> & Relocations);
|
||||
bool ModRelocationAtAddr(duint Address, MODRELOCATIONINFO* Relocation);
|
||||
bool ModRelocationsInRange(duint Address, duint Size, std::vector<MODRELOCATIONINFO> & Relocations);
|
||||
|
|
|
|||
Loading…
Reference in New Issue