dev: add debug utils folder

This commit is contained in:
javalsai 2025-07-01 01:26:35 +02:00
parent 6c6769b2b3
commit 59acddf652
Signed by: javalsai
SSH Key Fingerprint: SHA256:3G83yKhBUWVABVX/vPWH88xnK4+ptMtHkZGCRXD4Mk8
2 changed files with 62 additions and 0 deletions

3
debug/README.md Normal file
View File

@ -0,0 +1,3 @@
# Debug
This folder contains debug utils like gdb scripts. They are not guaranteed to work but can ease some tasks when debugging.

59
debug/debug.gdb Normal file
View File

@ -0,0 +1,59 @@
# this just meant to run in another term, is probably better to attach to another already running window
set inferior-tty /dev/pts/7
set pagination off
break *(read_press + 62)
define fake_read
set *((char*) $rsi) = $al
set $rax = 1
jump *(read_press + 67)
end
break *(read_press + 108)
define fake_magic_cont
set $eax = 1
jump *(read_press + 113)
end
define fake_magic_end
set $eax = 0
jump *(read_press + 113)
end
run
set $al = 0x1b
fake_read
fake_magic_cont
set $al = '['
fake_read
fake_magic_cont
set $al = 'D'
fake_read
fake_magic_end
set $al = 'p'
fake_read
fake_magic_end
set $al = 'a'
fake_read
fake_magic_end
set $al = 's'
fake_read
fake_magic_end
set $al = 's'
fake_read
fake_magic_end
set $al = 'w'
fake_read
fake_magic_end
set $al = 'd'
fake_read
fake_magic_end
set $al = '\n'
fake_read
fake_magic_end