我有这样的东西:
(fcn) fcn.140001020 20
fcn.140001020 ();
; XREFS: CALL 0x140001080 CALL 0x140001098 CALL 0x1400010b0 CALL 0
; XREFS: CALL 0x140001794 CALL 0x1400017ad CALL
0x140001029 mov dword [0x140018a38], eax
我希望能够给地址0x140018a38起一个名字,这样它就会出现类似的内容:
0x140001029 mov dword [myGlobal], eax
答案 0 :(得分:0)
环境
解决方案
示例
user@host:~$ r2 /my/example
[0x00000000]> aaaa
...
[0x00000000]> s fcn.140001020
[0x140001020]> pd 1
(fcn) fcn.140001020 20
fcn.140001020 ();
; XREFS: CALL 0x140001080 CALL 0x140001098 CALL 0x1400010b0 CALL 0
; XREFS: CALL 0x140001794 CALL 0x1400017ad CALL
0x140001029 mov dword [0x140018a38], eax
[0x140001020]> CCa 0x140001020 0x140018a38 = myGlobal
[0x140001020]> pd 1
(fcn) fcn.140001020 20
fcn.140001020 ();
; XREFS: CALL 0x140001080 CALL 0x140001098 CALL 0x1400010b0 CALL 0
; XREFS: CALL 0x140001794 CALL 0x1400017ad CALL
0x140001029 mov dword [0x140018a38], eax ; 0x140001029 = myGlobal
[0x140001020]> Cf 2 w myGlobal @ 0x140018a38
[0x140001020]> pd 1 @ 0x140018a38
0x140018a38 format w myGlobal {
myGlobal : 0x140018a38 = 0xffff
} 2
[0x140001020]> q
user@host:~$