能力值:
( LV4,RANK:50 )
|
-
-
2 楼
首先,可以用LordPE加一个MessageBoxA,
再在定位时使用相对地址,不要直接用绝对的
如
mov eax,[esp]
add eax,0x1234
call [eax]
|
能力值:
( LV9,RANK:290 )
|
-
-
3 楼
[QUOTE=wyqzm;468143]首先,可以用LordPE加一个MessageBoxA,
再在定位时使用相对地址,不要直接用绝对的
如
mov eax,[esp]
add eax,0x1234
call [eax][/QUOTE]
最好是有像内存补丁的方式,因为那样就不用修改程序了(一般自检验N多,包括壳和程序的,不太方便)
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
给你一段我以前写过的代码看看
#include "windows.h"
#pragma comment(linker, "/entry:main")
typedef HANDLE (WINAPI *MYOpenProcess)(DWORD, BOOL, DWORD);
//get kernel base image address
unsigned int GetBaseImage()
{
__asm {
mov eax,fs:[30h]
mov eax,[eax+0ch]
mov esi,[eax+1ch]
lodsd
mov eax,[eax+08h] //return
}
}
unsigned int GetAPIFuncAdress(unsigned int nImageBase,const char *pFuncName, int iLen)
{
__asm {
mov eax,nImageBase
mov eax,[eax+0x3c]
add eax,nImageBase //PE header
mov eax,[eax+0x78]
add eax,nImageBase //Data_Directory
mov esi,eax //IMAGE_EXPORT_DIRECTORY
mov ecx,[eax+0x18] //NumberOfName
mov eax,[eax+0x20] //AddressOfName
add eax,nImageBase
mov ebx,eax
xor edx,edx
FindLoop:
push ecx
push esi
mov eax,[eax]
add eax,nImageBase
mov esi,pFuncName
mov edi,eax
mov ecx,iLen
cld
rep cmpsb //compare function
pop esi //pop esi => IMAGE_EXPORT_DIRECTORY
je Found
inc edx
add ebx,4
mov eax,ebx
pop ecx
loop FindLoop
Found:
add esp,4
mov eax,esi
mov eax,[eax+0x1c] //AddressOfFunction
add eax,nImageBase
shl edx,2
add eax,edx
mov eax,[eax]
add eax,nImageBase //eax return
}
}
int main()
{
char *szTitle = "title";
char *szMsg = "message";
char *szUserDLL = "User32.dll";
char *szMessagebox = "MessageBoxA";
unsigned int nBaseImage = 0;
unsigned int nLoadLibraryAdress = 0;
unsigned int nGetProcAddress = 0;
nBaseImage = GetBaseImage();
nLoadLibraryAdress = GetAPIFuncAdress(nBaseImage, "LoadLibraryA", 12);
nGetProcAddress = GetAPIFuncAdress(nBaseImage, "GetProcAddress", 14);
__asm {
push szUserDLL
call dword ptr nLoadLibraryAdress
push szMessagebox
push eax
call dword ptr nGetProcAddress
push MB_OK
push szTitle
push szMsg
push NULL
call eax
}
ExitProcess(0);
return 0;
}
|