5 个解决方案
#1
print *((int*)0xabcdef)
#2
哦哦,字符串内容,不知道。
#3
没有人知道么 ???????
#4
这种东西要自己查下手册, gdb里面敲 help
(gdb) help printf
printf "printf format string", arg1, arg2, arg3, ..., argn
This is useful for formatted output in user-defined commands.
我猜是 printf "%s" 0xabcdef
x 命令应该也可以的,
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
Defaults for format and size letters are those previously used.
Default count is 1. Default address is following last thing printed
with this command or "print".
(gdb) help printf
printf "printf format string", arg1, arg2, arg3, ..., argn
This is useful for formatted output in user-defined commands.
我猜是 printf "%s" 0xabcdef
x 命令应该也可以的,
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
Defaults for format and size letters are those previously used.
Default count is 1. Default address is following last thing printed
with this command or "print".
#5
楼主,这就是答案了……你还找什么?
#1
print *((int*)0xabcdef)
#2
哦哦,字符串内容,不知道。
#3
没有人知道么 ???????
#4
这种东西要自己查下手册, gdb里面敲 help
(gdb) help printf
printf "printf format string", arg1, arg2, arg3, ..., argn
This is useful for formatted output in user-defined commands.
我猜是 printf "%s" 0xabcdef
x 命令应该也可以的,
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
Defaults for format and size letters are those previously used.
Default count is 1. Default address is following last thing printed
with this command or "print".
(gdb) help printf
printf "printf format string", arg1, arg2, arg3, ..., argn
This is useful for formatted output in user-defined commands.
我猜是 printf "%s" 0xabcdef
x 命令应该也可以的,
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
Defaults for format and size letters are those previously used.
Default count is 1. Default address is following last thing printed
with this command or "print".
#5
楼主,这就是答案了……你还找什么?