Pscyking How do I cheat? Reputation: 0
Joined: 18 Jan 2022 Posts: 2
|
Posted: Tue Jan 18, 2022 11:25 am Post subject: How to perform an action when a known instruction is called? |
|
|
In the campaign of Total War: Warhammer 2, whenever you initiate diplomacy with an AI faction, an instruction is called that copies the value of the faction's current wealth into a register:
Code: | Warhammer2.EMPIRECAMPAIGN::FACTION_ECONOMICS::treasury
8B 81 20090000 mov eax,[rcx+00000920] |
Let's say I create a table entry called SelectedFactionWealth to store a pointer to the 4-Byte treasury value of the most recently viewed faction. How can I hook into the instruction so that every time it gets called, it sets my pointer to the source address (rcx+920)?
I'm new to CE, assembly and lua, so while I am working through the tutorials and docs, I've not yet come across a solution for this. Even if someone could just point me to relevant documentation, I'd be happy to work it out from there. Thanks!
|
|