LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter
)
.text:77E6BE11 SetUnhandledExceptionFilter proc near
.text:77E6BE11 mov ecx, [esp+lpTopLevelExceptionFilter] //????????這兒是甚麼意思,為甚麼要ESP+lpTopLevelExceptionFilter呢
.text:77E6BE15 mov eax, dword_77EBF44C
.text:77E6BE1A mov dword_77EBF44C, ecx
.text:77E6BE20 retn 4
.text:77E6BE20 SetUnhandledExceptionFilter endp
這個是對函數SetUnhandledExceptionFilter反匯編之後的代碼,
下面是可以获得你当前系统中存放默认异常处理的地址
#include <stdio.h>
#include <windows.h>
void main()
{
unsigned int sehaddr;
int *un;
HMODULE hk = LoadLibrary("KERNEL32.dll");
un = (int *)GetProcAddress(hk,"SetUnhandledExceptionFilter");
_asm{
mov eax,un
add eax,5 //?????????????????????這兒為甚麼是加5
mov ebx,[eax]
mov sehaddr,ebx
}
printf("the top seh: 0x%x\r\n",sehaddr);
_getch();
return;
}
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter
)
.text:77E6BE11 SetUnhandledExceptionFilter proc near
.text:77E6BE11 mov ecx, [esp+lpTopLevelExceptionFilter] //????????這兒是甚麼意思,為甚麼要ESP+lpTopLevelExceptionFilter呢
.text:77E6BE15 mov eax, dword_77EBF44C
.text:77E6BE1A mov dword_77EBF44C, ecx
.text:77E6BE20 retn 4
.text:77E6BE20 SetUnhandledExceptionFilter endp
這個是對函數SetUnhandledExceptionFilter反匯編之後的代碼,
下面是可以获得你当前系统中存放默认异常处理的地址
#include <stdio.h>
#include <windows.h>
void main()
{
unsigned int sehaddr;
int *un;
HMODULE hk = LoadLibrary("KERNEL32.dll");
un = (int *)GetProcAddress(hk,"SetUnhandledExceptionFilter");
_asm{
mov eax,un
add eax,5 //?????????????????????這兒為甚麼是加5
mov ebx,[eax]
mov sehaddr,ebx
}
printf("the top seh: 0x%x\r\n",sehaddr);
_getch();
return;
}
77E6BE11 8B 4C 24 04 mov ecx,dword ptr [esp+4]
77E6BE15 A1 4C F4 EB 77 mov eax,[77EBF44C]
------
un为可执行代码的开始地址,即0x77E6BE11,[un+5]就是默认异常处理的地址啰