一套用于os-x上mach-o可执行文件分析的工具

machobot的Python项目详细描述


https://travis-ci.org/rodionovd/machobot.svg?branch=masterCode Climate

用于mach-o文件分析的python工具箱。严重依赖 macholib

安装

用于

$ [sudo] pip install machobot

用于开发

$ pip install nose macholib
$ git clone https://github.com/rodionovd/machobot.git machobot
$ cd ./machobot
$ nosetests # run the test suite

用法

  • 作为命令行工具:

    $ inject_dylib ./target "@rpath/mylib.dylib"
  • 作为python模块:

    importmachobot

    Example usage:

    importmachobot.dylibasdylibdylib.insert_load_command("output.a","@executable_path/../../libk.dylib")

模块

dylib

insert_load_command(target_path,library_install_name)

在目标mach-o中插入新的LC_LOAD_DYLIBload命令 头球。

ArgumentDescription
^{tt3}$A path to the target Mach-O executable file. This file will be overwritten.
^{tt4}$An install name for the library to inject. This string is used as a part of the load command.
Return value
Returns ^{tt5}$ if everything is OK. Otherwise rises an exception.
macho_dependencies_list(target_path,header_magic=None)

生成给定mach-o文件所依赖的库的列表。

在该列表中,单个库由其“安装路径”表示:对于某些 库将是一个完整的文件路径,而对于其他库则是一个相对路径 路径(有时包含dyld模板,如@executable\u path或@rpath)。

注:我不知道为什么有些胖机器的架构会依赖于 在某些库上,而其他库没有,但是在技术上是可能的。 因此,您可能需要为特定的头指定header\u magic值。

ArgumentDescription
^{tt3}$A path to the target Mach-O executable file.
^{tt7}$Mach-O MAGIC value for a header you want to inspect. If this argument is not provided, the function returns a list of the first header’s dependencies.
Return value
An object with two properties: ^{tt8}$ and ^{tt9}$ that hold lists of weak and strong dependencies respectively.

有关用法示例,请参见machobot/tests/test_dylib.py


找到问题了吗?提交问题!:shipit:

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何实时生成简单的2D图形?   java如何使用DirectoryStream过滤隐藏文件。滤器   二进制Java BigInteger测试位64位长   java Grails替换onetoone关联中的对象   爪哇七月至SLF4J大桥   java无法解决符号“窗口”错误   java在Mysql中保存NULL而不是HTML文档的文本   java当blackberry OS显示摄像头权限警报,用户点击通话结束(红色)按钮时,如何正确退出blackberry应用程序   二维地图平铺java上的块碰撞问题   java jpa mysql表不存在自动生成不工作   java在按下按钮或失去焦点时切换JDialog可见性   如何将java中的复杂映射序列化为JSON   JavaHadoop2。2.0追加文件发生AlreadyBeingCreatedException   字符串Java printDailyCost方法   feed如何修复java中新闻api的“太多请求”错误   基于字符串的java Android目录层次结构   如果键存在且值不为null,则java放入映射,否则抛出异常   java如何获取cglib代理类实例的字节码?   算法Java中按多个属性对对象进行分组的一般方法