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 


Is there a way to filter structures?

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

Joined: 17 Jan 2012
Posts: 21

PostPosted: Wed Dec 04, 2013 3:53 pm    Post subject: Is there a way to filter structures? Reply with quote

I'm trying to filter out these values for item unlocks in a game. The items are very annoying to get, so finding even one code that generated the unlock was very difficult for me to do. In other words it would be VERY annoying to re-find the addresses for each item and unlock them.

Using the address, I found the data structure. I know it follows a certain pattern like the one below and simply changing these values to 10 (max item level) will unlock it in the game for me permanently.

However this game has ALOT of items in it. is there a way to filter out the junk or a way to code them all together in one fell swoop?

Thanks



Unlock List.png
 Description:
Data structure
 Filesize:  206.15 KB
 Viewed:  8545 Time(s)

Unlock List.png


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Dec 04, 2013 4:05 pm    Post subject: Reply with quote

Use code injection.

Add one to your cheat table and right-click on it to see which instructions access the address.

When you find a proper injection point, you can write a script to alter each value, at each offset, to whatever you want.

For example:
Code:
mov [esi+118],#10
mov [esi+12C],#10
mov [esi+140],#10
mov [esi+154],#10
mov [esi+168],#10
//etc...
Back to top
View user's profile Send private message
16-Bit
Newbie cheater
Reputation: 0

Joined: 17 Jan 2012
Posts: 21

PostPosted: Thu Dec 05, 2013 4:30 am    Post subject: Reply with quote

So I followed your advice and I'm a bit stuck. I am trying to understand assembly, so a little guidance would be a huge help.

To my horror this morning, the addresses that I thought were static, turned out to be pointers and moved. I managed to find them again and found the address that controls when an item is essentially updated.

Code:
MassEffect3.exe+3A2A2 - 74 0D                 - je MassEffect3.exe+3A2B1
MassEffect3.exe+3A2A4 - 8B 17                 - mov edx,[edi]
MassEffect3.exe+3A2A6 - 89 10                 - mov [eax],edx
MassEffect3.exe+3A2A8 - 8B 57 04              - mov edx,[edi+04]
MassEffect3.exe+3A2AB - 89 50 04              - mov [eax+04],edx
MassEffect3.exe+3A2AE - 89 48 08              - mov [eax+08],ecx <<-- Updates Manifest
MassEffect3.exe+3A2B1 - 5F                    - pop edi
MassEffect3.exe+3A2B2 - 8B C3                 - mov eax,ebx
MassEffect3.exe+3A2B4 - 5B                    - pop ebx
MassEffect3.exe+3A2B5 - 8B E5                 - mov esp,ebp
MassEffect3.exe+3A2B7 - 5D                    - pop ebp


From my VERY basic understanding of assembly, it looks like it calculates the item level and stores it as ecx, and updates it to the appropriate item located at eax. eax is the base address for the item that I find through cheat engine (plus the offset) and the calculation of eax is essentially the pointer.

However I cannot find the pointer. It seems like the value eax gets reset after each time it is upgraded. Normally at this point I would use a pointer scanner, but considering there is an address for each of the 100's of items it would be VERY tiresome to find the pointer. I was lucky enough that one of my 4 debuggers caught what was accessing the address.

So I'm wandering how to progress from here. Again keep in mind that I'm still learning the ropes around AA, so please keep it simple. Thanks![/code]
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Thu Dec 05, 2013 5:11 am    Post subject: Reply with quote

Just find a pointer to THE FIRST item then make a copy of this cheat entry and add 0x14 to the topmost offset.

Now I understand that making 100s ctrl+c/ctrl+v and manual offset adjustment might be annoying. So once you have a pointer to the first 1-2 items save your table, open it with notepad and see how each cheat entry is represented. You can then use excel/open office to generate the rest of the entries.

Tip: When you know that the first item has level 0, the second 10, the third 7, etc... you can use the "grouped" datatype to quickly locate you item data array.

