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 


Memory based MMO bot

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

Joined: 25 May 2014
Posts: 59

PostPosted: Fri Dec 18, 2015 3:17 pm    Post subject: Memory based MMO bot Reply with quote

It's been around a year now since I got into this and I still haven't made any progress towards this kind of cheats(wtb more free time), so I'd appreciate it if someone gave me directions.

My problem isn't programming but reading a game's memory, I can get addresses for simple things like health/level/location of my own character and I already made some simple bots(and hacks) that use these simple values but I aim for making real bots that can play without me semi-playing the game.
I need to somehow get a list of nearby objects in game (monsters/loots/anything), a list of my character's items in inventory and manipulate these items e.g drop them/sell them/equip/whatever but for that I believe I'd need the item's location on my screen to right click it and use it. And that's the problem, I don't know how to do that.
I have tried many times to get any of these three using cheat engine but I always ended up with no results.

So my question is how can I get such information from the game for my bots? I don't mind if the solution isn't related to reading game's memory.
I'd appreciate it if someone could explain or link me to a tutorial/guide/useful source of knowledge in this direction which I could use to make proper bots.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Dec 18, 2015 7:30 pm    Post subject: Reply with quote

It differs per game based on how they are coded. Some games will use a simple array of objects, others will use containers such as std::list or std::map etc. Or some will home-brew their own methods of holding data.

So there is no clear cut way to do it for every game out there.

The best thing to start with is finding an enemy in memory. One of the basics to start with is their health. Target them (and continue to target them the entire duration of your scans) and scan for their health. Hit them once to lower it some, scan again etc. until you find it.

Now this is something you need to do before continuing further. Untarget the enemy and see if the address is still valid. Target something else and again make sure its still valid. If it changes or isn't you probably didn't find an address that is going to be helpful.

If you do find one, then the next step is to debug it and find what writes to it and accesses it. In some cases you can find a lookup table call that is indexing an array of objects in some fashion which will lead you to a base pointer / first object in the array.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Astaroth4256
Advanced Cheater
Reputation: 0

Joined: 25 May 2014
Posts: 59

PostPosted: Wed Jun 15, 2016 9:39 am    Post subject: Reply with quote

I found several opcodes with a little count and two with a few thoushand count so I guess one of the latter is what I'm looking for. But I have no idea what to do next, I don't know how to use this finding to get a list of whatever is near my character in game. Oh well
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Wed Jun 15, 2016 11:29 am    Post subject: Reply with quote

The last bot i coded was for FFXIV before Reborn (or w/e it is called).
I started by finding my Coords (X,Y) and then finding what changed it. It only worked for Player Characters, but not mobs. So then I found a mob's coords (locked onto mob, /follow, and search within a 2 unit radius until i narrowed it's coords down). Mob coords all shared the same instruction. Then I looked around my instruction, I knew it accessed every mob's coordinates, but I needed to find the structure/list it used to do so.

Turns out it was pretty simple, a few traces showed that the game loaded a base address, and then some offset, simple deconstruction across a few mobs showed that the offsets were spaced every 0x90

Hope this helps
Back to top
View user's profile Send private message
Astaroth4256
Advanced Cheater
Reputation: 0

Joined: 25 May 2014
Posts: 59

PostPosted: Sat Jul 02, 2016 6:08 am    Post subject: Reply with quote

So I have found X coord of an object. Then I looked up what was around this address and I found health/name/energy/level etc. of the object around it's X coord address. But I don't know how what to do next in order to find the list of these objects in game, could you explain how you used the instruction to do that?
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sat Jul 02, 2016 8:20 am    Post subject: Reply with quote

Break and trace the instruction, write down the registers and stack, for ease of understanding look up npc name using your current knowledge, compare these addresses across 10 npcs, look for the patterns. Is there a base address always loaded, is there an index or ofset loaded, is there a different base addres for PCs, NPCs, Mobs?

You just need to gather as much data as possible and look for patterns.
You can also look at the structure dissector to see if patterns are there too.
Back to top
View user's profile Send private message
Astaroth4256
Advanced Cheater
Reputation: 0

Joined: 25 May 2014
Posts: 59

PostPosted: Sat Jul 02, 2016 10:40 am    Post subject: Reply with quote

So I decided to "find out what accesses to this address" on the base of the object's structure (1A7C9420 and 1A7C9420+488 is the object's X coord) and it shows a list of like 40-50 instructions. I have to ask, if I look through each of these instructions then can I find what points to the object's structure (or simply can I find the object list) using this way? I ask because it looks like it would take me a few hours to analyze all these instructions and I'm quite short on free time.

