Quote:
Originally Posted by Terrat
Kein Programm ist perfekt außer der Windows Movie Maker ° _° :rtfm:
|
danke schonmal für die antworten. hier die meine funktion
Code:
DWORD func_add = 0x006439E0;
DWORD func_back = func_add + 0x06;
int(__stdcall *OnMapClick)(float, int, int, char, int, int, int);
int __declspec(naked) myfunction(float floatA, int intA, int intB, char charA, int intC,int intD, int intE){
__asm
{
push ebp // func_add, wenn der hook noch nicht gesetzt ist
mov ebp, esp
sub esp, 48h
}
printf("hey");//das hier alleine verursacht schon den crash :S
__asm {jmp func_back}
}
also in der main schreibe ich an der func_add ein jmp zu meiner function, dann kommt der asm teil der aus der funktion rausgeschrieben ist und dann kommen meine funktionen und dann der jmp back.
die funktion hat aufjedenfall etwas mit dem clicken in einem game zutun, die wird immer aufgerufen wenn ich iwo hinclicke um hinzulaufen.
crashen tut es nur wenn ich nicht auf den boden clicke, also wenn ich auf ein anderen player/npc/monster klicke dann crasht es :S wenn ich auf normalen boden clicke um hinzulaufen, dann läufts perfekt, echt komig
hier der ida auszug
was ich hier komig fand, war das die funktion 7 args oben hat, aber unten im stack iwie nur 6 sind, aber ich bin gerade noch in der anfangsphase bei asm, daher versteh ich solche funktionen auch leider immer nur bis zu einem gewissen teil, :S
Code:
text:006439E0 ; int __stdcall sub_6439E0(float, int, int, char, int, int, int)
.text:006439E0 sub_6439E0 proc near ; CODE XREF: sub_5DFCB0+4Bp
.text:006439E0 ; sub_5DFCB0+2D4p ...
.text:006439E0
.text:006439E0 var_48 = dword ptr -48h
.text:006439E0 var_41 = byte ptr -41h
.text:006439E0 var_40 = dword ptr -40h
.text:006439E0 var_3C = dword ptr -3Ch
.text:006439E0 var_38 = byte ptr -38h
.text:006439E0 var_34 = dword ptr -34h
.text:006439E0 var_2D = byte ptr -2Dh
.text:006439E0 var_2C = dword ptr -2Ch
.text:006439E0 var_28 = dword ptr -28h
.text:006439E0 var_24 = dword ptr -24h
.text:006439E0 arg_0 = dword ptr 8
.text:006439E0 arg_4 = dword ptr 0Ch
.text:006439E0 arg_8 = dword ptr 10h
.text:006439E0 arg_C = byte ptr 14h
.text:006439E0 arg_10 = dword ptr 18h
.text:006439E0 arg_14 = dword ptr 1Ch
.text:006439E0
.text:006439E0 push ebp
.text:006439E1 mov ebp, esp
.text:006439E3 sub esp, 48h
.text:006439E6 mov [ebp+var_24], ecx
.text:006439E9 mov eax, [ebp+arg_4]
.text:006439EC mov [ebp+var_28], eax
.text:006439EF mov ecx, [ebp+var_28]
.text:006439F2 inc ecx
.text:006439F3 mov [ebp+var_2C], ecx
.text:006439F6
.text:006439F6 loc_6439F6: ; CODE XREF: sub_6439E0+25j
.text:006439F6 mov edx, [ebp+var_28]
.text:006439F9 mov al, [edx]
.text:006439FB mov [ebp+var_2D], al
.text:006439FE inc [ebp+var_28]
.text:00643A01 cmp [ebp+var_2D], 0
.text:00643A05 jnz short loc_6439F6
.text:00643A07 mov ecx, [ebp+var_28]
.text:00643A0A sub ecx, [ebp+var_2C]
.text:00643A0D mov [ebp+var_34], ecx
.text:00643A10 jnz short loc_643A17
.text:00643A12 jmp loc_643C0C
.text:00643A17 ; ---------------------------------------------------------------------------
.text:00643A17
.text:00643A17 loc_643A17: ; CODE XREF: sub_6439E0+30j
.text:00643A17 mov edx, [ebp+var_24]
.text:00643A1A movzx eax, byte ptr [edx+0C0h]
.text:00643A21 cmp eax, 0FFh
.text:00643A26 jnz short loc_643A51
.text:00643A28 movzx ecx, [ebp+arg_C]
.text:00643A2C cmp ecx, 0FFh
.text:00643A32 jnz short loc_643A51
.text:00643A34 mov edx, [ebp+var_24]
.text:00643A37 mov eax, [ebp+arg_10]
.text:00643A3A mov [edx+0BCh], eax
.text:00643A40 mov ecx, [ebp+var_24]
.text:00643A43 mov dl, [ebp+arg_C]
.text:00643A46 mov [ecx+0C0h], dl
.text:00643A4C jmp loc_643C0C
.text:00643A51 ; ---------------------------------------------------------------------------
.text:00643A51
.text:00643A51 loc_643A51: ; CODE XREF: sub_6439E0+46j
.text:00643A51 ; sub_6439E0+52j
.text:00643A51 mov eax, [ebp+var_24]
.text:00643A54 cmp dword ptr [eax+0ECh], 0
.text:00643A5B jz short loc_643A88
.text:00643A5D mov ecx, [ebp+var_24]
.text:00643A60 mov edx, [ecx+0BCh]
.text:00643A66 cmp edx, [ebp+arg_10]
.text:00643A69 jnz short loc_643A88
.text:00643A6B mov eax, [ebp+var_24]
.text:00643A6E mov ecx, [eax+0E4h]
.text:00643A74 fld [ebp+arg_0]
.text:00643A77 fld dword ptr [ecx+5Ch]
.text:00643A7A fucompp
.text:00643A7C fnstsw ax
.text:00643A7E test ah, 44h
.text:00643A81 jp short loc_643A88
.text:00643A83 jmp loc_643C0C
.text:00643A88 ; ---------------------------------------------------------------------------
.text:00643A88
.text:00643A88 loc_643A88: ; CODE XREF: sub_6439E0+7Bj
.text:00643A88 ; sub_6439E0+89j ...
.text:00643A88 mov edx, [ebp+var_24]
.text:00643A8B mov eax, [ebp+arg_10]
.text:00643A8E mov [edx+0BCh], eax
.text:00643A94 mov ecx, [ebp+var_24]
.text:00643A97 mov dl, [ebp+arg_C]
.text:00643A9A mov [ecx+0C0h], dl
.text:00643AA0 mov eax, [ebp+var_24]
.text:00643AA3 mov ecx, [ebp+arg_8]
.text:00643AA6 mov [eax+0B4h], ecx
.text:00643AAC call ds:GetTickCount
.text:00643AB2 mov edx, [ebp+var_24]
.text:00643AB5 mov [edx+0C4h], eax
.text:00643ABB mov eax, [ebp+var_24]
.text:00643ABE mov cl, [eax+0C0h]
.text:00643AC4 mov [ebp+var_38], cl
.text:00643AC7 cmp [ebp+var_38], 0
.text:00643ACB jz short loc_643ADB
.text:00643ACD cmp [ebp+var_38], 1
.text:00643AD1 jz short loc_643AFA
.text:00643AD3 cmp [ebp+var_38], 2
.text:00643AD7 jz short loc_643B18
.text:00643AD9 jmp short loc_643B44
.text:00643ADB ; ---------------------------------------------------------------------------
.text:00643ADB
.text:00643ADB loc_643ADB: ; CODE XREF: sub_6439E0+EBj
.text:00643ADB mov edx, [ebp+var_24]
.text:00643ADE mov eax, [edx+0E4h]
.text:00643AE4 mov dword ptr [eax+40h], 1
.text:00643AEB mov ecx, [ebp+var_24]
.text:00643AEE mov dword ptr [ecx+0B8h], 0FFFFFFh
.text:00643AF8 jmp short loc_643B61
.text:00643AFA ; ---------------------------------------------------------------------------
.text:00643AFA
.text:00643AFA loc_643AFA: ; CODE XREF: sub_6439E0+F1j
.text:00643AFA mov edx, [ebp+var_24]
.text:00643AFD mov eax, [edx+0E4h]
.text:00643B03 mov dword ptr [eax+40h], 0
.text:00643B0A mov ecx, [ebp+var_24]
.text:00643B0D mov edx, [ebp+arg_14]
.text:00643B10 mov [ecx+0B8h], edx
.text:00643B16 jmp short loc_643B61
.text:00643B18 ; ---------------------------------------------------------------------------
.text:00643B18
.text:00643B18 loc_643B18: ; CODE XREF: sub_6439E0+F7j
.text:00643B18 mov eax, [ebp+var_24]
.text:00643B1B mov dword ptr [eax+0B4h], 0FFFFFFFFh
.text:00643B25 mov ecx, [ebp+var_24]
.text:00643B28 mov edx, [ecx+0E4h]
.text:00643B2E mov dword ptr [edx+40h], 1
.text:00643B35 mov eax, [ebp+var_24]
.text:00643B38 mov dword ptr [eax+0B8h], 0FFFFFFh
.text:00643B42 jmp short loc_643B61
.text:00643B44 ; ---------------------------------------------------------------------------
.text:00643B44
.text:00643B44 loc_643B44: ; CODE XREF: sub_6439E0+F9j
.text:00643B44 mov ecx, [ebp+var_24]
.text:00643B47 mov edx, [ecx+0E4h]
.text:00643B4D mov dword ptr [edx+40h], 0
.text:00643B54 mov eax, [ebp+var_24]
.text:00643B57 mov dword ptr [eax+0B8h], 0FFFFFFh
.text:00643B61
.text:00643B61 loc_643B61: ; CODE XREF: sub_6439E0+118j
.text:00643B61 ; sub_6439E0+136j ...
.text:00643B61 mov ecx, [ebp+var_24]
.text:00643B64 mov edx, [ecx+0E4h]
.text:00643B6A mov eax, [ebp+arg_0]
.text:00643B6D mov [edx+5Ch], eax
.text:00643B70 mov ecx, [ebp+arg_4]
.text:00643B73 mov [ebp+var_3C], ecx
.text:00643B76 mov edx, [ebp+var_3C]
.text:00643B79 inc edx
.text:00643B7A mov [ebp+var_40], edx
.text:00643B7D
.text:00643B7D loc_643B7D: ; CODE XREF: sub_6439E0+1ACj
.text:00643B7D mov eax, [ebp+var_3C]
.text:00643B80 mov cl, [eax]
.text:00643B82 mov [ebp+var_41], cl
.text:00643B85 inc [ebp+var_3C]
.text:00643B88 cmp [ebp+var_41], 0
.text:00643B8C jnz short loc_643B7D
.text:00643B8E mov edx, [ebp+var_3C]
.text:00643B91 sub edx, [ebp+var_40]
.text:00643B94 mov [ebp+var_48], edx
.text:00643B97 mov eax, [ebp+var_48]
.text:00643B9A push eax
.text:00643B9B mov ecx, [ebp+arg_4]
.text:00643B9E push ecx
.text:00643B9F mov ecx, [ebp+var_24]
.text:00643BA2 add ecx, 0C8h
.text:00643BA8 call sub_40B5E0
.text:00643BAD push 0
.text:00643BAF mov edx, [ebp+arg_10]
.text:00643BB2 push edx
.text:00643BB3 call sub_40CDC0
.text:00643BB8 add esp, 8
.text:00643BBB mov ecx, [ebp+var_24]
.text:00643BBE mov [ecx+0ECh], eax
.text:00643BC4 mov edx, [ebp+var_24]
.text:00643BC7 cmp dword ptr [edx+0ECh], 0
.text:00643BCE jz short loc_643BF2
.text:00643BD0 mov eax, [ebp+var_24]
.text:00643BD3 mov ecx, [eax+0ECh]
.text:00643BD9 mov edx, [ebp+var_24]
.text:00643BDC mov eax, [edx+0ECh]
.text:00643BE2 mov edx, [ecx]
.text:00643BE4 mov ecx, eax
.text:00643BE6 call dword ptr [edx+5Ch]
.text:00643BE9 movzx eax, al
.text:00643BEC test eax, eax
.text:00643BEE jnz short loc_643BF2
.text:00643BF0 jmp short loc_643C0C
.text:00643BF2 ; ---------------------------------------------------------------------------
.text:00643BF2
.text:00643BF2 loc_643BF2: ; CODE XREF: sub_6439E0+1EEj
.text:00643BF2 ; sub_6439E0+20Ej
.text:00643BF2 cmp dword_891C08, 0
.text:00643BF9 jz short loc_643BFD
.text:00643BFB jmp short loc_643C0C
.text:00643BFD ; ---------------------------------------------------------------------------
.text:00643BFD
.text:00643BFD loc_643BFD: ; CODE XREF: sub_6439E0+219j
.text:00643BFD mov ecx, [ebp+var_24]
.text:00643C00 add ecx, 14h
.text:00643C03 push ecx ; lprc
.text:00643C04 mov ecx, [ebp+var_24]
.text:00643C07 call sub_410940
.text:00643C0C
.text:00643C0C loc_643C0C: ; CODE XREF: sub_6439E0+32j
.text:00643C0C ; sub_6439E0+6Cj ...
.text:00643C0C mov esp, ebp
.text:00643C0E pop ebp
.text:00643C0F retn 1Ch
.text:00643C0F sub_6439E0 endp