D
dunbai
Unregistered / Unconfirmed
GUEST, unregistred user!
//说明:以下代码是写在DLL里面的C++代码,那位熟悉C和Delphi的朋友帮忙翻译一下!
//======================================================
DWORD ob=*(DWORD*)0x01232d5c;
DWORD bod=*(DWORD*)0x01232d48;
void _DispFunc();
BOOL setob();
void oo();
DWORD WINAPI testfunction(LPVOID lpParam)
{
DWORD dwOldFlag;
VirtualProtect((void*)0x0043D3C2,5,PAGE_READWRITE,&dwOldFlag);
*((DWORD*)0x0043D3C2)=(DWORD)0x59585a59;
*((BYTE *)0x0043D3C6)=(BYTE )0x5f;
VirtualProtect((void*)0x0043D3C2,5,dwOldFlag,&dwOldFlag);
FARPROC p=(FARPROC)_DispFunc;
DWORD dwP=(DWORD)p-0x0043D3CE-0x5;
VirtualProtect((void*)0x0043D3Cf,4,PAGE_READWRITE,&dwOldFlag);
*((DWORD*)0x0043D3Cf)=(DWORD)dwP;
VirtualProtect((void*)0x0043D3Cf,4,dwOldFlag,&dwOldFlag);
setob();
return 1;
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CloseHandle(CreateThread(NULL,NULL,testfunction,NULL,NULL,NULL));
default:
return TRUE;
}
return TRUE;
}
float x=-330.0,y=1500.0;
float * lx=&x,*ly=&y;
void __declspec(naked) _DispFunc()
{
_asm
{
//mov ob,[01232d5ch];
/*call setob
test al,al
jnz ok
mov eax,[lx]
mov [ebp-2ch],eax
mov eax,[ly]
mov [ebp-24h],eax
jmp back
ok:*/
call oo
//mov eax,ob
//mov edx,[eax+4bch]
//mov [ebp-2ch],edx
//mov eax,[eax+4c4h]
//mov [ebp-24h],eax
mov eax,ob
mov eax,[eax+8]
mov edx,bod
mov [edx+3840],eax
//back:
mov al,01h
ret
}
}
void getob()
{
DWORD tob,temp=0x01232d4c,tmy=*(DWORD *)0x1232d48;
float mx=*(float*)(tmy+0x1010)
,my=*(float*)(tmy+0x1018)
,gx=*(float*)((*(DWORD*)temp)+0x4c8)
,gy=*(float*)((*(DWORD*)temp)+0x4d0)
,ox=*(float*)(ob+0x4c8)
,oy=*(float*)(ob+0x4d0)
;
tob=*((DWORD *)temp);
for(int i=0;i<34;i+=4)
{
temp=temp+i;
if
(
sqrt((mx-ox)*(mx*ox)+(my-oy)*(my-oy))>
sqrt((mx-gx)*(mx-gx)+(my-gy)*(my-gy))
//(*((DWORD *)temp))
)
tob=*((DWORD *)temp);
}
ob=tob ;
}
void oo()
{
if(*(DWORD*)(ob+0x270)==0x00000000)
setob();
}
BOOL setob()
{
DWORD temp=0x01232d4c;
while(*(DWORD*)temp!=0x000000)
{
if(*(DWORD*)(*(DWORD *)temp+0x260)==0x00002712)
{
ob=*(DWORD*)temp;
return 1;
}
temp=temp+4;
}
return 0;
//ob=*(DWORD*)0x01232d4c;
//getob();
}
//======================================================
DWORD ob=*(DWORD*)0x01232d5c;
DWORD bod=*(DWORD*)0x01232d48;
void _DispFunc();
BOOL setob();
void oo();
DWORD WINAPI testfunction(LPVOID lpParam)
{
DWORD dwOldFlag;
VirtualProtect((void*)0x0043D3C2,5,PAGE_READWRITE,&dwOldFlag);
*((DWORD*)0x0043D3C2)=(DWORD)0x59585a59;
*((BYTE *)0x0043D3C6)=(BYTE )0x5f;
VirtualProtect((void*)0x0043D3C2,5,dwOldFlag,&dwOldFlag);
FARPROC p=(FARPROC)_DispFunc;
DWORD dwP=(DWORD)p-0x0043D3CE-0x5;
VirtualProtect((void*)0x0043D3Cf,4,PAGE_READWRITE,&dwOldFlag);
*((DWORD*)0x0043D3Cf)=(DWORD)dwP;
VirtualProtect((void*)0x0043D3Cf,4,dwOldFlag,&dwOldFlag);
setob();
return 1;
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CloseHandle(CreateThread(NULL,NULL,testfunction,NULL,NULL,NULL));
default:
return TRUE;
}
return TRUE;
}
float x=-330.0,y=1500.0;
float * lx=&x,*ly=&y;
void __declspec(naked) _DispFunc()
{
_asm
{
//mov ob,[01232d5ch];
/*call setob
test al,al
jnz ok
mov eax,[lx]
mov [ebp-2ch],eax
mov eax,[ly]
mov [ebp-24h],eax
jmp back
ok:*/
call oo
//mov eax,ob
//mov edx,[eax+4bch]
//mov [ebp-2ch],edx
//mov eax,[eax+4c4h]
//mov [ebp-24h],eax
mov eax,ob
mov eax,[eax+8]
mov edx,bod
mov [edx+3840],eax
//back:
mov al,01h
ret
}
}
void getob()
{
DWORD tob,temp=0x01232d4c,tmy=*(DWORD *)0x1232d48;
float mx=*(float*)(tmy+0x1010)
,my=*(float*)(tmy+0x1018)
,gx=*(float*)((*(DWORD*)temp)+0x4c8)
,gy=*(float*)((*(DWORD*)temp)+0x4d0)
,ox=*(float*)(ob+0x4c8)
,oy=*(float*)(ob+0x4d0)
;
tob=*((DWORD *)temp);
for(int i=0;i<34;i+=4)
{
temp=temp+i;
if
(
sqrt((mx-ox)*(mx*ox)+(my-oy)*(my-oy))>
sqrt((mx-gx)*(mx-gx)+(my-gy)*(my-gy))
//(*((DWORD *)temp))
)
tob=*((DWORD *)temp);
}
ob=tob ;
}
void oo()
{
if(*(DWORD*)(ob+0x270)==0x00000000)
setob();
}
BOOL setob()
{
DWORD temp=0x01232d4c;
while(*(DWORD*)temp!=0x000000)
{
if(*(DWORD*)(*(DWORD *)temp+0x260)==0x00002712)
{
ob=*(DWORD*)temp;
return 1;
}
temp=temp+4;
}
return 0;
//ob=*(DWORD*)0x01232d4c;
//getob();
}