Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cheats with the 0xC1 and 0xC2 type instructions don't work #1524

Closed
shocoman opened this issue Feb 11, 2023 · 0 comments
Closed

Cheats with the 0xC1 and 0xC2 type instructions don't work #1524

shocoman opened this issue Feb 11, 2023 · 0 comments

Comments

@shocoman
Copy link

The 0xC1 and 0xC2 instructions don't work. Their usage just completely crashes a game.

Here is one not working cheat as an example:

C2000000 00000010
00000000 00000000
00000000 E12FFF1E

The problem lies in these two lines: one & two. The instruction adr lr, exec_function_return overwrites the LR reg, but its original value is not backed up anywhere. In the end, the cheat routine will try to return through this clobbered up register here and fail.

As a solution, it seems enough to just add the LR reg to the push and pop lists at the start and the end of the cheat engine routine. Nitrohax kinda does it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant