diff --git a/debug/README.md b/debug/README.md new file mode 100644 index 0000000..55472b9 --- /dev/null +++ b/debug/README.md @@ -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. diff --git a/debug/debug.gdb b/debug/debug.gdb new file mode 100644 index 0000000..04059f3 --- /dev/null +++ b/debug/debug.gdb @@ -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