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 


[TUT]Finding Mouse Coordinates for ANY Game

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
です
Newbie cheater
Reputation: 0

Joined: 09 Feb 2008
Posts: 20

PostPosted: Tue Feb 26, 2008 10:25 pm    Post subject: [TUT]Finding Mouse Coordinates for ANY Game Reply with quote

This tutorial will be updated and revised until it flows smoothly and is easy to understand.

Some games don't record the mouse coordinates, and they use other methods of dealing with the mouse positioning. This tutorial will overcome that through an obscure way that is not detected by any current anti-hacking engines, and works for every game.

What you will need:
-Any CE
-Auto Assembly knowledge (when actually scripting hacks for mouse based stuff)
-Xfire

Why Xfire you ask? This is the key to finding coordinates (as unlikely as it sounds). Xfire is a game management system that lets you chat and keep records of gaming. But why does it allow you to find coordinates? Xfire injects a dll into every application you run. The dll is codenamed xfire_toucan_xxxxx.dll, where xxxxx is the revision number. When injected, the dll allows for an in-game chat hook and notifier.

Info on the current version of that dll:

Base address will change, but coordinate addresses seem to be static. You should end up with an address with the base dll plus an offset leading to the coordinate, i.e. xfire_toucan_29828.dll+xxxxx. Where xxxxx is the offset.

So, with that in mind, let's get started.

Finding the Mouse Coordinates (1)
I'll assume that you already have a CE, next you need to get Xfire from http://xfire.com/
Make an account, download the client, and log in. Any program that you then execute from the time Xfire is loaded will be injected with the before mentioned dll. Next step is to get mouse coordinates. Either use this long step or the much much easier one mentioned under the heading Finding the Mouse Coordinates (2). It will vary from game to game, so use this AoB (not guaranteed to find the first time, or even at all):
Code:
76 4B 8A 13 ?? ?? ?? ?? ?? ?? 00 00 ?? ??


Now, I am sure that this may not work for everyone, since there are probably settings there too with the 8 bytes that come before the coordinates. So, either modify your search to make those 8 bytes into ?? (hard way) or try this AoB instead:
Code:
53 00 59 00 53 00 54 00 45 00 4D 00 00 00 00 00 06 00 00 00 07


And if that still doesn't work, just do the part that says "S Y S T E M ":
Code:
53 00 59 00 53 00 54 00 45 00 4D 00


If you've done the former search and got a result, skip this paragraph. If you had to do the 2nd or 3rd searches, read this. The offset from the beginning of both the 2nd and 3rd searches to the actual coordinates is 78 (in hex). So simply add that to the address that "S Y S T E M " starts at.

So now you should have the coordinates addresses at this point. If you did the 1st scan, your point of interest is the last 6 bytes (?? ?? 00 00 ?? ??), if you did 2nd or 3rd and added 78 then you should have the same result. Notice that if you move the mouse around on the attached process, those bytes update:
Code:
| Y |       | X |
?? ?? 00 00 ?? ??


