Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Kal Online
You last visited: Today at 15:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



IDA GetFileVersionInfoA hooking

Discussion on IDA GetFileVersionInfoA hooking within the Kal Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
BorSti's Avatar
 
elite*gold: 20
Join Date: Feb 2008
Posts: 993
Received Thanks: 173
IDA GetFileVersionInfoA hooking

Hey

iam trying to learn some stuff about this filecheck function..... My dll gets after ~5 min detected by filecheck(3 subfrunctions) - so iam trying to hook the function

For Example now GetFileVersionInfoSizeA
Code:
.text:006AC976 ; DWORD __stdcall GetFileVersionInfoSizeA(LPSTR lptstrFilename, LPDWORD lpdwHandle)
.text:006AC976 GetFileVersionInfoSizeA proc near       ; CODE XREF: [COLOR="Red"]sub_47BD00[/COLOR]+24p
.text:006AC976                                         ; [COLOR="Lime"]WinMain(x,x,x,x)[/COLOR]+B81p ...
.text:006AC976                 jmp     ds:__imp_GetFileVersionInfoSizeA
.text:006AC976 GetFileVersionInfoSizeA endp
Means - GetFileVersionInfoSizeA is a function with 2 parameters(first parameter return of sub_47BD00 , second parameter return of WinMain(x,x,x,x)) and with a return of DWORD - Right?

