Squalr / Squally

2D Platformer Educational Game for Teaching Game Hacking - C++/cocos2d-x
https://store.steampowered.com/app/770200/Squally/
Mozilla Public License 2.0
461 stars 58 forks source link

'pop' crashes the game #162

Closed stuxxn closed 1 year ago

stuxxn commented 1 year ago

System info:

Steam version with "steam play compatibility" turned on --> "Proton experimental"

➜  .steam uname -a
Linux TurtleHouse 5.15.0-78-generic #85-Ubuntu SMP Fri Jul 7 15:25:09 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
➜  .steam cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

I used 'pop' for two different scripts and the game crashed.

The first one was a single byte script, which was something like

dec esi

and should be changed to

inc esi

but using

pop esi

crashed the game.

Another example script looked like:

mov dword ptr[esi], -0.5f

which I replaced with

pop esi
mov dword ptr[esi], -0.5f

This also resulted in a crash.

Is this an intended behavior ? Tbh writing garbage in your game hacks also result in a crash :-).

If you need the exact script names let me know.

zcanann commented 1 year ago

Intended behavior, you should always try to balance push/pop commands, as these effect the stack.

For every pop, there should be a push before it somewhere.

And the x86 isn't emulated in this game by design, so assembly bugs can easily crash yeah