| View previous topic :: View next topic |
| Author |
Message |
god22 How do I cheat?
Reputation: 0
Joined: 19 Sep 2017 Posts: 6
|
Posted: Thu Aug 16, 2018 4:25 am Post subject: Changing a 16 bit register correctly |
|
|
| I got back in to playing ar tonelico recently and was messing around in cheat engine with it. I made a script that will multiply the amount of exp gained after battle but it was way to high. Upon closer inspection, I found out that it was writing to 2 16 bit registers. It would write correctly to the first part but only until it maxed out the first register. It would then overflow into the other part. in decimal form it would say something like 3300| 0->9452 | 31. I have no idea how to fix it.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Aug 16, 2018 1:12 pm Post subject: |
|
|
Show the code you are trying to use.
_________________
- Retired. |
|
| Back to top |
|
 |
god22 How do I cheat?
Reputation: 0
Joined: 19 Sep 2017 Posts: 6
|
Posted: Thu Aug 16, 2018 8:33 pm Post subject: |
|
|
newmem:
push ebx
mov ebx,[20D20B54] //MC Exp
code:
mov [ecx],edx -> copy calculated exp to memory
sub ebx,[20D20B54]
neg ebx
add [20D20B54],ebx
pop ebx
mov [pcsx2.exe+10922F8],00186A24 //?
Expected:
1. Store exp before exp gain
2. Run orginal code
3. Subtract new exp from old exp
5. add the result to the original exp (creating double xp)
Actual:
0 or 1
Tried:
shl returns a negitive I think
modding edx returns a weird value due to how the emulator calculates values
Can you jump from cheat engine to a lua script and back? That would be the best solution I think.
|
|
| Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu Aug 16, 2018 10:25 pm Post subject: |
|
|
To deal with WORDs (16 bits) you just remove the "E", it's for "Extended" and it was actually added to the 16 bit registries to denote 32 bit. So; AX (16 bits), EAX (32 bits); BX, EBX; CX, ECX; and so on.
| Code: | newmem:
push ebx
mov ebx,[20D20B54] //MC Exp //// EBX = Current XP
code:
mov [ecx],edx -> copy calculated exp to memory //// No Idea what you're doing here
sub ebx,[20D20B54] //// EBX (Current XP) - Current XP = 0
neg ebx //// basically : 0 - EBX (0) = 0
add [20D20B54],ebx //// Current XP + EBX (0) = Current XP
pop ebx
mov [pcsx2.exe+10922F8],00186A24 |
But you need to find where the XP is written when increased, so you can subtract the current value from
the increased value.
Here some wiki pages that might help after you find where is written to.
https://wiki.cheatengine.org/index.php?title=Tutorial:CodeInjection_Integers
https://wiki.cheatengine.org/index.php?title=Tutorial:CodeInjection_Floats
_________________
|
|
| Back to top |
|
 |
god22 How do I cheat?
Reputation: 0
Joined: 19 Sep 2017 Posts: 6
|
Posted: Fri Aug 17, 2018 6:26 am Post subject: |
|
|
Thank you for your help. I will try that.
To clarify:
mov [ecx],edx // This is the code that adds exp.
I don't think I can find a code better than that because it isn't a game but an emulated game. Therefore,I was trying to store the old exp before it was changed and subtract it from the new exp. I could take that value and manipulate it however I wanted, or so I thought.
|
|
| Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Fri Aug 17, 2018 6:58 am Post subject: |
|
|
Something like this should work.
| Code: | push eax
mov ax,dx
sub ax,[ecx]
sub dx,ax
imul dx,3
add dx,[ecx]
code:
mov [ecx],edx // could also be, mov [ecx],dx
pop eax |
_________________
|
|
| Back to top |
|
 |
god22 How do I cheat?
Reputation: 0
Joined: 19 Sep 2017 Posts: 6
|
Posted: Sat Aug 18, 2018 6:03 am Post subject: |
|
|
| It went to 1 again. While it didn't work, it did confirm I need to find a different code to use. Oh well. Sorry for wasting your time.
|
|
| Back to top |
|
 |
|