Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Api Unhooking Question...

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
fjfc
Advanced Cheater
Reputation: 0

Joined: 21 Sep 2006
Posts: 91

PostPosted: Wed Apr 02, 2008 7:39 pm    Post subject: Api Unhooking Question... Reply with quote

Well... today i saw that code in delphi to unhok the PostMessageA

Quote:
function PMX(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
var DblWord:DWORD;
hHandle:THandle;
begin
hHandle:=LoadLibrary('user32.dll');
DblWord:=DWORD(GetProcAddress(hHandle,'PostMessageA'))+5;
asm
mov edi,edi
push ebp
mov esp,ebp
jmp [DblWord]
end;
end;


thx rot1


then i tried to use it with GetPixel like that:

Quote:
function GPX(
DC:HDC;
X:Integer;
Y:Integer):TColor;stdcall; export;
var DblWord:DWORD;
hHandle:THandle;
begin
hHandle:=LoadLibrary('gdi32.dll');
DblWord:=DWORD(GetProcAddress(hHandle,'GetPixel'))+5;
asm
mov edi,edi
push ebp
mov esp,ebp
jmp [DblWord]
end;
end;


then when i call the api i get an error like

Access Violation at 0042D0A8 Read Of 00000070

do you guys know the problem?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Apr 02, 2008 7:47 pm    Post subject: Reply with quote

umm... could be the "export" after stdcall; in GPX

your not Unhooking it btw. your simply jumping over the 5 byte hook that GameGuard creates.

_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Wed Apr 02, 2008 7:49 pm    Post subject: Reply with quote

Won't work, hooked in kernel-mode.

PROTIP: mov edi, edi is useless, cut it out.
Back to top
View user's profile Send private message
fjfc
Advanced Cheater
Reputation: 0

Joined: 21 Sep 2006
Posts: 91

PostPosted: Wed Apr 02, 2008 7:53 pm    Post subject: Reply with quote

Well i've put export after but i got the sabe problem...

look i put this in a dll

function GPX(
DC:HDC;
X:Integer;
Y:Integer):TColor;stdcall; export;
var DblWord:DWORD;
hHandle:THandle;
begin
hHandle:=LoadLibrary('gdi32.dll');
DblWord:=DWORD(GetProcAddress(hHandle,'GetPixel'))+5;
asm
mov edi,edi
push ebp
mov esp,ebp
jmp [DblWord]
end;
end;

exports GPX;

then i call at the exe like

================

function GPA(
DC:HDC;
X:Integer;
Y:Integer):TColor;stdcall;
external 'Teste.dll' name 'GPX';

procedure TForm1.Timer1Timer(Sender: TObject);
begin
label1.Color:=GPA(x,300,500);


==============

what is wrong guys ? =/
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25833
Location: The netherlands

PostPosted: Wed Apr 02, 2008 8:08 pm    Post subject: Reply with quote

you could also just make a raw copy of those dll's and adjust the pointers of your own app to point to make use of the copy
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
fjfc
Advanced Cheater
Reputation: 0

Joined: 21 Sep 2006
Posts: 91

PostPosted: Wed Apr 02, 2008 8:11 pm    Post subject: Reply with quote

just copy Gdi32 to another dll and point my app to use it?

lol i liked that DB xD

thanks ;D
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites