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 


[POINTERS] [SOLVED] Having trouble with the next step
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Fri Aug 26, 2016 10:48 pm    Post subject: [POINTERS] [SOLVED] Having trouble with the next step Reply with quote

Hello Hitler that was kind enough at least to enter and read this, I'm going to keep it rather simple, but also it's going to be a kind of long post to fully explain my problem.
So, first of all, I'm playing Mount & Blade, and in the game you have a "leveling" system, with lots of different characters using the very same leveling up screen.

(As I can't post URLS, please refer to the first attachment)

So, I scanned for the value of for example "skill points", narrowed to one, searched what writes to them and I found the pointers for those, it's very easy and I have them indeed, but! I found out that the very same pointer for each character varies only on an... well, those things called EAX, EDX, etc. (what are those?)

As you can see here:
(As I can't post URLS, please refer to the second attachment)
So, my question is...
It's there a way for making cheat engine automatically change the "EAX" value every time I access a character skill sheet?
So, that way, I don't have to search for the values of each character and also wait them to level up in order to do so.

Thanks in advance, please try to be nice with the explanation, I'm not a genius in CE and it's functions.



a674036fd27345f389215b3a1ccb4925.jpg
 Description:
First Attachment (character screen)
 Filesize:  788.91 KB
 Viewed:  13984 Time(s)

a674036fd27345f389215b3a1ccb4925.jpg



658790fc18a5445eb4e8416ace7fbda6.png
 Description:
Second Attachment (Same EDX & Offset, different EAX)
 Filesize:  1.04 MB
 Viewed:  13984 Time(s)

658790fc18a5445eb4e8416ace7fbda6.png



_________________
Acknowledgeable enough.


Last edited by frenchiveruti on Sat Aug 27, 2016 5:38 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 8:43 am    Post subject: Reply with quote

frenchiveruti wrote:
what are [EAX, EDX, etc.]?
Registers. They store a small amount of data that the processor can access very quickly.
frenchiveruti wrote:
It's there a way for making cheat engine automatically change the "EAX" value every time I access a character skill sheet?
Code injection. http://forum.cheatengine.org/viewtopic.php?t=570083
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 10:25 am    Post subject: Reply with quote

ParkourPenguin wrote:
frenchiveruti wrote:
what are [EAX, EDX, etc.]?
Registers. They store a small amount of data that the processor can access very quickly.
frenchiveruti wrote:
It's there a way for making cheat engine automatically change the "EAX" value every time I access a character skill sheet?
Code injection. FREAKING URLs


Hi Parkour Penguin! Thanks for the reply.

After a few (hours!) tries around the sub, I stumbled across this code injection tutorials, the problem that I have is that all the tutorials work around a very simple template, where the "find out ..." debugger just have to display only a few results, but mount and blade seems to create a LOT of changes in the registers and I can't find the one that moves the memory to this EAX that it's supposed to be the only offset that I'm missing for the auto-assembly.
What do you think I should be looking for? I can upload any images that you request me, if you can help me. Very Happy

Have a nice day!

_________________
Acknowledgeable enough.
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 10:37 am    Post subject: Reply with quote

frenchiveruti wrote:
I can't find the one that moves the memory to this EAX

Backtrace the instruction dec [edx+eax+2BC], but if you don't know how to read assembly, that would be hard. That instruction also accesses multiple addresses, which complicates things further.

After rereading your first post, it's clear you either don't fully understand what a pointer is and/or don't understand what you want to do. If you want to find a pointer to an address, use the pointer scanner: it's the easiest method for beginners.
http://forum.cheatengine.org/viewtopic.php?t=572465

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 11:06 am    Post subject: I do know pointers! Reply with quote

ParkourPenguin wrote:
frenchiveruti wrote:
I can't find the one that moves the memory to this EAX

Backtrace the instruction dec [edx+eax+2BC], but if you don't know how to read assembly, that would be hard. That instruction also accesses multiple addresses, which complicates things further.

After rereading your first post, it's clear you either don't fully understand what a pointer is and/or don't understand what you want to do. If you want to find a pointer to an address, use the pointer scanner: it's the easiest method for beginners.


Hey! Sorry If I left it unclear, I do know what a pointer is, I have an small knowledge of programming and I found the ones that I need, and from yesterday to today I'm now able to find the multi-level pointers! What a ride to get them to work. I know that a pointer it's an address stored in the memory, that given an offset, "points" to different addresses that would take up a lot of memory if they where full 4/8 byte addresses.

My only issue is that I'm not very fond assembly (I do get that mov A,B it's move the register from B to A and add it's an operand as dec and mul or imul), or at least lurking around the list of codes that get generated isn't very easy
.
M&B on launch, registers the same EDX and offset for each character, and only varies with the EAX. I know that what I want to do is to make Cheat engine to automatically set the EAX of character when I access the skill sheet, so that way I just simply have to edit the value of the address or froze it, what I do not know is the level of complexity that my intentions require, if it's to complicated I might leave it for some day in the future when I learn more about assembly.

Again, thanks for the help Very Happy

_________________
Acknowledgeable enough.
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 11:26 am    Post subject: Reply with quote

So, with regards to the skill points of the same character, its eax offset can change when the game is restarted?

Most of the stuff I'm seeing (the addressing mode, the imul instruction, changing displacement from edx, etc.) makes me believe that character is stored in some array-like data type of structures. There's probably some value somewhere in memory that specifies the offset into that array of the character you're currently viewing, but that would be complicated to work with.

I'm pretty sure there should be many other references to that structure stored somewhere else in memory. You can find some of these manually by searching for edx+eax instead of just edx like CE suggests (with regards to the instruction dec [edx+eax+2BC]); however, again, I would recommend using the pointer scanner since it is much faster and easier for beginners to use (and you don't have to know any assembly). If you do use the pointer scanner and it's taking too long, try setting the last offset to 2BC.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 11:57 am    Post subject: I've made stuff Reply with quote

Hi Again, so yes, I started reading the instructions that play around the game and I'll try to show what I've done so far BY THE WAY, NEITHER EAX EDX or 2BC change between game restarts, solid pointers.
First, I found the "green address" for the game, called so far

  • "mb_warband.exe+4B8298" (So, the game itself with an offset (I think It's an offset what's called?)).
  • To reach a "character skill points", this Pointer needs a first offset that's the same for all the characters and it's 140f0.
  • Then the second offset (that's driving me nuts) comes from the operation under EDX+EAX+2BC, the good news is that EDX and 2BC it's The same for every character in game and the game just varies the EAX for each individual one under a different HEX. So, for Sir Rayne (the guy in the first picture) it's EAX It's 1AF068 And for Bulloks (another character, lets call it B) it's 1B2F88. So, in the case of Sir Rayne, this Second Offset it's just the sum of EAX (variable) and 2BC (constant), and that gives me the address for the skill points for him.


Now, I have this (please refer to 1st attachment)
As you can see, there's a shitton of stuff happening, and I was lurking around each one of the stuff that happends when I click on the "show me your skills" button, and this is the one that I found that has the same EAX that the character:
Code:
EAX=001B2F88
EBX=095B7990
ECX=3E2A95F8
EDX=FFFFFFFF
ESI=00000001
EDI=00000000
EBP=095B7990
ESP=0314F5EC
EIP=005CC715

Probable base pointer =004B8298

005CC703 - mov [ebx+00001320],eax
005CC709 - imul eax,eax,00000FC8
005CC70F - mov ecx,[mb_warband.exe+4B8298]
005CC715 - add eax,[ecx+000140F0]
005CC71B - mov esi,eax

Now, In the disassembler I have this (please refer to second attachment)
As you can see. I don't understand a shit of what's going on there.
So that's where I'm stuck I know that it moves things and multiplies thing, but I'm stuck there, But it's my EAX!
(Do you need any more pictures?)
And as always, thanks for the help!



First Attachment.png
 Description:
First Attachment
 Filesize:  157.99 KB
 Viewed:  13914 Time(s)

First Attachment.png



Second Attachment.png
 Description:
Second attachment.
 Filesize:  135.91 KB
 Viewed:  13914 Time(s)

Second Attachment.png



_________________
Acknowledgeable enough.
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 12:19 pm    Post subject: This post has 1 review(s) Reply with quote

Quote:
"mb_warband.exe+4B8298" (So, the game itself with an offset (I think It's an offset what's called?)).

mb_warband.exe is the name of a module. 4B8298 is an offset (aka displacement) from the start of that module.

Looking at that section of assembly, it appears as if the call to mb_warband.exe+DF170 gets the offset of a character structure into the array from its arguments. The imul instruction computes the effective offset (i.e. FC8 is probably the size of the structure). The value at the address [mb_warband.exe+4B8298]+140F0 is the start of the array. Everything else is just everything else since I don't know when that section of asm is run or what it's doing.

Regardless, as I previously stated, there is probably a value stored in memory somewhere that is indicative of which offset into that array is currently being viewed in the character's skill sheet. Working with that directly would be hard for a beginner. There are probably other references to that address that you can use. The pointer scanner can find those references easier than you can. Use the pointer scanner.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 12:27 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Use the pointer scanner.

I'm not sure If I made this part clear somewhere before, I do have the pointers, and they're static between games, so If I restart the game I still have the values for each character, my only issue is the EAX that varies between characters, not between game restarts.
Here you can see that they work, even when I restart the game.



---------------------------------------
EDIT (can't double post)
Fun Fact, I've re run the debugger just trying to almost blindly do stuff, I've found (without searching, just reading the output of the debugger), another EAX, and for my surprise, It was from another character in my team Exclamation , and it uses the same code area that I showed you (The one that starts from call to mb_warband.exe+DF170 ).
Now, I only need to know how to make CE to read this EAX and automatically change the offset of the pointer so I can modify the value without me having to search for anything

_________________
Acknowledgeable enough.


Last edited by frenchiveruti on Sat Aug 27, 2016 12:44 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 12:44 pm    Post subject: Reply with quote

Who cares if EAX varies between characters? It has to do that; it's how the game chooses to handle those structures.

From this question in your first post:
frenchiveruti wrote:
It's there a way for making cheat engine automatically change the "EAX" value every time I access a character skill sheet?
I figured you are trying to find a pointer to the address of the skill points of the character you were viewing in the skill sheet. If so, then you need to understand that there can be (and almost always is) more than one pointer to an address. In this case, there is probably a pointer that points directly to what you want such that you don't need to go through the roundabout way of finding the right index into the array of characters. You're making this much more complicated than it needs to be, but if you really want to find that index of the character currently being viewed, then just search for it like any other unknown value.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 12:50 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Who cares if EAX varies between characters? It has to do that; it's how the game chooses to handle those structures.

From this question in your first post:
frenchiveruti wrote:
It's there a way for making cheat engine automatically change the "EAX" value every time I access a character skill sheet?
I figured you are trying to find a pointer to the address of the skill points of the character you were viewing in the skill sheet. If so, then you need to understand that there can be (and almost always is) more than one pointer to an address. In this case, there is probably a pointer that points directly to what you want such that you don't need to go through the roundabout way of finding the right index into the array of characters. You're making this much more complicated than it needs to be, but if you really want to find that index of the character currently being viewed, then just search for it like any other unknown value.

Omg you are right and I'm SO SORRY, what I meant with the "change the EAX", it's that if I make a pointer like the ones that I have, I can then add to it a "variable offset" (The changing EAX from character to character) that uses the auto assembly system that CE has to display for me a different value according to what I'm viewing (AKA switching between character skill sheet), and that way I don't have to search it everytime (there are characters that I can't "search" their values as they never level up, but uses the same character sheet).
Maybe the edit on my previous post adds some insight into the issue?
I don't know how to express myself "technically correct".

_________________
Acknowledgeable enough.
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 1:42 pm    Post subject: Reply with quote

Find an instruction that accesses the address of any character's skill points when you view it in the character skill sheet menu. Right click on that instruction and select "Find out what addresses this instruction accesses". Go to whatever character you want and do whatever you need to do to make that section of asm run. The address of that character's skill points should pop up in the window without you needing to search for it.

Just make sure you choose an instruction that accesses all the address in the same manner and that you can make run whenever desired. The first instruction you posted (dec [edx+eax+2BC]) I'd assume is only run when you change the skill points, which may not be possible for every character as you said.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 2:01 pm    Post subject: Holly bolly mackanolly. Reply with quote

ParkourPenguin wrote:
Find an instruction that accesses the address of any character's skill points when you view it in the character skill sheet menu. Right click on that instruction and select "Find out what addresses this instruction accesses". Go to whatever character you want and do whatever you need to do to make that section of asm run. The address of that character's skill points should pop up in the window without you needing to search for it.

Just make sure you choose an instruction that accesses all the address in the same manner and that you can make run whenever desired. The first instruction you posted (dec [edx+eax+2BC]) I'd assume is only run when you change the skill points, which may not be possible for every character as you said.

I was trying that right now haha, No luck so far but I'll see if I can find what the heck modifies the EAX from character to character.
Thanks, I'll update if I can make it work.

UPDATE 1:
Ok, so yeah, I found that the method of "Find out what addresses this instruction accesses" it's far faster to look up for Skill Points, but yet, I can't use it the way I want to because the game won't display the "+" buttons that I need if the character that I'm viewing has 0 skill points.

Question:
Is there a way to "monitor" what values does EAX take when I do certain actions? like OPENING the character sheet surely triggers the opcode that sets the EAX to where's supposed to be, but I can't find a way to "check" that, that way I can then drive myself into the realm of code injection.
OK, The answer to that is YES, using the tracing from the memory viewer.
Lets see what's next....


UPDATE 2:
Ok, I found it, now I don't know what to do, here's the idea:

_________________
Acknowledgeable enough.
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Sat Aug 27, 2016 3:23 pm    Post subject: Reply with quote

Look at the "injection copies" section of this topic. It explains how to get EAX, store it in a registered symbol, and use that registered symbol in your table; however, you won't be able to use it in the offset field directly.

CE, in its current state, does not parse the offset in a pointer as anything except a literal hexadecimal value. You can use the fact that CE will look up symbols and dereference pointers in the address field. For example, if you store it in the registered symbol "character", the address would be "[[mb_warband.exe+4B8298]+140F0]+character+2BC".

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
frenchiveruti
Cheater
Reputation: 0

Joined: 07 Jun 2009
Posts: 35

PostPosted: Sat Aug 27, 2016 4:09 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Look at the "injection copies" section of this topic. It explains how to get EAX, store it in a registered symbol, and use that registered symbol in your table; however, you won't be able to use it in the offset field directly.

CE, in its current state, does not parse the offset in a pointer as anything except a literal hexadecimal value. You can use the fact that CE will look up symbols and dereference pointers in the address field. For example, if you store it in the registered symbol "character", the address would be "[[mb_warband.exe+4B8298]+140F0]+character+2BC".


OK OK OK OK, HOLD ON EVERYTHING.
THE THING IS FUCKING WORKING.
But I have a problem, the "2BC" isn't actually an "offset" itself, it's like the game adds "EAX+2BC" as an offset, how do I do that on my address list/new address?

_________________
Acknowledgeable enough.
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 -> General Discussions All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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