Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不能识别通过loadlibrary加载的dll,存在重复加载 #45

Open
guohaoli opened this issue Jun 24, 2024 · 1 comment
Open

不能识别通过loadlibrary加载的dll,存在重复加载 #45

guohaoli opened this issue Jun 24, 2024 · 1 comment

Comments

@guohaoli
Copy link

现象描述:
我先用loadlibrary加载一个dll,然后再用LdrLoadDllMemoryExW加载同样的dll,LdrLoadDllMemoryExW没有办法识别已经加载过的loadlibrary,无法对dll引用进行自增,而是重复执行dll加载代码。

无法识别的代码段:
函数位置LdrLoadDllMemoryExW->MapMemoryModuleHandle
具体代码:pModule->Signature != MEMORY_MODULE_SIGNATURE和pModule->codeBase != (LPBYTE)hModule都为true,导致返回结果为nullptr

@bb107
Copy link
Owner

bb107 commented Jun 25, 2024

你好,使用LoadLibrary加载的DLL不包含MEMORYMODULE结构,因此不能被识别。如果需要验证是否已被加载,请在加载前调用GetModuleHandle函数。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants