希望可以像xxd一样,分两栏,左右是16进制,右边是ascii的字符串,自定义一个命令即可,如下。
define xxd
dump binary memory dump.bin $arg0 $arg0+$arg1
shell xxd dump.bin
end
执行效果
(gdb) define xxd
Type commands for definition of "xxd".
End with a line saying just "end".
>dump binary memory dump.bin $arg0 $arg0+$arg1
>shell xxd dump.bin
>end
(gdb) xxd $rax+128*8*3 128
0000000: 2018 4289 f809 9340 1820 aef8 0994 4018 .B....@. ....@.
0000010: 20ae f809 9540 1820 aef8 0996 4018 20ae ....@. ....@. .
0000020: f809 9740 1820 aef8 0998 4018 20ae f809 ...@. ....@. ...
0000030: 9900 3320 9421 8ff8 099a 4018 218f f809 ..3 .!....@.!...
0000040: 9b20 1842 89f8 099c 4018 20e0 f809 9d40 . .B....@. ....@
0000050: 1820 e0f8 099e 4018 20e0 f809 9f40 1820 . ....@. ....@.
0000060: e0f8 09a0 4018 20e0 f809 a140 1820 e0f8 ....@. ....@. ..
0000070: 09a2 4018 2289 f809 a340 1820 f9f8 09a4 ..@."....@. ....