summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/dll_sniffer.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mir_app/src/dll_sniffer.cpp b/src/mir_app/src/dll_sniffer.cpp
index 1d8f928e74..639d12b91e 100644
--- a/src/mir_app/src/dll_sniffer.cpp
+++ b/src/mir_app/src/dll_sniffer.cpp
@@ -126,7 +126,10 @@ MUUID* GetPluginInterfaces(const wchar_t *ptszFileName, bool &bIsPlugin)
// Export information entry
DWORD expAddr = pIDD[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
DWORD expSize = pIDD[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
- if (expSize < sizeof(IMAGE_EXPORT_DIRECTORY)) __leave;
+ if (expSize == 0)
+ nChecks++;
+ else if (expSize < sizeof(IMAGE_EXPORT_DIRECTORY))
+ __leave;
BYTE* pImage = ptr + pIDH->e_lfanew + pINTH->FileHeader.SizeOfOptionalHeader + sizeof(IMAGE_NT_HEADERS) - sizeof(IMAGE_OPTIONAL_HEADER);
@@ -144,22 +147,15 @@ MUUID* GetPluginInterfaces(const wchar_t *ptszFileName, bool &bIsPlugin)
DWORD *ptrFuncList = (DWORD*)&pSecStart[pED->AddressOfFunctions];
MUUID *pIds = nullptr;
- bool bHasLoad = false, bHasUnload = false, bHasMuuids = false;
+ bool bHasMuuids = false;
for (size_t i = 0; i < pED->NumberOfNames; i++, ptrRVA++, ptrOrdRVA++) {
char *szName = (char*)&pSecStart[*ptrRVA];
- if (!mir_strcmp(szName, "Load"))
- bHasLoad = true;
- else if (!mir_strcmp(szName, "Unload"))
- bHasUnload = true;
- else if (!mir_strcmp(szName, "MirandaInterfaces")) {
+ if (!mir_strcmp(szName, "MirandaInterfaces")) {
bHasMuuids = true;
pIds = (MUUID*)&pSecStart[ptrFuncList[*ptrOrdRVA]];
}
}
- if (!bHasLoad || !bHasUnload)
- __leave;
-
nChecks++;
// a plugin might have no interfaces