这是我写MY_HidD_SetFeature函数源码:
extern "C" __declspec(dllexport) BOOLEAN MY_HidD_SetFeature(IN HANDLE HidDeviceObject,IN PVOID ReportBuffer,IN ULONG ReportBufferLength)
{
GetAddress("HidD_SetFeature");//获取HidD_SetFeature地址
_asm
{
push ReportBufferLength
push ReportBuffer
push HidDeviceObject
call eax
}
return TRUE;
}
调试时发现:
02211210 8B4424 08 mov eax, dword ptr [esp+0x8]
02211214 8B4C24 04 mov ecx, dword ptr [esp+0x4]
02211218 6A 49 push 0x49
0221121A 50 push eax
0221121B 51 push ecx
0221121C E8 01090000 call <jmp.&HID.HidD_SetFeature> ; 这里调用自己的函数
02211221 F6D8 neg al
02211223 1BC0 sbb eax, eax
02211225 25 F7FFEF5F and eax, 0x5FEFFFF7
0221122A 05 090010A0 add eax, 0xA0100009
0221122F C3 retn ;可是这里返回后地址无效
来到这里调用
100012A0 > 55 push ebp ; 调用自己的函数
100012A1 8BEC mov ebp, esp
100012A3 B9 DC220010 mov ecx, 100022DC ; ASCII "HidD_SetFeature"
100012A8 E8 F3FDFFFF call AheadLib::GetAddress
100012AD FF75 10 push dword ptr [ebp+0x10]
100012B0 FF75 0C push dword ptr [ebp+0xC]
100012B3 FF75 08 push dword ptr [ebp+0x8]
100012B6 FFD0 call eax
100012B8 B0 01 mov al, 0x1
100012BA 5D pop ebp
100012BB C3 retn ; 这里正常返回
返回这里地址就无效了,不知道为什么,请求帮助!
02211225 25 F7FFEF5F and eax, 0x5FEFFFF7
0221122A 05 090010A0 add eax, 0xA0100009
0221122F C3 retn ;返回地址无效
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!