And those are your coordinates, 2 bytes a piece (but I think that they're meant to be 4 bytes since theres 2 bytes of padding between Y and X). Now remember that these are the absolute coordinates, meaning that they are not relative to the game window, but instead to the whole screen. Yes, you can use them as they are but if you're going to put them into an auto-assemble script you'll need some more addresses.

Finding the Mouse Coordinates (2)
Skip this step if you used the above method.

Search AoB in memory viewer:
Code:
A3 CC 1E D2 00 8B 41 04 A3 C8 1E D2 00


Now in the assembly view, go to the address that the search brought. You should see the address of the mouse's X on the one that you went to. Skip the next instruction and you should see another mov. That one is the mouse's Y.

Finding the Window X/Y
You need to find the window X/Y. To do this, make sure the game is running in windowed mode, then search for unknown initial value 4 bytes. Move the window left 1 pixel (this can easily be done with any high-precision mouse and/or a careful hand), then scan for decreased by 1. You usually only have to do this about 2-4 times to get a coordinate. Next, do the same thing, but with the Y and moving the window up 1 pixel.
**NOTE: If you can't find the window coordinates for any reason, you're screwed.

But we're not done. Next, find the resolution that the game is running at. If you're experienced with games you should be able to tell just by looking. If not, here's a list of used resolutions by most modern games running windowed mode:
640x480
800x600
1024x768
1152x864 (rare)
1280x720 (rare)
1280x768 (rare)
1280x800 (rare)
1280x960 (rare)
1280x1024 (very rare for windowed games)

Now, take the addresses that you just found (window X/Y), and add what you think the resolution is, and scan for it. For example, if I had a game running at 800x600 and the window X/Y is 415/295, I would add the window's resolution and scan for 1215/895 (X/Y respectively). So now we should have the window's left side and top side (window X and Y), and the right and bottom side (window X + width and window Y + height).

Conclusion
With these addresses, we can make our mouse hacks of any sort. Make sure you pointer scan on multiple levels to ensure that you don't lose these addresses. Pointers should also help keep Xfire mouse coordinates, but not sure on this.

To actually make our values usable, you have to do some math (recall, our mouse coordinates are absolute). Basically, to get the coordinates based on the window, you'll have to subtract the window's X from the mouse's X and the window's Y from the mouse's Y. This is quite hackish at the moment, and I'm sure that there's better ways of finding the coordinates relative to the game window. Then again, the mouse X and Y only updates if the mouse is on top of the window, so it's probably not that big of a deal. Just implement correct error checking in your scripts.

Also, you'll probably make your hacks update when mouse coordinates update. Make sure you don't fudge anything up in Xfire or you'll have to restart the game. Here's the AoB for the mouse coordinate update code:
Code:
A3 CC 1E D2 00 8B 41 04 A3 C8 1E D2 00


Hopefully this was helpful, have fun with mouse-based hacks.



Extra
Attached CT is for a free sidescroller by a Japanese author. Used as an example of what you should have after completing tutorial, also recommend you play this game some time. Only works with v1.0.0.6, get the game and a Japanese to English patch if you want to try it.



CaveStory_mouse_CT.CT
 Description:
Doukutsu Monogatari (aka Cave Story) CT with Xfire mouse X/Y; window X1, X2, Y1, Y2. Example of what you SHOULD have at the end of tutorial.

Download
 Filename:  CaveStory_mouse_CT.CT
 Filesize:  3.64 KB
 Downloaded:  2342 Time(s)



Last edited by です on Thu Feb 28, 2008 8:37 am; edited 1 time in total
Back to top
View user's profile Send private message
onvoloper
Master Cheater
Reputation: 0

Joined: 05 Jul 2006
Posts: 294

PostPosted: Sun Mar 02, 2008 5:36 pm    Post subject: Reply with quote

Could you try it this way? Say for Maple it has the little hand that pints at things and pokes em lol. Could you say get it in windowed mode and then drag the mouse so the hand stays at the corner then scan unknown or something then chagne the corner the hand is on and so on? Or put it on the sides and places and keep going? You could do this with a ggless Maple and CE (if you wanted it for maple) or w/e...Just a suggestion/question lol so would it work?
Back to top
View user's profile Send private message
です
Newbie cheater
Reputation: 0

Joined: 09 Feb 2008
Posts: 20

PostPosted: Mon Mar 03, 2008 5:18 pm    Post subject: Reply with quote

onvoloper wrote:
Could you try it this way? Say for Maple it has the little hand that pints at things and pokes em lol. Could you say get it in windowed mode and then drag the mouse so the hand stays at the corner then scan unknown or something then chagne the corner the hand is on and so on? Or put it on the sides and places and keep going? You could do this with a ggless Maple and CE (if you wanted it for maple) or w/e...Just a suggestion/question lol so would it work?


It might work for the coordinates of the mouse in Maple, since it probably has to record the mouse X/Y to keep track of where the user clicks. But the thing that this method has over that, is that it can be used for any game. Also, when searching for mouse coordinates in Cave Story (test subject), it didn't record the mouse at all. I was just messing around and happened to find this, and it worked nicely.
Back to top
View user's profile Send private message
onvoloper
Master Cheater
Reputation: 0

Joined: 05 Jul 2006
Posts: 294

PostPosted: Mon Mar 03, 2008 7:26 pm    Post subject: Reply with quote

Makes sense lol. I know what I said would be a simple, too easy way for it to work well, but for some games it could prehaps get the same effect. Razz Good Job on your tut Smile
Back to top
View user's profile Send private message
jontyc
How do I cheat?
Reputation: 0

Joined: 09 Jan 2010
Posts: 1

PostPosted: Sat Jan 09, 2010 7:52 pm    Post subject: Reply with quote

Thanks for the tut, came in handy.

For the xfire dll current at the date of my post, (xfire_toucan_40700.dll), the offset from 'SYSTEM' is 0x84 if anyone's stuck finding it.
Back to top
View user's profile Send private message
nejisucks
How do I cheat?
Reputation: 0

Joined: 06 Feb 2010
Posts: 6

PostPosted: Sat Feb 06, 2010 11:53 am    Post subject: Reply with quote

Or you can use ElDorado's MouseFind,just google it Very Happy
_________________
Very Happy
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Feb 07, 2010 11:03 am    Post subject: Reply with quote

you can always just use GetCursorPos() and scan for the .x/.y members
Back to top
View user's profile Send private message
flowWolf
How do I cheat?
Reputation: 0

Joined: 27 Mar 2010
Posts: 1

PostPosted: Sat Mar 27, 2010 6:17 pm    Post subject: Reply with quote

nejisucks wrote:
Or you can use ElDorado's MouseFind,just google it Very Happy

This doesn't work for in game software mouse. It only report the windows cursor position, not the game's client cursor which is used to update the camera position when clicking and holding down.
Back to top
View user's profile Send private message
masterml5
How do I cheat?
Reputation: 0

Joined: 01 Jul 2009
Posts: 6

PostPosted: Mon Jun 07, 2010 2:19 pm    Post subject: Can't do find window thing... Reply with quote

Quote:
You need to find the window X/Y. To do this, make sure the game is running in windowed mode, then search for unknown initial value 4 bytes. Move the window left 1 pixel (this can easily be done with any high-precision mouse and/or a careful hand), then scan for decreased by 1. You usually only have to do this about 2-4 times to get a coordinate. Next, do the same thing, but with the Y and moving the window up 1 pixel.
**NOTE: If you can't find the window coordinates for any reason, you're screwed.

uh why do i get up alot of adresses that does decrease 1... i tryed with minesweeper and roblox Razz
Back to top
View user's profile Send private message
Dataflashsabot
Newbie cheater
Reputation: 0

Joined: 18 Mar 2010
Posts: 16

PostPosted: Wed Jun 16, 2010 8:46 am    Post subject: Reply with quote

Interesting.
Back to top
View user's profile Send private message Send e-mail
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Wed Jun 16, 2010 2:43 pm    Post subject: Reply with quote

this info can be used to make an aimbot
_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Mozilla Firefox
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Feb 2007
Posts: 1250

PostPosted: Mon Jun 21, 2010 3:11 am    Post subject: Reply with quote

itapa wrote:
this info can be used to make an aimbot


Not really. And if so, maybe a really crappy one (i.e., a pixel aimbot). Having a much better and efficient aimbot involves a lot of reversing of classes and math (player position, y/p/r, trig (you can obv use other concepts but I suppose this isn't bad to use), etc).
Back to top
View user's profile Send private message
educofu
Expert Cheater
Reputation: 3

Joined: 21 Aug 2009
Posts: 171
Location: Brazil,MG,OP

PostPosted: Sat Oct 16, 2010 5:58 pm    Post subject: Reply with quote

easy way: hotkeys and in/decreased value.
_________________
"I finally started thinking outside of the box, only to find myself in a larger box."
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials 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