#reveng #tools #share 分享一些开源机器代码 REverse engineering 工具 ❤️
== https://github.com/namhyung/dwarview
ELF DWARF 调试符号信息查看器
== https://igio90.github.io/Dwarf/docs/installation.html
一个普通的(并非逆向工程用)调试器
== https://github.com/wisk/medusa
一个普通有 GUI 的 disassembler
== https://gitlab.com/p8n/panopticon
Rust 的跨机器代码指令平台反汇编工具
== https://github.com/cea-sec/miasm#user-content-assembling--disassembling
让 Radare2 可以使用 miasm Python 工具集工作
== https://github.com/pwndbg/pwndbg#readme
Pwndbg 是一个 GDB 插件,可以让 Source-level debugger GDB 一瞬变成 assembly level debugging 的好工具
== https://github.com/namhyung/dwarview
ELF DWARF 调试符号信息查看器
== https://igio90.github.io/Dwarf/docs/installation.html
一个普通的(并非逆向工程用)调试器
== https://github.com/wisk/medusa
一个普通有 GUI 的 disassembler
== https://gitlab.com/p8n/panopticon
Rust 的跨机器代码指令平台反汇编工具
== https://github.com/cea-sec/miasm#user-content-assembling--disassembling
让 Radare2 可以使用 miasm Python 工具集工作
== https://github.com/pwndbg/pwndbg#readme
Pwndbg 是一个 GDB 插件,可以让 Source-level debugger GDB 一瞬变成 assembly level debugging 的好工具
GitHub
GitHub - namhyung/dwarview: DWARF debug info viewer using GTK+
DWARF debug info viewer using GTK+. Contribute to namhyung/dwarview development by creating an account on GitHub.
duangsuse::Echo
没想到,原来 GDB 需要的这么多东西全都是有用的(哪有没有源代码 GDB 就爆炸掉这种说法呢? 🙈
This media is not supported in your browser
VIEW IN TELEGRAM
这下可得了,岂不是有了调试符号,除了等价的算法逻辑,连代码风格和标识符名称都能完全还原出来了....
所以说千万不要忘记 strip 掉调试符号,免得类似 duangsuse 这种人间之屑逆向还原出整个算法逻辑... 还是在三四天内 🤔
duangsuse::Echo
安排一下手机上测试能不能正常使用( 刚刚逆向分析实现的 liba.so!me
一般我在手机上用 QPython CTYPES 模块还是可以访问里面的函数的,目前可能因为平台有点区别,我的 GNU/Linux 上面暂时加载不了库文件
(这个是 CA v6 里的 liba)
对于别的测试,我准备反汇编,然后重新汇编一个,这样改代码也好改一些 🤔
https://docs.python.org/3.5/library/ctypes.html
(这个是 CA v6 里的 liba)
Python 3.2.2 on linux-armv7l我会写个脚本绑定一下 CFI(听说 Python 好像有特别的方法),然后测试一下函数们
import ctypes
a = ctypes.CDLL('/data/local/tmp/liba.so')
a # <CDLL ... handle ... at ...
a.BEL(10) # 17
对于别的测试,我准备反汇编,然后重新汇编一个,这样改代码也好改一些 🤔
https://docs.python.org/3.5/library/ctypes.html
Python documentation
ctypes — A foreign function library for Python
Source code: Lib/ctypes ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these ...
duangsuse::Echo
一般我在手机上用 QPython CTYPES 模块还是可以访问里面的函数的,目前可能因为平台有点区别,我的 GNU/Linux 上面暂时加载不了库文件 (这个是 CA v6 里的 liba) Python 3.2.2 on linux-armv7l import ctypes a = ctypes.CDLL('/data/local/tmp/liba.so') a # <CDLL ... handle ... at ... a.BEL(10) # 17 我会写个脚本绑定一下 CFI(听说 Python…
Python 也有专门的 FFI DSL 和自动接口生成(bindgen)
不过这里测试用,不需要太好的代码质量和这些技巧
不过这里测试用,不需要太好的代码质量和这些技巧
void be(char *dst, const char *src);已经验证的确实现了此逻辑,测试数据
"duangsuse" 输出 "ZHVhbmdzdXNl"
void bd(char *out, const char *code_str);已经验证的确实现了此逻辑,测试数据
"ZHVhbmdzdXNl" 输出 "duangsuse"
void me(char *dst, char *src);
已经验证的确实现了此逻辑,测试数据 "duangsuse" 给出输出 "bd0f06b918b82c0da771c830b8497da4"
void r(char *s); 这个就是个纯的 string reversing 函数,没有别的判断什么的... 反正这些都不是重点,重点是 JNI 导出
🤔现在有的项目怎么这么不容易编译... 要自己再去找一些不常见的包手动编译,Boost 还必须要 static 的,可这个项目都 1k+ commits 了
https://github.com/wisk/medusa
只好换别的反汇编工具....
https://github.com/wisk/medusa
只好换别的反汇编工具....
GitHub
GitHub - wisk/medusa: An open source interactive disassembler
An open source interactive disassembler. Contribute to wisk/medusa development by creating an account on GitHub.
duangsuse::Echo
🤔 有了符号们和开源库代码们的帮助,逆向工程进展很快,几乎只需要标记一下调试符号里的本地变量位置,然后偶尔 Radare2 反查一点常量、看点函数调用就可以了,现在只剩下主函数孤零零一个了。
有了 r2 的程序分析甚至 symbolic execution(迫真术语混入),标记孤立了一些栈帧本地变量和参数出来,我只需要拿鼠标一划 IDE 就会自动找到注释里面匹配的汇编指令
现在的问题是存在
现在的问题是存在
call eax 动态调用(类似 JVM 的 invokevirtual,必须在运行时确认跳转地址),不过我有 JNI structure 们的帮助,可以算函数指针偏移量来推导调用的函数成员名称(甚至我也可以在标记完调试符号信息之后再『猜』参数)
duangsuse::Echo
#reveng #tools #share 分享一些开源机器代码 REverse engineering 工具 ❤️ == https://github.com/namhyung/dwarview ELF DWARF 调试符号信息查看器 == https://igio90.github.io/Dwarf/docs/installation.html 一个普通的(并非逆向工程用)调试器 == https://github.com/wisk/medusa 一个普通有 GUI 的 disassembler…
plasma 的完成度给人感觉很差劲,得 merge 一个 PR 才能用在 ELF 上,而且,好像居然用来对付动态链接库的话 capstone 反汇编引擎会爆炸,不知道为什么
在 Radare2 的强力动态分析(暴论)和 JNI 结构体的强力 C functionptr offset 计算辅助之下,酷安的 liba.so 验证逻辑即将全盘爆炸(悲)从此官方再不能逼死同人 😢
coolapk_a_kdev_2.zip
156.3 KB
今天的逆向进度