当前位置:   article > 正文

aarch64指令集_实例讲解支持多种架构指令集编解码的 pwntools 工具

pwntools aarch64

c8f4127212c88a173d5c6a1aa6b0643f.gif

作者简介:吴章金,十年 Linux 研发经验,Linux Committer,前魅族内核团队技术总监。热门开源书《C 语言编程透视》作者。

版权声明:本文最先发表于 “泰晓科技” 微信公众号,欢迎转载,转载时请在文章的开头保留本声明。

背景简介

之前在群里发起了一个讨论:

不用 gcc 如何实现代码的编解码,类似 MIPS Linux 内核中用到的 UASM。

大家的回复总结如下:

  • GDB compile command, "Debugging with GDB: Compiling and Injecting Code": https://sourceware.org/gdb/onlinedocs/gdb/Compiling-and-Injecting-Code.html

  • MIPS uasm,arch/mips/include/asm/uasm.h

  • X86 Encoder/Decoder, "X86 Encoder Decoder: X86 Encoder Decoder User Guid…": https://intelxed.github.io/ref-manual/#LEGAL

  • luajit backend, "Hello, JIT World: The Joy of Simple JITs": http://blog.reverberate.org/2012/12/hello-jit-world-joy-of-simple-jits.html

  • ebpf, "GitHub - iovisor/bcc: BCC - Tools for BPF-based Li…": https://github.com/iovisor/bcc , "eBPF - IO Visor Project": https://www.iovisor.org/technology/ebpf

  • unicorn, "Unicorn – The ultimate CPU emulator": http://www.unicorn-engine.org/

而来自龙芯的张老师提到了一个 Python 的库,这个库是:

  • utds3lab/multiverse: https://github.com/utds3lab/multiverse

安装的过程中,发现它依赖 pwntools。

如果直接用 pip3 安装 multiverse,在新版 python3 中运行得很不友好,很多语法不兼容了。

然后看了一下,multiverse 的 asm 部分实际是用的 pwntools,而且 pwntools 支持的架构更多,所以转而直接用 pwntools 就好了:

  • pwntools, https://github.com/Gallopsled/pwntools.git

初试 pwntools

安装

这个工具的稳定版本仅支持到 python 2.7,可以参考以

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/944948
推荐阅读
相关标签
  

闽ICP备14008679号