#include <windows.h>
#include <stdio.h>
#define DLL_NAME "user32.dll"
void main()
{
BYTE *ptr;
int position, address;
HINSTANCE handle;
BOOL done_flag = FALSE;
handle = LoadLibrary(DLL_NAME);
if(!handle)
{
printf("load dll erro!");
exit(0);
}
ptr = (BYTE*)handle;
for(position = 0; !done_flag; position++)
{
try
{
if(ptr[position] == 0xFF && ptr[position + 1] == 0xE4)
{
int address = (int)ptr + position;
printf("OPCODE found at 0x%x\n", address);
}
}
catch()
{
int address = (int)ptr + position;
printf("END OF 0x%x\n", address);
done_flag = true;
}
}
}
catch()里面应该填什么?才能正常找出全部跳转地址呢?
我写的是catch(int)结果退出时候没有执行到catch里的语句……
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!