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 


[C++] best method for PMX

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

Joined: 17 Dec 2006
Posts: 786

PostPosted: Fri Nov 21, 2008 12:25 pm    Post subject: [C++] best method for PMX Reply with quote

Instead of doing the method everyone else is using, couldn't I just use the detours library?

Seems easier to me.

_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
Odecey
Master Cheater
Reputation: 1

Joined: 19 Apr 2007
Posts: 259
Location: Scandinavia

PostPosted: Fri Nov 21, 2008 12:51 pm    Post subject: Reply with quote

How is that easier than 6-7 lines of code? Am I missing something here?
_________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren
Back to top
View user's profile Send private message MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri Nov 21, 2008 1:21 pm    Post subject: Reply with quote

Detours is for hooking the function yourself. But the case with PostMessage is that GG hooked it, and you need to jump around the hook. I don't think you can use Detours for that.
And also: then you would have to include detours.dll with your bot/hack.
Back to top
View user's profile Send private message
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Fri Nov 21, 2008 1:25 pm    Post subject: Reply with quote

Hm.. I'll just use the normal way. Also, as for getpixel, isn't it the EXACT same as postmessageA? like this

Code:
ULONG GetPixel = GetProcAddress( LoadLibrary("gdi32.dll"), "GetPixel" ) + 5;

   __declspec(naked) COLORREF WINAPI GetPixelX(HDC hdc, int nXPos, int nYPos)
   {
      __asm
      {
         mov edi,edi
         push ebp
         mov ebp,esp
         jmp [GetPixel]
      }
   }

_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Fri Nov 21, 2008 1:33 pm    Post subject: Reply with quote

Yup, if the hook is installed the same way, hopping the hook will be done the same way.

Also, is it just more or does the girl in your sig have a cock in her mouth?

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Fri Nov 21, 2008 2:30 pm    Post subject: Reply with quote

its ICE CREAM
_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
BirdsEye
Advanced Cheater
Reputation: 0

Joined: 05 Apr 2008
Posts: 94

PostPosted: Fri Nov 21, 2008 3:18 pm    Post subject: Reply with quote

Or you could use InjectMessage()
http://forum.cheatengine.org/viewtopic.php?p=2501062&highlight=&sid=d90af884d93aeffb95b7b3db3196cfe6
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri Nov 21, 2008 3:29 pm    Post subject: Reply with quote

I thought GetPixel doesn't have mov edi, edi; push ebp; mov ebp, esp;
So see what it starts with and change your code.
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Fri Nov 21, 2008 3:36 pm    Post subject: Reply with quote

Syscall NtGdiGetPixel.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Nov 21, 2008 3:52 pm    Post subject: Reply with quote

nog_lorp wrote:
Syscall NtGdiGetPixel.


You're able to call it in r3, correct?
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Fri Nov 21, 2008 3:57 pm    Post subject: Reply with quote

You need to use a syscall or sysenter (you cannot just 'call NtGdiGetPixel()'), but yes (the whole point of syscalls is they are how you drop through to r0 from r3)
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
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