Given your screenshot it'll be something like:
4 bytes: (level of one item)
skip nr of bytes: 16 (it's in decimal, 16(dec)=0x12c-0x118-4)
4 bytes: (level of the next item)
skip nr of bytes: 16
...

The "add" checkboxes represent whether of not to add this line when you transfer one result onto the cheat list.

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
16-Bit
Newbie cheater
Reputation: 0

Joined: 17 Jan 2012
Posts: 21

PostPosted: Thu Dec 05, 2013 5:39 am    Post subject: Reply with quote

Gniarf wrote:
Just find a pointer to THE FIRST item then make a copy of this cheat entry and add 0x14 to the topmost offset.

Now I understand that making 100s ctrl+c/ctrl+v and manual offset adjustment might be annoying. So once you have a pointer to the first 1-2 items save your table, open it with notepad and see how each cheat entry is represented. You can then use excel/open office to generate the rest of the entries.

Tip: When you know that the first item has level 0, the second 10, the third 7, etc... you can use the "grouped" datatype to quickly locate you item data array.

Given your screenshot it'll be something like:
4 bytes: (level of one item)
skip nr of bytes: 16 (it's in decimal, 16(dec)=0x12c-0x118-4)
4 bytes: (level of the next item)
skip nr of bytes: 16
...

The "add" checkboxes represent whether of not to add this line when you transfer one result onto the cheat list.


Ahh, that is a possible solution. I like it!

To find the "first" item though, I will have to backtrack and find when the pattern stops. It will be tedious but it will work.

Thanks for the great tip!

EDIT: Any tips on how to find the pointer? The unlocks are heavily based in RNG ie you don't know what you are going to unlock.

This is partly the reason why I cannot find the pointer. That is unless I am lucky enough to pull the same item over and over again which is just not going to happen.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Thu Dec 05, 2013 10:33 am    Post subject: Reply with quote

16-Bit wrote:
To find the "first" item though, I will have to backtrack and find when the pattern stops. It will be tedious but it will work.
If it helps, the structure dissect tool understand addresses like "16c0024c-14*100". Where 100(hex) would be how many items before the one at 16c0024c you want to go to.
This and a bit of dichotomy should make the task bearable.


16-Bit wrote:
EDIT: Any tips on how to find the pointer? The unlocks are heavily based in RNG ie you don't know what you are going to unlock.
RNG?

16-Bit wrote:
This is partly the reason why I cannot find the pointer. That is unless I am lucky enough to pull the same item over and over again which is just not going to happen.
Well you see there is a 4294967295 after each item level, so once you found the address of item1_level, pointerscan for {this_address+4} so the scanner will actually find a pointer to item1's 4294967295.
Then when doing rescans, switch to "value to find mode" and enter 4294967295.
Then when you want to use a pointer, just subtract 4 to its terminal offset.

tip: the arrows in the "change address" window for a pointer subtract or add 4 to a given offset.

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
16-Bit
Newbie cheater
Reputation: 0

Joined: 17 Jan 2012
Posts: 21

PostPosted: Thu Dec 05, 2013 11:24 am    Post subject: Reply with quote

I did not know the structure dissect could do that. This will be really helpful.

As for RNG, basically you buy these "packs" from a store and they will contain 1-2 random weapons that can be unlocked. The weapons that you get are entirely random (hence why I said its based on RNG - random number generated) and therefore finding the pointer becomes very difficult as each weapon has its own address. There is no way I can manipulate the system in some way to know what I get before I buy it so trying to find the new address becomes literally guess work.

Your advice in going about finding the pointers could work. I'll give it a whirl and let you know how I go.

Update: THANK YOU!

I actually understand how Pointer Scanner works now in finding pointers. I always just knew how to use it basically, but now I get what it is actually doing.

Thanks to that I realised i didn't even need to do what you suggested in using that 4294967295 number and instead just go straight for the address that holds the weapon level. Using that feature you told me about the dissector I was able to go back and find where the first item is. From there I knew the address to do the pointer scan and from then onwards I would just have to have the pointer scanner find the level of that weapon.

Long story short, I did it! I would give rep but I am apparently not at that post count, but just know I am so grateful for your advice. Now that I know what I am doing, I feel I can do a lot more now.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Dec 05, 2013 2:01 pm    Post subject: Reply with quote

Take one of your addresses...it doesn't matter which one it is...and right-click on it to see which instructions access it. When the debugger window pops up, it might show multiple instructions but that's okay. If one of your instructions is like above:

mov [eax+08],ecx

...highlight it and click on 'add to the code list', that way, every time you open the game, even if the address is dynamic, you can find it easily by clicking on the 'advanced options' button at the bottom-left of your main interface, viewing in dissassembler, and right-clicking on the instruction to see which addresses it accesses. In the new window, you can easily find your address when it gets accessed again.

Now, stop the debugger if you haven't already done so. Highlight the instruction and click on 'show disassembler'. In the Memory Viewer window, with the instruction highlighted, select 'tools' from the drop-down menu, and click on 'auto assemble'. In the auto assemble window, select 'template' from the drop-down menu, and click on 'cheat table framework code'. Select 'template' again, this time, click on 'code injection'. Click okay. Select 'file' from the drop-down menu, and click on 'assign to current cheat table'.

Before you get started, there are some things to note. Remember the address that you originally used to bring up the debugger window? Also, remember the offset that was used in the instruction?

For example, lets say that it is the address that holds the gold value, and the offset in the debugger window was +08 (for [eax+08]). Remember that.

Now, right-click on the address again, in your cheat table, only this time, select 'browse memory region'. Now, in memory viewer, select 'tools', 'dissect data structures'. In your structure window, the address should already be filled in...now we just have to add the offset.

So, let's say our address for gold is 01B35F80.

In the text box, we will write this:

01B35F80+8

So, we are essentially adding +8 on the end of it.

Now, click on 'structure', 'define new structure' and okay/yes/okay.

You will see, at offset +08, is our gold address and the value. From here, you can see what the proper offset is for all of your other values.

Now, when you open up your script in the cheat table, you can customize it to alter all of the values at once:

Code:

mov [eax+0C],#10        //move 10 in to item1 (or whatever) slot
mov [eax+10],#10        //move 10 in to item2 slot
mov [eax+14],#10        //move 10 in to item3 slot
mov ecx,#10             //move 10 in to ecx
mov [eax+08],ecx        //move ecx in to gold to make it 10


There are some things to consider, as this may not work. First of all, you need to select a proper instruction in your debugger window. Over time, you will learn which ones will work and which ones won't, just by looking at them. You will also need to learn how to check if the instruction that you are wanting to use, also accesses other addresses (such as enemy addresses and other things that we don't want to change in the same way etc.). There are different ways to do this, but we can revisit that later. There are other things, such as what your final script will look like, and how to handle it etc....but any help that you need, just ask, and be sure to provide screenshots/pasted code etc. for reference.

By using injection, you can save time by not having to perform a pointer scan on anything (and) if the code changes due to an update, you may not have to fix anything at all, and if you do, the fix should be very minor and usually only take a second.

UPDATE: Never mind. Very Happy
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