Well then i checked the function sub_47BD00
Code:
text:0047BD00 ; int __cdecl sub_47BD00(LPSTR lptstrFilename, int)
.text:0047BD00 sub_47BD00      proc near               ; CODE XREF: sub_47AA40+109p
.text:0047BD00                                         ; sub_47AA40+34Ep ...
.text:0047BD00
.text:0047BD00 var_1C          = dword ptr -1Ch
.text:0047BD00 Memory          = dword ptr -18h
.text:0047BD00 var_14          = dword ptr -14h
.text:0047BD00 lpBuffer        = dword ptr -10h
.text:0047BD00 pBlock          = dword ptr -0Ch
.text:0047BD00 puLen           = dword ptr -8
.text:0047BD00 dwHandle        = dword ptr -4
.text:0047BD00 lptstrFilename  = dword ptr  8
.text:0047BD00 arg_4           = dword ptr  0Ch
.text:0047BD00
.text:0047BD00                 push    ebp
.text:0047BD01                 mov     ebp, esp
.text:0047BD03                 sub     esp, 1Ch
.text:0047BD06                 cmp     [ebp+lptstrFilename], 0
.text:0047BD0A                 jz      short loc_47BD12
.text:0047BD0C                 cmp     [ebp+arg_4], 0
.text:0047BD10                 jnz     short loc_47BD1C
.text:0047BD12
.text:0047BD12 loc_47BD12:                             ; CODE XREF: sub_47BD00+Aj
.text:0047BD12                 mov     eax, 80070057h
.text:0047BD17
.text:0047BD17 loc_47BD17:
.text:0047BD17                 jmp     loc_47BDDD
and WinMain(x,x,x,x)
Code:
; int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
.text:006595C0 _WinMain@16     proc near               ; CODE XREF: start+17Fp
.text:006595C0
.text:006595C0 var_8           = dword ptr -8
.text:006595C0 hInstance       = dword ptr  4
.text:006595C0 hPrevInstance   = dword ptr  8
.text:006595C0 lpCmdLine       = dword ptr  0Ch
.text:006595C0 nShowCmd        = dword ptr  10h
.text:006595C0
.text:006595C0                 push    ebx
.text:006595C1                 mov     ebx, esp
.text:006595C3                 sub     esp, 8
.text:006595C6                 and     esp, 0FFFFFFF0h
.text:006595C9                 add     esp, 4
.text:006595CC                 push    ebp
.text:006595CD                 mov     ebp, [ebx+4]
.text:006595D0                 mov     [esp+0Ch+var_8], ebp
.text:006595D4                 mov     ebp, esp
.text:006595D6                 mov     eax, 1238h
.text:006595DB                 call    __alloca_probe
.text:006595E0                 mov     eax, dword_782188
.text:006595E5                 mov     [ebp-4], eax
.text:006595E8                 push    esi
.text:006595E9                 push    edi
.text:006595EA                 mov     dword ptr [ebp-8], 0
.text:006595F1                 mov     dword ptr [ebp-0Ch], 64h
.text:006595F8                 push    offset dword_78DC78
.text:006595FD                 call    sub_659560
.text:00659602                 add     esp, 4
.text:00659605                 mov     eax, [ebx+8]
.text:00659608                 mov     hInstance, eax
.text:0065960D                 call    ds:InitCommonControls
.text:00659613                 call    __initp_misc_winxfltr
.text:00659618                 mov     dword ptr [ebp-10h], 0
.text:0065961F                 push    1
.text:00659621                 lea     ecx, [ebp-10h]
.text:00659624                 push    ecx
.text:00659625                 push    0FFF0h
.text:0065962A                 call    sub_5D0B50
.text:0065962F                 add     esp, 0Ch
.text:00659632                 mov     dword_877530, eax
.text:00659637                 mov     dword ptr [ebp-10h], 0
.text:0065963E                 push    1
.text:00659640                 lea     edx, [ebp-10h]
.text:00659643                 push    edx
.text:00659644                 push    0FFBFh
.text:00659649                 call    sub_5D0B50
.text:0065964E                 add     esp, 0Ch
.text:00659651                 mov     dword_877534, eax
.text:00659656                 mov     dword ptr [ebp-0A8h], 94h
.text:00659660                 lea     eax, [ebp-0A8h]
.text:00659666                 push    eax             ; lpVersionInformation
.text:00659667                 call    ds:GetVersionExA
.text:0065966D                 test    eax, eax
.text:0065966F                 jz      loc_659B7A
.text:00659675                 mov     ecx, [ebp-0A0h]
.text:0065967B                 push    ecx
.text:0065967C                 mov     edx, [ebp-0A4h]
.text:00659682                 push    edx
.text:00659683                 push    offset aOsMajorDMinorD ; "OS : Major %d, Minor %d, Name "
.text:00659688                 push    104h            ; Count
.text:0065968D                 push    offset aOsUnknown ; "OS  : unknown\r\n"
.text:00659692                 call    __snprintf
.text:00659697                 add     esp, 14h
.text:0065969A                 mov     eax, [ebp-0A4h]
.text:006596A0                 shl     eax, 10h
.text:006596A3                 or      eax, [ebp-0A0h]
.text:006596A9                 mov     [ebp-0ACh], eax
.text:006596AF                 cmp     dword ptr [ebp-0ACh], 4005Ah
.text:006596B9                 ja      short loc_6596FC
.text:006596BB                 cmp     dword ptr [ebp-0ACh], 4005Ah
.text:006596C5                 jz      loc_659850
.text:006596CB                 cmp     dword ptr [ebp-0ACh], 30033h
.text:006596D5                 jz      loc_6598AB
.text:006596DB                 cmp     dword ptr [ebp-0ACh], 40000h
.text:006596E5                 jz      short loc_659731
.text:006596E7                 cmp     dword ptr [ebp-0ACh], 4000Ah
.text:006596F1                 jz      loc_6597F5
.text:006596F7                 jmp     loc_6599FC
and now .... i dont know if iam on the right way ...

Are sub_47BD00 and WinMain(x,x,x,x) parameters of the GetFileVersionInfoSizeA function? - ahh thats wrong because sub_47BD00 and WinMain(x,x,x,x) are int functins and GetFileVersionInfoSizeA need LPSTR lptstrFilename LPDWORD lpdwHandle.


Where can i find the real function code of GetFileVersionInfoSizeA ?
Can i hook the GetFileVersionInfoSizeA function with a constant -"everything is fine" argument?!
What are sub_47BD00 and WinMain(x,x,x,x) doing?


