zoukankan      html  css  js  c++  java
  • /// 静态链接和动态链接 /// 查看PE和ELF的动态链接 ///python-magic 获取MIME文件类型(x-sharedlib application/x-executable)

    编译和链接

    静态链接和动态链接

    这两部分参考程序员的自我修养

    查看PE和ELF的动态链接 readelf ldd ida 

    file

    可以先使用file命令查看文件类型

    对于ELF文件

    参考 https://blog.csdn.net/mayue_web/article/details/104019036

    以hpcenter为例

    objdump

    readelf -d

     

    ida

     

    ldd

    注意需要对应架构的linuix。可以参考buildroot入门。

    其中/lib/ld-linux-armhf.so.3是解释器

     

    若无动态链接库(statically linked)

     

    对于PE文件

    dependency walker

    python-magic MIME(x-sharedlib  application/x-executable)

     使用python的magic模块可以识别文件的类型。

    # use magic to get the filetype
    def _get_filetype(data, mime=True):
        return magic.from_file(data, mime);

    而mime

    MIME (Multipurpose Internet Mail Extensions) 是描述消息内容类型的因特网标准。

    MIME 消息能包含文本、图像、音频、视频以及其他应用程序专用的数据。

    https://www.w3school.com.cn/media/media_mimeref.asp

    例如识别文件类型为

    application/pdf

    标准中并没有x-executable,

    application/x-executable  可执行文件
    "application/x-sharedlib  共享库
    应该是扩展的类型
  • 相关阅读:
    截取字符串的值
    Tomcat发布项目方法
    struts标签
    正则表达式范例
    树的操作方法
    树结点动态帮定事件
    I/O 流和对象序列化
    Word中的字体大小
    script实现的日期表示
    JavaScript弹出窗口技巧
  • 原文地址:https://www.cnblogs.com/lqerio/p/15330844.html
Copyright © 2011-2022 走看看