Need Advice for Making Cheats in CE

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
Sol
Expert Cheater
Expert Cheater
Posts: 66
Joined: Fri May 19, 2017 5:42 pm
Reputation: 8

Need Advice for Making Cheats in CE

Post by Sol »

Howdy,

I'm a long-time user of CE, but I'll honestly admit I'm still a neophyte when it comes to using it, so I'm trying to save myself a little time by asking for advice here in which method I ought to be using to most easily create a time-saving cheat option for a game I'm playing.

Some pertinent info about the situation:
I'm playing a game against AI enemies, using the Cheat Engine to look up a resource for spawning in my units (it's a 4-byte and pretty easy to find) and modifying it so I can spawn more units faster than I would normally be able to. This takes about 10-20 seconds at the start of the match for me to do, and when it's done the matches tend to end very shortly after that, like within a couple of minutes.

Problem is that every time a new match begins, the values of the resource are moved elsewhere...so having to find their new location for each new match is getting tiresome since it's happening so frequently.

My question is simply this:
Which function should I be looking to use for it to find the "source" of the resource value automatically between matches so I don't have to keep looking it up myself every round?
I know there are pointers and AOB scanners and LUA scripts and whatnot, I'm just wondering which one I need to be looking into doing to get this less time and labor intensive on my side of things in the long run.

Probably a boring question for the adepts and experts here, but I'll only need to learn this lesson once, so at least I don't have to ask again.

Thanks in advance, to whoever decides to help. ^_^

Sol
Expert Cheater
Expert Cheater
Posts: 66
Joined: Fri May 19, 2017 5:42 pm
Reputation: 8

Re: Need Advice for Making Cheats in CE

Post by Sol »

Minor update- after doing a little searching around, I saw links to Rydian's tutorials for AOB scanners and Pointers, and they're very nice (I remember looking at them a few years back as well), except the images in them are all broken now, so it makes it a little hard to see what exactly one is supposed to be doing in each step of the process.

It looks like what I need to use is the AOB for my particular case, probably. Hopefully I can find a tutorial on them that will pertain close enough to my situation.

I'll update this again if I run into a wall someplace and need more help, but I think I'm on the right track for now.

User avatar
VampTY
Table Makers
Table Makers
Posts: 480
Joined: Tue Mar 05, 2019 10:52 am
Reputation: 463

Re: Need Advice for Making Cheats in CE

Post by VampTY »

