首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >radare2中的ASM模式搜索

radare2中的ASM模式搜索
EN

Stack Overflow用户
提问于 2020-09-04 09:58:45
回答 1查看 1.3K关注 0票数 4

我想在radare2中搜索该类型的ASM模式。

pop, mov, mov

这是三个连续的指令:第一个以pop开头,第二个以mov开头,第三个也是。

Radare2 (https://github.com/radareorg/radare2/issues/13322)有一个相关的问题,它说“在/c中实现了它的高效性”,但是现在需要/c来搜索密码材料。

我在Linux上使用radare2 4.5.0。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-25 16:54:56

这可以用/ad实现(用4.5.0和5.0.1版本进行测试):

代码语言:javascript
复制
r2 /bin/ls
> "/ad pop;mov;mov"
0x00009b40   # 7: pop rbp; mov rsi, r13; mov rdi, r12
0x00009bb8   # 7: pop rbp; mov rsi, r13; mov rdi, r12
0x00009c38   # 7: pop rbp; mov rsi, r13; mov rdi, r12
0x00009d40   # 7: pop rbp; mov rsi, r13; mov rdi, r12
0x0000a120   # 19: pop r12; mov byte [rip + 0x1832c], 0; mov dword [rip + 0x1817e], 0
0x0000a120   # 18: pop rsp; mov byte [rip + 0x1832c], 0; mov dword [rip + 0x1817e], 0
0x000120f1   # 9: pop rcx; mov rcx, qword [rbx]; mov edx, 2

注意:命令周围的引号(")是必要的,因为radare2还使用分号来链接命令。

供参考(radare2 5.0.1):

代码语言:javascript
复制
> /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
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63738918

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档