Hey,
Ich versuche jetzt schon seid ein paar stunden einen hook zum laufen zu bekommen. Leider crasht das programm direkt wenn es dort ankommt.
hier der assembler code:
Die andere function wo der stack ist den ich haben möchte
Ich habe mir gedacht ich fange den call von der ersten function ab und versuche dann irgendwie an edx bzw eax zu kommen...
Dieser abschnitt sendet normalerweise die packet von einem Spiel. Ich will jetzt den buf auslesen. Was mich leich irritiert ist das der buf beim ersten mal EAX ist und beim 2. mal EDX.
Was ich bisher versucht habe:
Ich hoffe ihr könnt mir da ein bissal weiterhelfen bzw mir sagen was falsch ist ...
//edit
sry hatte ich vergessen
Die braucht ihr auch noch ;)
greetz
R4Y
Ich versuche jetzt schon seid ein paar stunden einen hook zum laufen zu bekommen. Leider crasht das programm direkt wenn es dort ankommt.
hier der assembler code:
Code:
.code:0052CD87 loc_52CD87: ; CODE XREF: sub_52CD70+10j .code:0052CD87 mov ecx, [ebp+var_10] .code:0052CD8A mov edx, [ecx+4] .code:0052CD8D mov [ebp+len], edx .code:0052CD90 mov eax, [ebp+var_10] .code:0052CD93 mov ecx, [eax+5F54h] .code:0052CD99 mov [ebp+var_C], ecx .code:0052CD9C push 0 ; flags .code:0052CD9E mov edx, [ebp+len] .code:0052CDA1 push edx ; len .code:0052CDA2 mov eax, [ebp+var_10] .code:0052CDA5 add eax, 8 ; Add .code:0052CDA8 push eax ; buf .code:0052CDA9 mov ecx, [ebp+var_C] .code:0052CDAC mov edx, [ecx+4] .code:0052CDAF push edx ; s .code:0052CDB0 mov ecx, [ebp+var_C] .code:0052CDB3 call sub_52F0C0 ; Call Procedure .code:0052CDB8 mov [ebp+Size], eax .code:0052CDBB cmp [ebp+Size], 0FFFFFFFFh ; Compare Two Operands .code:0052CDBF jnz short loc_52CDDA ; Jump if Not Zero (ZF=0) .code:0052CDC1 call dword ptr byte_6920D0+0C8h ; Indirect Call Near Procedure .code:0052CDC7 cmp eax, 2733h ; Compare Two Operands .code:0052CDCC jnz short loc_52CDD0 ; Jump if Not Zero (ZF=0) .code:0052CDCE jmp short loc_52CE0A ; Jump
Code:
.code:0052F0C0 ; int __stdcall sub_52F0C0(SOCKET s, char *buf, int len, int flags) .code:0052F0C0 sub_52F0C0 proc near ; CODE XREF: sub_52CC80+6Dp .code:0052F0C0 ; sub_52CD70+43p .code:0052F0C0 .code:0052F0C0 var_8 = dword ptr -8 .code:0052F0C0 var_4 = dword ptr -4 .code:0052F0C0 s = dword ptr 8 .code:0052F0C0 buf = dword ptr 0Ch .code:0052F0C0 len = dword ptr 10h .code:0052F0C0 flags = dword ptr 14h .code:0052F0C0 .code:0052F0C0 push ebp .code:0052F0C1 mov ebp, esp .code:0052F0C3 sub esp, 8 ; Integer Subtraction .code:0052F0C6 mov [ebp+var_8], ecx .code:0052F0C9 mov eax, [ebp+flags] .code:0052F0CC push eax ; flags .code:0052F0CD mov ecx, [ebp+len] .code:0052F0D0 push ecx ; len .code:0052F0D1 mov edx, [ebp+buf] .code:0052F0D4 push edx ; buf .code:0052F0D5 mov eax, [ebp+s] .code:0052F0D8 push eax ; s .code:0052F0D9 call send ; Indirect Call Near Procedure .code:0052F0DF mov [ebp+var_4], eax .code:0052F0E2 cmp [ebp+var_4], 0FFFFFFFFh ; Compare Two Operands .code:0052F0E6 jnz short loc_52F100 ; Jump if Not Zero (ZF=0) .code:0052F0E8 mov ecx, 1 .code:0052F0ED test ecx, ecx ; Logical Compare .code:0052F0EF jz short loc_52F0F3 ; Jump if Zero (ZF=1) .code:0052F0F1 jmp short loc_52F100 ; Jump
Dieser abschnitt sendet normalerweise die packet von einem Spiel. Ich will jetzt den buf auslesen. Was mich leich irritiert ist das der buf beim ersten mal EAX ist und beim 2. mal EDX.
Was ich bisher versucht habe:
Code:
DWORD backsend=0x0052F0C0;
DWORD WINAPI MySend()
{
DWORD buf;
DWORD abcd=0x0052F0C0;
printf("Packet Sended: n");
StartZw();
__asm
{
mov buf,EAX
}
EndZw();
printf("%xn",buf);
__asm jmp backsend;
}
Intercept(INST_CALL,0x0052CDB3,(DWORD)MySend,5);
//edit
sry hatte ich vergessen
Code:
void StartZw()
{
__asm
{
push eax
push ebx
push ecx
push edx
}
}
void EndZw()
{
__asm
{
pop edx
pop ecx
pop ebx
pop eax
}
}
greetz
R4Y