关于DLL,一段代码,编译出错

来源:百度知道 编辑:UC知道 时间:2024/05/22 13:04:24
是在网上找到的一段代码,如下:

void HideDll()
{
HMODULE hMod = ::GetModuleHandle("mydll.dll");
PLIST_ENTRY Head,Cur;
PPEB_LDR_DATA ldr;
PLDR_MODULE ldm;
__asm
{
mov eax , fs:[0x30]
mov ecx , [eax + 0x0c] //Ldr
mov ldr , ecx
}
Head = &(ldr->InLoadOrderModuleList);
Cur = Head->Flink;
do
{
ldm = CONTAINING_RECORD( Cur, LDR_MODULE, InLoadOrderModuleList);
//printf("EntryPoint [0x%X]\n",ldm->BaseAddress);
if( hMod == ldm->BaseAddress)
{
ldm->InLoadOrderModuleList.Blink->Flink =
ldm->InLoadOrderModuleList.Flink;
ldm->InLoadOrderModuleList.Flink->Blink =
ldm->InLoadOrderModuleList.Blink;
ldm->InInitializationOrderModuleList.Blink->Flink =

就你现在说发的代码,应该是你有写头文件没有include..比如HMODULE很明显是属于某个头文件..

非常不好意思..这方面的C++没有深入学习过..估计不能帮你解决问题了..
办理找了两篇文章看能不能对你有所帮助
http://cache.baidu.com/c?m=9d78d513d9991ef20eaaca291a16a63c4609d6743ca6c7140cc39238846528564616b6ec617d4d52949b2b3d52f31f02bde47132690c7af1dd8a9f4baea68f72749f2743204fdd1755c419d89a1b7adc61d706bcf24cfaeaae6fc6b38995880b4e9d52542ad3a0880b0447cf3ef3173be8ac9c1e110f14ebeb276588033176c1&p=8a759a4f9c851df40be2973e4b&user=baidu

http://hi.baidu.com/estellejia