| Cheat Engine The Official Site of Cheat Engine FAQ Search Memberlist UsergroupsRegister | Profile Log in to check your private messages Log in |
|
Automatically reveal the address written by an instruction? | Cheat Engine Forum Index -> General Gamehacking | View previous topic :: View next topic | Author | Message |
---|
Goat Engine Cheater Reputation: 0Joined: 13 Aug 2018 Posts: 44
| Posted: Tue Apr 12, 2022 6:12 am Post subject: Automatically reveal the address written by an instruction? | | | What's the easiest way to simply have an address show up in my address list that is written by one specific instruction I already know/have the location of? Pointers won't work in this particular case. Basically I am looking to have this happen in my cheat table when I click an address/script in the table's address list, or when I hit a hotkey (either way is fine): 1) Look at instruction XYZ 2) Produce the address (or addresses) it's writing to in my address list so I can manually edit their values by hand In other words, I already can do this the slow way when I go look up the instruction and then check to see what addresses it accesses, and then double clicking the ones I want so they get added to my address list. I need to finally be able to just have this be automated but I can't find a solid/easy answer on how. I read a post that said something about a two step process using ASM and LUA and seemed a bit complicated, but then I saw some other replies to that post saying it doesn't need to be done that way, etc... etc... so please someone let me know the most up to date, simple solution for this. |
| Back to top | | | Dark Byte Site Admin Reputation: 465Joined: 09 May 2003 Posts: 25491 Location: The netherlands
| Posted: Tue Apr 12, 2022 7:20 am Post subject: | | | generate a codeinjection script at the location using the template add an alloc(registeredaddress, and a registersymbol(registeredaddress) then you can use instructions like mov [registeredaddress],baseaddress and just leave the rest the same in the addresslist you can use registeredaddress as is. _________________Do not ask me about online cheats. I don't know any and wont help finding them.Like my help? Join me on Patreon so i can keep helping |
| Back to top | | | Goat Engine Cheater Reputation: 0Joined: 13 Aug 2018 Posts: 44
| Posted: Tue Apr 12, 2022 8:42 am Post subject: | | | It's working like this, but what do I add for the instructions that have multiple addresses? This seems to work perfectly for the ones that have 1 address they write to. Code: | [ENABLE] //code from here to '[DISABLE]' will be used to enable the cheat alloc(newmem,2048,"WWE2K19_x64.exe"+744F83) label(returnhere) label(originalcode) label(exit) alloc(registeredaddress,8) registersymbol(registeredaddress)newmem: //this is allocated memory, you have read,write,execute access //place your code here movss [registeredaddress],xmm6 originalcode: movss [rsi+000000E0],xmm6 exit: jmp returnhere "WWE2K19_x64.exe"+744F83: jmp newmem nop 3 returnhere: [DISABLE] //code from here till the end of the code will be used to disable the cheat dealloc(newmem) "WWE2K19_x64.exe"+744F83: movss [rsi+000000E0],xmm6 //Alt: db F3 0F 11 B6 E0 00 00 00 |
^The above is what is working for me, for one entry. And then below I found what looks like a code that MIGHT be what I need to get things working when the instruction accesses more than 1 address, but when I experimented with it, it didn't do anything. Is this what I need to use to get multiple added to my address list? If so, how exactly do I implement/edit it, etc...? Thanks Code: | [ENABLE] {$lua} local list = getAddressList() local rec = list.createMemoryRecord() rec.setAddress(address) rec.setDescription(description) {$asm} [DISABLE] |
|
| Back to top | | | ParkourPenguin I post too much Reputation: 147Joined: 06 Jul 2014 Posts: 4505
| Posted: Tue Apr 12, 2022 11:43 am Post subject: | | | You could use {$luacode} and synchronize(...) to add a memory record every time an address gets accessed, but are you sure you want to do that? Even if you check to make sure you don't add the same address more than once, invalid addresses won't get deleted. luacode: https://forum.cheatengine.org/viewtopic.php?t=618134 _________________I don't know where I'm going, but I'll figure it out when I get there. |
| Back to top | | | Goat Engine Cheater Reputation: 0Joined: 13 Aug 2018 Posts: 44
| Posted: Tue Apr 12, 2022 3:49 pm Post subject: | | | ParkourPenguin wrote: | You could use {$luacode} and synchronize(...) to add a memory record every time an address gets accessed, but are you sure you want to do that?
|
To be honest, no I'm not sure. Here's a quick explanation of what I am trying to do... In the wwe2k19 wrestling game, there are various objects around the ring such as steel steps. My goal is to always be able to load up the addresses of those steel steps coordinates, so that I can very easily just click the coordinates of the steps in my address list and hand type new coordinates that I know bring the steps into the ring without having to grab them by hand in the game. The challenge is those coordinates start the match coming from 1 address, but as soon as a person in the game starts grabbing/moving the steps by hand in the game, now the coordinates come from a NEW address but it's still from that same exact instruction. The same instruction just gives the steps a new address mid match... Yikes! So, I'd like when I start the match, for those coordinates to already load up first thing. Then during the match when somebody grabs the steps and moves them, causing the coordinates to now be switched to a new address from the same instruction, I want the new address to appear instead. Currently when I start a match I have to pause and "see what addresses" that instruction accesses, and then after somebody grabs the steps in the match I have to perform that step again to see the new address that same instruction is creating for that same coordinate. So when you ask if I'm sure how I want to do it, the honest answer is no. What's the best way to do this that would be easy to guide me through? I've been playing with some of the techniques mentioned by people throughout the following linked thread of replies, but I can't get anything to stick. I'm sure I'm just doing it wrong, but this thread is one where I've spent a lot of time trying ideas from on this issue since this guy originally had almost the same exact question: Basically if whatever his final solution was had been posted in full, I am 99.9999% sure I'd be able to convert the small differences to what I need on mine. Same ballpark idea tho. Last edited by Goat Engine on Tue Apr 12, 2022 4:21 pm; edited 1 time in total |
| Back to top | | | ParkourPenguin I post too much Reputation: 147Joined: 06 Jul 2014 Posts: 4505
| Posted: Tue Apr 12, 2022 4:20 pm Post subject: | | | If it's only ever one object outside the stadium, then just do what DB said. If there are several but you're only interested in one, see step 9 of the CE tutorial. Otherwise, you'll need to analyze the data structure of the objects that instruction is accessing and figure out a way to tell if one item is the same or different as another. Maybe keep the same memory records around- one for each item- and assign addresses to those. (no {$luacode} required, just more registered symbols) You'll also need to prune old objects somehow- maybe on level exit assume everything is invalid. _________________I don't know where I'm going, but I'll figure it out when I get there. |
| Back to top | | | Goat Engine Cheater Reputation: 0Joined: 13 Aug 2018 Posts: 44
| Posted: Tue Apr 12, 2022 4:35 pm Post subject: | | | ParkourPenguin wrote: | If it's only ever one object outside the stadium, then just do what DB said. If there are several but you're only interested in one, see step 9 of the CE tutorial. Otherwise, you'll need to analyze the data structure of the objects that instruction is accessing and figure out a way to tell if one item is the same or different as another. Maybe keep the same memory records around- one for each item- and assign addresses to those. (no {$luacode} required, just more registered symbols) You'll also need to prune old objects somehow- maybe on level exit assume everything is invalid. |
There are some cases where DB's version works perfectly but then there are some where I need to deal with multiples, such as with the base of the steel steps specifically, which there are 2 of in each match. The steel steps will always start with coordinates 304.3999939, and then when the top half of the steps get moved by a player, the base of the steps (which is what I want) will STILL be at 304.3999939. What about some kind of strategy like this, which would mean I shouldn't really need to prune anything...? 1) I push a hotkey at the start of the match that runs the script one time and grabs the 2 addresses that have the 304.3999939 float coordinates at that time, from that instruction.2) Later in the match when the top half of the steps are grabbed and the base of the steps gets a new address, I push the hotkey again to run the script and once again it only puts the 2 addresses that currently apply to the steps coordinates I referenced above. (quick note: The steel steps "base" I want the address for is the larger heavier part of the steps that normally DO NOT move at all no matter what and are stuck to the floor. That's how I know they will still be at the same coordinates when the address gets reshuffled, and those are the items I want to move by coding once a player has already physically moved the upper half of the steps by hand) Since this means I'd only be running it twice and not receiving a ton of addresses, I shouldn't really need to worry about pruning or endless loops, I'm guessing? I'm really frustrated on this one because I feel like this is probably something that should be insanely simple and basic, but it's alien to me. I've had luck in the past with AOB scans, injections, pointers, and have been able to come up with a lot of awesome cheats but somehow THIS is just not clicking and I've spent well over 24 hours on this one issue alone. lol Sorry if I seem lost on this. I really appreciate any way you guys might be able to help me get this one working. |
| Back to top | | | ParkourPenguin I post too much Reputation: 147Joined: 06 Jul 2014 Posts: 4505
| Posted: Tue Apr 12, 2022 5:49 pm Post subject: | | | Goat Engine wrote: | 1) I push a hotkey at the start of the match that runs the script one time... | It doesn't work like that. The auto assembler changes the game's code. The game is still in charge of executing that code when it wants to.
Goat Engine wrote: | ...and grabs the 2 addresses that have the 304.3999939 float coordinates at that time, from that instruction. | You have absolutely no control over what addresses that instruction accesses. It might access the two components of the stairs, or it might access some other object. Your step 2 has the same problems as step 1.This is absolutely not simple. Try step 9 of the CE tutorial. There are plenty of guides out there, and it's probably the closest tutorial you'll get for what you're trying to do here. _________________I don't know where I'm going, but I'll figure it out when I get there. |
| Back to top | | | Goat Engine Cheater Reputation: 0Joined: 13 Aug 2018 Posts: 44
| Posted: Tue Apr 12, 2022 6:07 pm Post subject: | | | ParkourPenguin wrote: | Goat Engine wrote: | 1) I push a hotkey at the start of the match that runs the script one time... | It doesn't work like that. The auto assembler changes the game's code. The game is still in charge of executing that code when it wants to.
Goat Engine wrote: | ...and grabs the 2 addresses that have the 304.3999939 float coordinates at that time, from that instruction. | You have absolutely no control over what addresses that instruction accesses. It might access the two components of the stairs, or it might access some other object. Your step 2 has the same problems as step 1.This is absolutely not simple. Try step 9 of the CE tutorial. There are plenty of guides out there, and it's probably the closest tutorial you'll get for what you're trying to do here. |
I thought I'd be able to run a cmp and that's how the script would know to only add the addresses with the 304.3999939 float, but that won't work? Or am I misunderstanding? I have to assume it's me, and either I'm explaining what I want incorrectly, or I'm just not understanding. Regarding a CE tutorial step 9 do you mean the one you play through in CE itself? Or do you mean something on this site? The built in tut in CE was helpful to me in the past and I thought I went through the entire thing but I'll take another look if that's where you mean? Let me know. If anyone else happens to stumble in here and see this... Does anybody here have some kind of script/solution that does basically what I'm talking about? And can paste it here so I can see if I can just modify it to my game? Would be a HUGE help to just see something that works and then I'd be a lot less lost. The current summary of what I'm looking to do is: Take 2 addresses from an instruction that accesses about 15 addresses and add those 2 into my address list so I can manually click their values and edit them by hand. The 2 addresses in question ALWAYS start with the same matching value, so I was thinking I'd use the expected value to be what weeds out the rest of the addresses? |
| Back to top | | | TsTg Master Cheater Reputation: 5Joined: 12 Dec 2012 Posts: 339 Location: Somewhere....
| Posted: Tue Apr 12, 2022 7:15 pm Post subject: | | | shared code, you must find a way to filter out the two addresses, need to look at registers or call stack or parameters, you could filter by the 304.3999939 value (but need something better in my opinion),filtering can be easy on some games, or a complex process on others. using DB's method, or by a non-lua script, you just inject at that address, put in some instructions that graps the currently addresses for you (after filtering ofc), store them into two empty variables, then assign these into your table manually as a pointer (and you will do this only once). as for switching between addresses, and as mentioned previously, you cant control this Last edited by TsTg on Tue Apr 12, 2022 7:46 pm; edited 2 times in total |
| Back to top | | | ParkourPenguin I post too much Reputation: 147Joined: 06 Jul 2014 Posts: 4505
| Posted: Tue Apr 12, 2022 7:41 pm Post subject: | | | Goat Engine wrote: | I thought I'd be able to run a cmp and that's how the script would know to only add the addresses with the 304.3999939 float | Yes, this is correct. This is what step 9 of the tutorial goes over.The tutorial can be accessed from the "Help" menu in CE. You already gave an example of what to do in this post: https://forum.cheatengine.org/viewtopic.php?p=5778268#5778268 You should be moving the address and not the value (i.e. instead of `movss [registeredaddress],xmm6`, do `mov [registeredaddress],rsi`). Add a memory record to the address list, single level pointer, base address "registeredaddress", only offset of E0. After that fix, add a second registered symbol and use cmp statements to figure out which address to store where. _________________I don't know where I'm going, but I'll figure it out when I get there. |
| Back to top | | | Goat Engine Cheater Reputation: 0Joined: 13 Aug 2018 Posts: 44
| Posted: Wed Apr 13, 2022 2:55 pm Post subject: | | | I got it working for the steel steps!! A hearty thank you to everyone who replied with help! I ended up having it cmp for X coordinates of the items instead of Y coordinates, which allowed me to look at identical starting values except one was negative and one was positive. I set a hotkey to this as well, so I only flip it on momentarily to get the desired addresses and flip it back off until I need it again (later in the match once the steel steps get new addresses) and it works! Here's the code if anyone is curious to do something similar. Also, if any of the pros have any suggestions that might make this code more polished and refined, feel free to let me know! I'm sure it's messy but it does the trick. Code: | [ENABLE] alloc(newmem,2048,"WWE2K19_x64.exe"+744F9B) label(returnhere) label(exit) alloc(registeredaddress,8) registersymbol(registeredaddress) alloc(registeredaddress2,8) registersymbol(registeredaddress2)newmem: movss [rsi+000000E8],xmm7 cmp [rsi+000000E8],(float)304.3999939 jne @f mov [registeredaddress],rsi jmp exit @@: cmp [rsi+000000E8],(float)-304.3999939 jne exit mov [registeredaddress2],rsi exit: jmp returnhere "WWE2K19_x64.exe"+744F9B: jmp newmem nop 3 returnhere: [DISABLE] //code from here till the end of the code will be used to disable the cheat dealloc(newmem) "WWE2K19_x64.exe"+744F9B: movss [rsi+000000E8],xmm7 //Alt: db F3 0F 11 BE E8 00 00 00 |
|
| Back to top | | | |
| Cheat Engine Forum Index -> General Gamehacking | All times are GMT - 6 Hours | Page 1 of 1 | | 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
| |