I have collected this by finding out what accesses to the X coord adresses
Code:

player (not me)
1
004EA85A - DD 85 A0020000  - fld qword ptr [ebp+000002A0]
004EA860 - D8CA - fmul st(0),st(2)
004EA862 - DC 85 48020000  - fadd qword ptr [ebp+00000248] <<
004EA868 - DD 1B  - fstp qword ptr [ebx]
004EA86A - DD 85 E0000000  - fld qword ptr [ebp+000000E0]

EAX=00000000
EBX=1A7C96B0
ECX=1A7C96A8
EDX=00000000
ESI=00000000
EDI=18BB3E40
ESP=0018E5C0
EBP=1A7C9420
EIP=004EA868



2

004BF81B - DD 9E 40020000  - fstp qword ptr [esi+00000240]
004BF821 - DD 86 90020000  - fld qword ptr [esi+00000290]
004BF827 - DD 9E 48020000  - fstp qword ptr [esi+00000248] <<
004BF82D - DD 86 60020000  - fld qword ptr [esi+00000260]
004BF833 - DD 9E 50020000  - fstp qword ptr [esi+00000250]

EAX=0096D03C
EBX=00000000
ECX=1A7C9420
EDX=FFFFFFFA
ESI=1A7C9420
EDI=00A3835C
ESP=0018E310
EBP=0018E330
EIP=004BF82D



mob
1
004EA85A - DD 85 A0020000  - fld qword ptr [ebp+000002A0]
004EA860 - D8CA - fmul st(0),st(2)
004EA862 - DC 85 48020000  - fadd qword ptr [ebp+00000248] <<
004EA868 - DD 1B  - fstp qword ptr [ebx]
004EA86A - DD 85 E0000000  - fld qword ptr [ebp+000000E0]

EAX=00000000
EBX=1A7C85A0
ECX=1A7C8598
EDX=00000000
ESI=00000000
EDI=18BB3E40
ESP=0018E5C0
EBP=1A7C8310
EIP=004EA868


2
004BF81B - DD 9E 40020000  - fstp qword ptr [esi+00000240]
004BF821 - DD 86 90020000  - fld qword ptr [esi+00000290]
004BF827 - DD 9E 48020000  - fstp qword ptr [esi+00000248] <<
004BF82D - DD 86 60020000  - fld qword ptr [esi+00000260]
004BF833 - DD 9E 50020000  - fstp qword ptr [esi+00000250]

EAX=0096D03C
EBX=00000000
ECX=1A7C8310
EDX=FFFFFFFF
ESI=1A7C8310
EDI=00A3835C
ESP=0018E310
EBP=0018E330
EIP=004BF82D



I couldn't find anything useful in this except that ESI in esi+00000248 is the base of mob's and player's structure.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sat Jul 02, 2016 4:56 pm    Post subject: Reply with quote

Every game is unique, there are many methods for reaching the solution you want to reach, and I have given you two different approaches that worked for me. You are fairly lucky that the coords are located in an easily identifiable structure. Why dont you look for the pointer to the structure of multiple mobs/npcs/pcs? Since you know that it is ESI, find something in memory that accesses the ESIs of all the mobs and you may be able to find every single one of them without any more effort.
Back to top
View user's profile Send private message
Astaroth4256
Advanced Cheater
Reputation: 0

Joined: 25 May 2014
Posts: 59

PostPosted: Sun Jul 03, 2016 12:43 pm    Post subject: Reply with quote

I found a list of pointers to base addresses of structures of objects in the area in game, but I can't find any pointer to this structure. I tried scanning for addresses of the list and it returned me nothing.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sun Jul 03, 2016 12:47 pm    Post subject: Reply with quote

Pick any of the pointers you found and see what accesses them. That instruction may access all of them. If not, it will at least tell you where the base of the structure holding all the pointers you found is. Use that base to see what accesses and that instruction will always give you your base.
Back to top
View user's profile Send private message
Astaroth4256
Advanced Cheater
Reputation: 0

Joined: 25 May 2014
Posts: 59

PostPosted: Sun Jul 03, 2016 1:54 pm    Post subject: Reply with quote

Awesome, the base of this structure was 198 away from the first pointer in the list. I scanned for pointers to the base and it returned a base address, then I used it in a different game client and it pointed to the base of the structure I was looking for. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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