Radare2 - “/c 指针;偏移”命令没有对同一对类似指令的搜索实例给出预期的响应

逆向工程 雷达2 ios 核心 抵消
2021-06-14 19:02:51

我正在尝试使用radare2从iOS kext(IOSurface)中找到偏移量IOSURFACEROOTUSERCLIENT_VTAB,并且需要"/c pointer; offset"按照本要点中的说明使用该命令在执行命令时,预期的输出是特定指令发生的位置列表。

但是当我尝试运行时,前面的命令确实按预期工作。除了上面的命令给出以下输出:

[0xfffffff00688b0d4]> "/c 0xfffffff007622000; 0x898"
Usage: /c   Search for crypto materials
| /ca                 Search for AES keys expanded in memory
| /cc[algo] [digest]  Find collisions (bruteforce block length values until given checksum is found)
| /cd                 Search for ASN1/DER certificates
| /cr                 Search for ASN1/DER private keys (RSA and ECC)

当双引号被删除时,我得到了相同的响应。

请帮助我理解这里有什么问题,或者radare2的格式是否随着时间的推移发生了变化,或者我是否遗漏了什么。

我确实阅读了radare2文档,但找不到这种形式的任何格式: "/c pointer; offset"

谢谢!

1个回答

要点包含了一些旧的(创建3岁前)R2的指令,并根据,也已经过时,R2的书,它看起来像/c命令负责“寻找汇编代码给定的字符串匹配”。目前 ( radare2 5.2.0-git 26093 @ linux-x86-64 git.5.1.1) 类似的指令可能是一/a

Usage: /a[?] [arg]  Search for assembly instructions matching given properties
| /a push rbp           Assemble given instruction and search the bytes
| /a1 [number]          Find valid assembly generated by changing only the nth byte
| /aI                   Search for infinite loop instructions (jmp $$)
| /aa mov eax           Linearly find aproximated assembly (case insensitive strstr)
| /ac mov eax           Same as /aa, but case-sensitive
| /ad[/*j] push;mov     Match ins1 followed by ins2 in linear disasm
| /ad/ ins1;ins2        Search for regex instruction 'ins1' followed by regex 'ins2'
| /ad/a instr           Search for every byte instruction that matches regexp 'instr'
| /ae esil              Search for esil expressions matching substring
| /af[l] family         Search for instruction of specific family (afl=list
| /ai[j] 0x300 [0x500]  Find all the instructions using that immediate (in range)
| /al                   Same as aoml, list all opcodes
| /am opcode            Search for specific instructions of specific mnemonic
| /ao instr             Search for instruction 'instr' (in all offsets)
| /as[l] ([type])       Search for syscalls (See /at swi and /af priv)
| /at[l] ([type])       Search for instructions of given type  

它看起来特别/ad/应该工作,因为它可以找到两个指令相互跟随匹配一些正则表达式的代码部分。

基于此,我认为以下内容应该适合您:

[0x00000000]>"/ad/ 0xfffffff007622000;0x898"