Since you never mentioned any name of what game you are trying to do that cheat table for (or i'm blind), here's below some weird demo, badly converted by me using a different codec..anyway, is with one of the game i'm playing now, you can always mute it ;) .



So, you'll need to pretend that what you see is the value for you in 4 bytes and perhaps your value is not separated!I There's ways and ways and more ways than previous ways to do this!

In my example for 1, using (int) for integers you can add like 545644874 for the wanted value, instead in example 2 you need to calculate the value..or you can use also # 99999 or you can modify directly "mov [ecx+14],ebx" into " mov [ecx+14],#999999" or add pointers or alloc new mem etc .Ok, perhaps this will help, now some name could help big time when you want to request something in the future!

All the best, take care!

Sol
Expert Cheater
Expert Cheater
Posts: 66
Joined: Fri May 19, 2017 5:42 pm
Reputation: 8

Re: Need Advice for Making Cheats in CE

Post by Sol »

I've been having a hard time trying to wrap my head around AOB injection, but I managed to get some pointers working for what I wanted to accomplish. Thanks for the help and the tutorial, I might have to revisit this page if I ever take another stab at AOB stuff.

Sol
Expert Cheater
Expert Cheater
Posts: 66
Joined: Fri May 19, 2017 5:42 pm
Reputation: 8

Re: Need Advice for Making Cheats in CE

Post by Sol »

Scratch that, I can find the pointers for the 3 values, but 1 of them keeps changing itself ever so often. Triggers for it changing to a different pointer are: closing and relaunching the game, playing a certain number of matches, beating a chapter of the campaign and launching the next chapter, and changing you character.

This is slightly confounding for me because I thought this stuff was the exact situation that pointers were supposed to work around.

The other 2 pointers have worked just fine and remain stable through all that stuff, but that 3rd one might be the determining factor on this Mana value, and it's giving me hell.

I've tried going about it more like the tutorial vids and making new pointermaps and pointerscans between launches of the game, and extending the range of the offsets to 9999 and the max level to 11 and let it run for a couple of hours and after that it only found 13 addresses, and only 3 of those had pointers to values (which matched the Mana of course), but all 3 of them were invalidated between a chapter change.

Am I doing something wrong, or do I just need to give up on Pointers for this thing and double down on learning AOB scans/injection?

User avatar
GreenHouse
GreenHouse!
GreenHouse!
Posts: 667
Joined: Fri Oct 12, 2018 10:25 pm
Reputation: 528

Re: Need Advice for Making Cheats in CE

Post by GreenHouse »

Sol wrote:
Wed Jun 23, 2021 12:52 am
...
This will be quite a long and shitty explanation. First part is how to do AOBs, and the next part is the explanation of what is it doing.

You shouldn't use those. Use what VampTY told you. I'll guess that it's a 64bit game. Get the address that you want, right click and check what accesses it. Go to that instruction in the Memory View, right click the function and check what accesses it, make sure that it only has the one that you want. If so, then being in that instruction, press Ctrl+A and then click 'Template' -> Cheat Table Framework and then 'Template' -> AOB Scan, Ok, Ok. Now in the 'code' part of the script created you'll have the instruction that is accessing what you want.
Under the labels code and return, add -> 'alloc(value,8)' and 'registersymbol(value)'. Then if the instruction that accesses it is something like: mov rcx,[rax], then go to the newmem part, and under it add 'mov [value],rax'. If the instruction is something like 'mov rcx,[rax+40], you can do the same. Click 'File' and 'Assign to current cheat table'. Close that window, and enable the script. Now you can go to the address list, 'Add Address Manually', tick Pointer, and at the bottom box, type 'value'. Change the type to whatever your value is. And now, if your instruction had something like [rax+40], on the box with the '0', change it to a 40.

As a general idea of what you did. When you find the instruction that accesses what you want, that template does search for the AOB of it, which should be unique. And when it finds it, it allocates some memory near it, and registers that instruction, which is like giving it a name so you can get to it easily. Then you make that instruction jump to the allocated memory, which will have the instruction and whatever you add to it in the script. So, it'll jump to the allocated memory, run the code that you have, and then jump back, so it keeps running the normal function. The the alloc/registersymbol with the name 'value' that you do, does the same. You allocate some memory, then give it a name for easy access, then the mov [value],rax, rax being the address of your value, moves that address to [value], ([ ] means it's a pointer. So the value of 'value' will be an address, but the important part is inside it, being your address). Imagine that you have a box, that box is 'value', and the inside of that box is '[value]'..

So now that you have your address in the address list. You ticked the pointer box, and gave it the 'value' address. So it will get the address that is inside 'value'. Also with that, if there's multiple currencies, they might be close to each other. So you can change the box with the '0', and increase it to the next currency. Currency 1 might be +0, Currency 2 might be +8, etc.

Honestly there's too much stuff to explain, so Imma just stop here. The more I type, the more things I think of that you should know. If you need anything, ask. Make a list, and ask multiple things, to not waste time.

Sol
Expert Cheater
Expert Cheater
Posts: 66
Joined: Fri May 19, 2017 5:42 pm
Reputation: 8

Re: Need Advice for Making Cheats in CE

Post by Sol »

Good news, got the AOB working now, and all is well.
Thanks for the helpful links, tutorials, and suggestions everybody (especially Vamp)!

With enough practice and experience using these new tools in my arsenal, perhaps soon enough I'll be teaching people how to do this stuff as well. ^_^

Post Reply

Who is online

Users browsing this forum: No registered users