ASM: reassemble() help

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
User avatar
nihilism
Cheater
Cheater
Posts: 33
Joined: Thu Mar 29, 2018 1:28 am
Reputation: 14

ASM: reassemble() help

Post by nihilism »

tldr: want to copy the opcode (not bytes) at address A to address B

I want to modify a method that calls 'AddToParams' to instead call 'SubFromParams'. I was able to identify where the calls are being made and manually changed the opcodes to swap the calls. That tested successfully, but call address is dynamic and changes when game is reloaded, so hardcoding would not work. As it is a call, readmem() cannot be used either as the bytes are different relative to where the call is made.

Below is current version. Enables/disables okay, but does not seem to read/write correctly.

Screenshot of write log when code is enabled and disabled provided below. Behind it you can see the 'AddToParams' call highlighted in the back. The write log shows a different address (instead of BuyTech+63) being changed when code is enabled and the correct address (BuyTech+63) getting the same value on disable (technically this is correct as the original code for BuyTech+63 is the same as 'SubFromParams')

Image

What do?

Code: Select all

[ENABLE]

define(AddToParams,CraftComponent:ProcessFinishedCraft+1193) //a call to add tech points
define(SubFromParams,BuffsLogics:RemoveBuff+97)              //a call to sub tech points
define(BuyTech,GameSave:BuyTech+63)                          //a call to sub tech points | injection point

//reassemble AddToParams at BuyTech address
BuyTech:
reassemble(AddtoParams)
registersymbol(SubFromParams)
[DISABLE]

//reassemble SubFromParams at BuyTech address
BuyTech:
reassemble(SubFromParams)
unregistersymbol(*)

User avatar
nihilism
Cheater
Cheater
Posts: 33
Joined: Thu Mar 29, 2018 1:28 am
Reputation: 14

Re: ASM: reassemble() help

Post by nihilism »

Syntax issue... (spent around 2 hours fiddling :shock: )

Needed to put address before offset in quotes when defining.
Code works as intended now.

Post Reply

Who is online

Users browsing this forum: No registered users