Dont worry i know my speech is realy denglish !!

Thanks for any help
BorSti is offline  
Old 10/13/2012, 15:49   #2




 
bloodx's Avatar
 
elite*gold: 55
Join Date: Mar 2006
Posts: 4,582
Received Thanks: 1,539


Du kannst die Funktion direkt Hooken brauchst nicht extra was raussuchen da aus der Engine.

Thiesius hat dafür nen Source gepostet.


bloodx is offline  
Old 10/13/2012, 15:59   #3
 
BorSti's Avatar
 
elite*gold: 20
Join Date: Feb 2008
Posts: 993
Received Thanks: 173
Quote:
Originally Posted by bloodx View Post


Du kannst die Funktion direkt Hooken brauchst nicht extra was raussuchen da aus der Engine.

Thiesius hat dafür nen Source gepostet.


-.- nicht dein ernst oder .... ich trottel ... der Proxy dll fix von Thiesius
ist gefixxt aber die struktur von ihm habe ich mir angeschaut und dachte die funktionsdefinition würde in der engine stehen und nicht eine allgemein gültige funktion sein.
wenn ich die direkt hooken kann bedeutet es dass ich wie früher intercepten benutzen kann?

€Dit
Danke ! - schon mal für die schnelle Antwort

Ich glaube gerade ich packe den Stier am falschen Horn .... ich könnte doch auch einfach die "Detected" Meldung vom Hs hooken -> dann müsste doch auch alles normal gehen oder nicht ?!
BorSti is offline  
Old 10/13/2012, 21:11   #4




 
bloodx's Avatar
 
elite*gold: 55
Join Date: Mar 2006
Posts: 4,582
Received Thanks: 1,539
Hackshield wird nicht so einfach sein zu Hooken das hat doch bestimmt überall checks da stellst du dir das zu einfach wieder vor, ich würde so machen wie du es schon vor hattest einfach den return Wert der Funktionen richtig zurück geben. Bist du dir sicher dass das alles fixxed ist?

Kannst du nicht einfach eine Eigene DLL injecten und dort dann deine Sachen machen , musst ja nicht umbedingteine Proxy DLL benutzen.
bloodx is offline  
Reply


Similar Threads Similar Threads
d3d Hooking WarRock
07/11/2010 - General Coding - 12 Replies
hi liebe com, kann mir jemand vllt d3d oer no menue hack tut empfehlen geht auch aus diesen forum ich hab mich ein bisschen mit olly und ida pro auseinander gesetzt und möchte jetzt meinen ersten hack mit Visual c++ erstellen gebe thx! PS: C++ lerne ich grad
Text Hooking
07/09/2010 - General Coding - 5 Replies
Hallo Leute, ich wollte mal fragen ob jemand erfahrungen mit Texthooking hat? Ich und ein Team wollen eine Visual Novel übersetzen Das Problem: Wenn wir das mit den bisher herrausgefundenen Methoden machen müssen wir erst jedes Spiel 100% Durchspiel und das kostet einfach zu viel Zeit Mit OllyDbg hab ich es auch versucht nur leider ohne erfolg :/ Kann uns evtl. jemand helfen?
ollydbg hooking dll's
05/10/2010 - Cabal Private Server - 3 Replies
any1 expierenced for this? i need help :)
C++ D3D Hooking
08/24/2009 - C/C++ - 12 Replies
Hallo zusammen, ich stehe gerade vor folgendem Problem: ich habe eine DLL und einen Loader gecoded, jedoch will ich anstelle des Loader einen Injecter haben, sprich: das spiel, in das injected werden soll, soll schon laufen. Natürlich hab ich das ganze schon probiert, jedoch werden die D3D-funktionen nicht wirklich gehookt, da die DLL auf ein Direct3DCreate9 wartet. Da diese Funktion aber wahrscheinlich direkt beim Starten des "Opfer-Spiels" ausgeführt wird, werden deswegen die anderen...



All times are GMT +1. The time now is 15:52.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.