korcankaraokcu / PINCE

Reverse engineering tool for linux games
Other
2.13k stars 149 forks source link

GTAV Freezes with PINCE Debugger. #194

Closed Vaxaop closed 1 year ago

Vaxaop commented 1 year ago

When attempting to run Grand Theft Auto V (GTAV) on Ubuntu 22.04 with the PINCE debugger attached, an unexpected freezing issue occurs. The game abruptly stops running without any apparent reason. It is important to note that the SIGINT signal has been disabled using either the handle SIGINT pass or handle SIGINT nostop command within the PINCE debugger. However, even after executing the continue command within the PINCE debugger, the game remains frozen. Interestingly, when using GDB (GNU Debugger) alone without PINCE, the game does not experience any freezing issues.

Here are the logs : -->/Ctrl+C ~"\nThread " ~"2 \"GTA5.exe\" received signal SIGINT, Interrupt.\n" ~"[Switching to LWP 27446]\n" =cmd-param-changed,param="logging file",value="/tmp/peda-gjjwri75" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-ijyaml7r" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-jz87itdg" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-u1wfjdjl" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-bhr8pbr0" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-glads104" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-7hain1_o" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-l4ompyp1" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-1d2ih0or" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-86id_hmf" =cmd-param-changed,param="logging enabled",value="off" =cmd-param-changed,param="logging file",value="/tmp/peda-5fm7xl3m" =cmd-param-changed,param="logging enabled",value="off" ~"0x00007f4af831ea3d in ?? ()\n" stopped,reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt",frame={addr="0x00007f4af831ea3d",func="??",args=[],arch="i386:x86-64"},thread-id="2",stopped-threads="all",core="4" -->/Ctrl+C -->handle SIGINT pass nostop ^done &"Quit\n" -->continue ^running running,thread-id="all" =thread-created,id="158",group-id="i1" ~"[New LWP 28871]\n" *running,thread-id="158" ~"[LWP 28871 exited]\n" =thread-exited,id="158",group-id="i1"

brkzlr commented 1 year ago

Try ignoring these signals before attaching to GTA 5, not after.

I also see through your logging file that your system wide GDB has PEDA addon installed. PINCE is not supported through other gdb flavours, just vanilla. It might work with others, but it can break anytime. You can install a local vanilla version of gdb by using the install_gdb.sh script in the folder.

Please also post a logfile of everything that happens since starting PINCE, so we can be sure it was installed correctly.

hellidox commented 1 year ago

i could be wrong but don't some things sigusr1 (or other signal) themselves repeatedly as an anti-debug?

hellidox commented 1 year ago

might be the case with gtav

hellidox commented 1 year ago

yes, gtav has anti-debug

brkzlr commented 1 year ago

They said that using GDB does not affect the game so it's not the case of anti-debug. Plus, those anti-debug hooks are made for Windows where they check/block handle creation and other process reading API calls, such as ReadProcessMemory, stuff that aren't really applicable in Linux, might not have a 1-1 with Linux APIs or just be stubs for now.

korcankaraokcu commented 1 year ago

@brkzlr is probably right on peda, however you don't need to install gdb locally. Just disable peda while using pince. Also, pince doesn't have any anti-debug tools as for now so you are on your own with that. About getting help with games, if the game is freeware, we can try to help you within the pince discord server. So yeah, firstly, try to disable peda and see if it works

Vaxaop commented 1 year ago

Try ignoring these signals before attaching to GTA 5, not after.

I also see through your logging file that your system wide GDB has PEDA addon installed. PINCE is not supported through other gdb flavours, just vanilla. It might work with others, but it can break anytime. You can install a local vanilla version of gdb by using the install_gdb.sh script in the folder.

Please also post a logfile of everything that happens since starting PINCE, so we can be sure it was installed correctly.

Thank you for your prompt response and valuable suggestions.

I experimented with ignoring the signals both before and after attaching to GTA 5, but unfortunately, it did not have any impact on the freezing issue. However, following your advice, I took a closer look at the logging file and noticed that my system-wide GDB has the PEDA addon installed. I understand that PINCE is only supported with the vanilla version of GDB and compatibility with other flavors may not be reliable. To address this, I decided to install a local vanilla version of GDB using the provided install_gdb.sh script.

Moreover, I made the necessary adjustments by changing the path to gdb_pince/gdb-11.2/bin/gdb and enabled GDB Logging, and it solved my current problem... Thank you!

korcankaraokcu commented 1 year ago

With the new patch, PINCE will now ignore gdbinit files on startup. Thus, ignoring plugins like PEDA. You can safely use system gdb without any concerns now