• IDA报错decomplication failure: too big function的解决方案


    0x00 问题场景

    在使用IDA寻找函数交叉引用时,提示报错。此问题在F5反编译汇编代码使也会出现。

    报错信息如下:
    在这里插入图片描述

    0x02原因分析:

    hex-rays官方写到:

    The current function is bigger than the maximal permitted size.
    The maximal permitted size is specified by the MAX_FUNCSIZE configuration parameter.
    
    • 1
    • 2

    大义为:当前函数大小大于允许的最大值,函数大小最大值有配置文件中的MAX_FUNCSIZE 变量控制。

    MAX_FUNCSIZE 的定义如下:

    Specifies the maximal decompilable function size, in KBs. Only reachable basic blocks are taken into consideration.
    Default: 64
    
    • 1
    • 2

    大义为:反编译函数大小最大值,使用KB单位计算。只有可读的基本块被统计在内。默认值是64,即64KB。

    出现这个报错,说明反编译函数的大小已经超过了64。

    0x02 解决方案

    1. 修改配置文件:【IDA 安装目录】\cfg\hexrays.cfg
      源文件为:
    MAX_FUNCSIZE            = 64        // Functions over 64K are not decompiled
    
    • 1

    修改为

    MAX_FUNCSIZE            = 1024        // Functions over 64K are not decompiled
    
    • 1
    1. 重新启动IDA,使配置生效。

    0x03 题外话

    如果函数太大,逻辑太负载,及时调大MAX_FUNCSIZE也会出现新的错误,比如too complex function,这种情况就无能为力了。官方也解决不了。

    如果调大以后,出现卡死问题,建议把值调小一些。

    0x04 参考文献

    https://www.hex-rays.com/products/decompiler/manual/failures.shtml#29

  • 相关阅读:
    关系代词 - 使用
    C- strtok() & strtok_r()
    [数据结构与算法] 图解线性表
    关于嵌入式Linux做底层还是应用,要掌握什么技能
    Vue.js结合ASP.NET Core构建用户登录与权限验证系统
    前端小技巧: 防抖和节流的区别
    黑马程序员MyBatis学习笔记
    LeetCode 598. Range Addition II
    C++关于导出*.dll文件中的函数方法
    C++ —— 命名空间
  • 原文地址:https://blog.csdn.net/counsellor/article/details/125882904