找回密码
 立即注册
首页 业界区 业界 IDA-Moles 1.0.7 SDK 接口指南

IDA-Moles 1.0.7 SDK 接口指南

魄柜 昨天 23:50
IDA-Moles 静态逆向分析组件

1.webp
IDA Moles 是一款专业逆向分析接口工具,专为 IDA Pro 9.1 打造,并适配 Python 3.8 及以上版本,该工具以标准化调用逻辑为核心,能高效控制 IDA Pro 执行反汇编、反编译、内存分析等各类逆向操作,拥有高效反编译控制、高级调试、内存分析、函数解析、MCP 服务器扩展及自动化批量处理等全方位核心功能,不仅能实现伪代码获取、断点设置、内存布局分析、函数信息解析等基础逆向操作,还支持自定义 MCP 服务器接口开发以满足定制化需求,更可通过编程接口实现逆向分析流程的自动化与大量样本的批量处理,可显著提升逆向分析的效率与灵活性,满足各类复杂的逆向分析场景需求。
快速安装

1、首先用户需要通过PIP快速安装部署,打开命令提示符或终端,执行以下命令安装最新版本的IDA Moles开发工具包。
  1. CMD> pip install idamoles
  2. CMD> pip show idamoles
  3. Name: IDAMoles
  4. Version: 1.0.7
  5. Summary:
  6. IDA Moles is a reverse analysis interface for IDA Pro 9.1.
  7. It controls decompilation, debugging, and other operations via standardized calls,
  8. returning POST-formatted results.
  9. It supports custom MCP server development to enhance reverse analysis efficiency and flexibility.
  10. Home-page: http://moles.lyshark.com
  11. Author: lyshark
  12. Author-email: me@lyshark.com
  13. License: MIT Licence
  14. Location: C:\Users\admin\site-packages
复制代码
2、至此开始安装IDAMoles驱动文件,通过找到D://IDA Professional 9.1目录,并执行安装命令完成插件的部署。
  1. CMD> python
  2. Python 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11)
  3. [MSC v.1944 64 bit (AMD64)] on win32
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>>
  6. >>> from IDAMoles import *
  7. >>> config = Config(address="127.0.0.1",port=8000)
  8. >>> config.set_ida_path("D://IDA Professional 9.1")
  9. The IDA path has been set to: d:\idapro9.1\plugins
  10. >>>
  11. >>> config.install_moles()
  12. Download progress: 100.00%
  13. [*] Install Moles Success
  14. >>>
  15. >>> config.open_ida_with_program("C://win32.exe",auto_mode=True,force_new=True)
  16. SUCCESS: IDA has been started and the program has been loaded:C://win32.exe
复制代码
仅需简单配置 IDA Pro 路径、安装插件即可完成环境搭建并加载目标程序开展分析工作。
接口规范

该组件基于 IDA 9.1 标准 C++ SDK 开发工具包进行研发,在缺乏有效参考文档与技术支持的前提下,业余时间花费1个月,作者通过理解IDA逆向分析原理与技术攻坚,成功实现了 50 余项核心功能,并按照功能属性系统性归档为六大模块:

  • Info(信息解析)
  • Function(函数分析)
  • Segment(段处理)
  • Reverse(逆向分析)
  • Memory(内存操作)
  • Other(通用辅助)
每个模块下均涵盖数十项接口能力,这些接口不仅覆盖了二进制分析、代码逆向、内存解析等核心场景,更构建起 AI 智能分析所需的底层技术基座,为后续智能化分析、自动化逆向等高阶能力的落地提供了坚实且可扩展的技术支撑。
信息解析

信息解析模块负责对目标程序进行基础元数据提取,快速获取文件结构、加载基址、编译信息、运行环境等核心属性,为后续逆向分析提供全局视图与环境依据,是自动化分析流程的起点。
get_basic_info

调用服务端 Info 类的 GetBasicInfo 接口,获取程序的基础信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Info(config)
  6.     print(info_page.get_basic_info())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "basic_version_info": {
  5.       "database_version": 910,
  6.       "processor_name": "metapc",
  7.       "raw_genflags": 3,
  8.       "auto_analysis_enabled": true,
  9.       "is_idb_readonly": false,
  10.       "current_view_is_graph": false
  11.     },
  12.     "bitness_attr_info": {
  13.       "app_bitness": 32,
  14.       "is_16bit": false,
  15.       "is_32bit": true,
  16.       "is_64bit": false,
  17.       "is_dll": false,
  18.       "is_kernel_mode": false,
  19.       "is_big_endian": false
  20.     },
  21.     "file_system_info": {
  22.       "file_type": "Portable Executable (PE)",
  23.       "file_type_code": 11,
  24.       "os_type": "Windows 16-bit",
  25.       "app_type": "Unknown application type",
  26.       "assembler_type": "Intel Syntax",
  27.       "database_change_count": 10
  28.     },
  29.     "analysis_config_info": {
  30.       "raw_analysis_flags": 3758096375,
  31.       "trace_exec_flow": true,
  32.       "create_jump_tables": true,
  33.       "create_stack_vars": true,
  34.       "trace_stack_pointer": true
  35.     },
  36.     "inftag_info": {
  37.       "INF_VERSION": "910",
  38.       "INF_PROCNAME": "N/A",
  39.       "INF_GENFLAGS": "0x3",
  40.       "INF_LFLAGS": "0x203",
  41.       "INF_DATABASE_CHANGE_COUNT": "10",
  42.       "INF_FILETYPE": "11",
  43.       "INF_OSTYPE": "2",
  44.       "INF_APPTYPE": "260",
  45.       "INF_ASMTYPE": "0",
  46.       "INF_SPECSEGS": "0",
  47.       "INF_AF": "0xdffffff7",
  48.       "UNKNOWN_TAG_11": "0xf",
  49.       "INF_BASEADDR": "0x0",
  50.       "UNKNOWN_TAG_13": "0xffffffffffffffff",
  51.       "UNKNOWN_TAG_14": "0x1",
  52.       "UNKNOWN_TAG_15": "0x401534",
  53.       "INF_START_EA": "0x401534",
  54.       "UNKNOWN_TAG_17": "0xffffffffffffffff",
  55.       "UNKNOWN_TAG_18": "0x401000",
  56.       "INF_MIN_EA": "0x401000",
  57.       "INF_MAX_EA": "0x405000",
  58.       "UNKNOWN_TAG_21": "0x401000",
  59.       "UNKNOWN_TAG_22": "0x405000",
  60.       "UNKNOWN_TAG_23": "0x401000",
  61.       "UNKNOWN_TAG_24": "0x405000",
  62.       "UNKNOWN_TAG_25": "0x10",
  63.       "UNKNOWN_TAG_26": "0x0",
  64.       "UNKNOWN_TAG_27": "0xff00000000000000",
  65.       "UNKNOWN_TAG_28": "0xff00000000800000",
  66.       "UNKNOWN_TAG_29": "0x0",
  67.       "UNKNOWN_TAG_30": "0x2",
  68.       "UNKNOWN_TAG_31": "0x2",
  69.       "UNKNOWN_TAG_32": "0x10",
  70.       "UNKNOWN_TAG_33": "0xf",
  71.       "UNKNOWN_TAG_34": "0xf",
  72.       "UNKNOWN_TAG_35": "0x6",
  73.       "UNKNOWN_TAG_36": "0xea3be67",
  74.       "UNKNOWN_TAG_37": "0x6400007",
  75.       "UNKNOWN_TAG_38": "0x4",
  76.       "UNKNOWN_TAG_39": "0x7",
  77.       "UNKNOWN_TAG_40": "0x10",
  78.       "UNKNOWN_TAG_41": "0x28",
  79.       "UNKNOWN_TAG_42": "0x46",
  80.       "UNKNOWN_TAG_43": "0x50",
  81.       "UNKNOWN_TAG_44": "0x774",
  82.       "UNKNOWN_TAG_45": "0x1",
  83.       "UNKNOWN_TAG_46": "0x3",
  84.       "UNKNOWN_TAG_47": "0x0",
  85.       "UNKNOWN_TAG_48": "0x1",
  86.       "UNKNOWN_TAG_49": "0x13",
  87.       "UNKNOWN_TAG_50": "0xa",
  88.       "UNKNOWN_TAG_51": "0x0",
  89.       "UNKNOWN_TAG_52": "0x0",
  90.       "UNKNOWN_TAG_53": "0x0",
  91.       "UNKNOWN_TAG_54": "0x0",
  92.       "UNKNOWN_TAG_55": "0x7",
  93.       "UNKNOWN_TAG_56": "0x0",
  94.       "UNKNOWN_TAG_57": "0x1",
  95.       "UNKNOWN_TAG_58": "0x33",
  96.       "UNKNOWN_TAG_59": "0x4",
  97.       "UNKNOWN_TAG_60": "0x1",
  98.       "UNKNOWN_TAG_61": "0x4",
  99.       "UNKNOWN_TAG_62": "0x0",
  100.       "UNKNOWN_TAG_63": "0x2",
  101.       "UNKNOWN_TAG_64": "0x4",
  102.       "UNKNOWN_TAG_65": "0x8",
  103.       "UNKNOWN_TAG_66": "0x8",
  104.       "UNKNOWN_TAG_67": "0x0",
  105.       "UNKNOWN_TAG_68": "0x0",
  106.       "UNKNOWN_TAG_69": "0x0",
  107.       "UNKNOWN_TAG_70": "0x0",
  108.       "UNKNOWN_TAG_71": "0x0",
  109.       "UNKNOWN_TAG_72": "0x0",
  110.       "UNKNOWN_TAG_73": "0x0",
  111.       "UNKNOWN_TAG_74": "0x0",
  112.       "UNKNOWN_TAG_75": "0x0",
  113.       "UNKNOWN_TAG_76": "0x0",
  114.       "INF_IDA_VERSION": "N/A",
  115.       "UNKNOWN_TAG_78": "0x0",
  116.       "UNKNOWN_TAG_79": "0x0",
  117.       "UNKNOWN_TAG_80": "0x0",
  118.       "UNKNOWN_TAG_81": "0x0",
  119.       "UNKNOWN_TAG_82": "0x0",
  120.       "UNKNOWN_TAG_83": "0x0",
  121.       "UNKNOWN_TAG_84": "0x0",
  122.       "UNKNOWN_TAG_85": "0x0",
  123.       "UNKNOWN_TAG_86": "0x0",
  124.       "UNKNOWN_TAG_87": "0x0",
  125.       "UNKNOWN_TAG_88": "0x38e",
  126.       "UNKNOWN_TAG_89": "0x69abc696",
  127.       "UNKNOWN_TAG_90": "0x58",
  128.       "UNKNOWN_TAG_91": "0x1",
  129.       "UNKNOWN_TAG_92": "0xad2851a2",
  130.       "INF_IMAGEBASE": "0x400000",
  131.       "UNKNOWN_TAG_94": "0x0",
  132.       "INF_FSIZE": "104960 bytes",
  133.       "UNKNOWN_TAG_96": "0x0",
  134.       "INF_INPUT_FILE_PATH": "N/A"
  135.     },
  136.     "input_file_hash": {
  137.       "md5": "4bfd4d3d1868ddf4869df158d9eadbcb",
  138.       "crc32": "AD2851A2",
  139.       "sha256": "9145169db07de87fa73973a069dc89feca9a785c3a7ea00cf87c082393992ab2"
  140.     },
  141.     "statistical_info": {
  142.       "database_filename": "win32.exe",
  143.       "file_extension": "exe",
  144.       "dbctx_count": 1,
  145.       "supported_encoding_count": 4,
  146.       "program_segment_count": 5,
  147.       "recognized_function_count": 73,
  148.       "imported_module_count": 8,
  149.       "function_chunk_count": 73,
  150.       "hidden_range_count": 0,
  151.       "ida_assigned_symbol_count": 3,
  152.       "memory_mapping_count": 0,
  153.       "thread_count": 0
  154.     }
  155.   },
  156.   "timestamp": 22921484
  157. }
复制代码
get_image_info

调用服务端 Info 类的 GetImageInfo 接口,获取程序的镜像(Image)相关信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Info(config)
  6.     print(info_page.get_image_info())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "omin_ea": 4198400,
  5.     "omax_ea": 4214784,
  6.     "image_size": 16384,
  7.     "omin_ea_hex": "0x401000",
  8.     "omax_ea_hex": "0x405000",
  9.     "image_size_hex": "0x4000"
  10.   },
  11.   "timestamp": 23367984
  12. }
复制代码
函数分析

函数分析模块聚焦程序执行流的最小单元,实现函数枚举、地址定位、名称检索、边界识别与导入表解析,精准建立程序内所有函数的索引体系,为代码理解、漏洞定位与逻辑还原提供关键支撑。
get_functions

调用服务端 Function 类的 GetFunction 接口,获取程序中所有函数的列表信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.get_functions())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "functions": [
  5.       {
  6.         "index": 0,
  7.         "name": "_WinMain@16",
  8.         "start_address": 4198400,
  9.         "start_address_hex": "0x401000",
  10.         "end_address": 4198672,
  11.         "end_address_hex": "0x401110",
  12.         "is_entry": true,
  13.         "is_tail": false,
  14.         "bitness": 32,
  15.         "total_size": 272,
  16.         "visible": true,
  17.         "returns": true,
  18.         "flags": {
  19.           "raw_value": 4198672,
  20.           "FUNC_NORET": false,
  21.           "FUNC_FAR": false,
  22.           "FUNC_LIB": false,
  23.           "FUNC_STATICDEF": false,
  24.           "FUNC_FRAME": true,
  25.           "FUNC_THUNK": false,
  26.           "FUNC_SP_READY": false,
  27.           "FUNC_PROLOG_OK": true
  28.         },
  29.         "frame_info": {
  30.           "frame_netnode": 21520,
  31.           "local_vars_size": 0,
  32.           "saved_regs_size": 4096,
  33.           "args_size": 0,
  34.           "frame_delta": 44,
  35.           "color": 0
  36.         }
  37.       },
  38.       {
  39.         "index": 1,
  40.         "name": "sub_401110",
  41.         "start_address": 4198672,
  42.         "start_address_hex": "0x401110",
  43.         "end_address": 4198813,
  44.         "end_address_hex": "0x40119D",
  45.         "is_entry": true,
  46.         "is_tail": false,
  47.         "bitness": 32,
  48.         "total_size": 141,
  49.         "visible": true,
  50.         "returns": true,
  51.         "flags": {
  52.           "raw_value": 4198813,
  53.           "FUNC_NORET": true,
  54.           "FUNC_FAR": false,
  55.           "FUNC_LIB": true,
  56.           "FUNC_STATICDEF": true,
  57.           "FUNC_FRAME": true,
  58.           "FUNC_THUNK": true,
  59.           "FUNC_SP_READY": false,
  60.           "FUNC_PROLOG_OK": true
  61.         },
  62.         "frame_info": {
  63.           "frame_netnode": 21520,
  64.           "local_vars_size": 0,
  65.           "saved_regs_size": 4368,
  66.           "args_size": 0,
  67.           "frame_delta": 52,
  68.           "color": 0
  69.         }
  70.       }
  71.     ]
  72.   },
  73.   "timestamp": 23582281
  74. }
复制代码
get_function_info

接收函数起始地址参数,验证地址格式后,调用服务端 Function 类的 GetFunctionInfo 接口,获取指定地址函数的详细信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.get_function_info("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "function_info": {
  5.       "start_address": 4198400,
  6.       "start_address_hex": "0x401000",
  7.       "end_address": 4198672,
  8.       "end_address_hex": "0x401110",
  9.       "size": 272,
  10.       "size_hex": "0x110",
  11.       "frame_id": 21520,
  12.       "frame_id_hex": "0x5410",
  13.       "local_vars_size_bytes": 0,
  14.       "saved_regs_size_bytes": 4096,
  15.       "purged_args_size_bytes": 0,
  16.       "frame_ptr_delta": 44,
  17.       "sp_change_count": 4,
  18.       "reg_var_count": 0,
  19.       "reg_arg_count": 0,
  20.       "tail_count": 0,
  21.       "tail_owner": 21520,
  22.       "tail_owner_hex": "0x5410",
  23.       "tail_ref_count": 0,
  24.       "is_far_func": false,
  25.       "returns": true,
  26.       "sp_analyzed": false,
  27.       "need_prolog_analysis": false,
  28.       "name": "_WinMain@16"
  29.     }
  30.   },
  31.   "timestamp": 23974296
  32. }
复制代码
get_import_functions

调用服务端 Function 类的 GetImportFunctions 接口,获取程序中导入函数的列表信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.get_import_functions())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "import_modules": [
  5.       {
  6.         "module_index": 0,
  7.         "module_name": "USER32",
  8.         "functions": [
  9.           {
  10.             "address": 4202552,
  11.             "address_hex": "0x402038",
  12.             "name": "DefWindowProcW",
  13.             "ordinal": 0
  14.           },
  15.           {
  16.             "address": 4202556,
  17.             "address_hex": "0x40203C",
  18.             "name": "BeginPaint",
  19.             "ordinal": 0
  20.           },
  21.           {
  22.             "address": 4202560,
  23.             "address_hex": "0x402040",
  24.             "name": "DestroyWindow",
  25.             "ordinal": 0
  26.           }
  27.         ]
  28.       }
  29.     ]
  30.   },
  31.   "timestamp": 24135515
  32. }
复制代码
get_function_count

调用服务端 Function 类的 GetFunctionCount 接口,获取程序中函数的总数。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.get_function_count())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "total_functions": 73
  5.   },
  6.   "timestamp": 24214328
  7. }
复制代码
get_function_by_addr

接收函数起始地址参数,验证地址格式后,调用服务端 Function 类的 GetFunctionByAddr 接口,根据地址获取对应函数信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.get_function_by_addr("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "function": {
  5.       "name": "_WinMain@16",
  6.       "start_address": 4198400,
  7.       "start_address_hex": "0x401000",
  8.       "end_address": 4198672,
  9.       "end_address_hex": "0x401110",
  10.       "is_entry": true,
  11.       "is_tail": false,
  12.       "bitness": 32,
  13.       "total_size": 272,
  14.       "visible": true,
  15.       "returns": true,
  16.       "flags": {
  17.         "raw_value": 4198672,
  18.         "FUNC_NORET": false,
  19.         "FUNC_FAR": false,
  20.         "FUNC_LIB": false,
  21.         "FUNC_STATICDEF": false,
  22.         "FUNC_FRAME": true,
  23.         "FUNC_THUNK": false,
  24.         "FUNC_SP_READY": false,
  25.         "FUNC_PROLOG_OK": true
  26.       },
  27.       "frame_info": {
  28.         "frame_netnode": 21520,
  29.         "local_vars_size": 0,
  30.         "saved_regs_size": 4096,
  31.         "args_size": 0,
  32.         "frame_delta": 44,
  33.         "color": 0
  34.       }
  35.     }
  36.   },
  37.   "timestamp": 24295312
  38. }
复制代码
get_function_by_name

接收函数名称参数,校验非空后,调用服务端 Function 类的 GetFunctionByName 接口,根据名称获取对应函数信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.get_function_by_name("_WinMain@16"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "function": {
  5.       "index": 0,
  6.       "name": "_WinMain@16",
  7.       "start_address": 4198400,
  8.       "start_address_hex": "0x401000",
  9.       "end_address": 4198672,
  10.       "end_address_hex": "0x401110",
  11.       "is_entry": true,
  12.       "is_tail": false,
  13.       "bitness": 32,
  14.       "total_size": 272,
  15.       "visible": true,
  16.       "returns": true,
  17.       "flags": {
  18.         "raw_value": 4198672,
  19.         "FUNC_NORET": false,
  20.         "FUNC_FAR": false,
  21.         "FUNC_LIB": false,
  22.         "FUNC_STATICDEF": false,
  23.         "FUNC_FRAME": true,
  24.         "FUNC_THUNK": false,
  25.         "FUNC_SP_READY": false,
  26.         "FUNC_PROLOG_OK": true
  27.       },
  28.       "frame_info": {
  29.         "frame_netnode": 21520,
  30.         "local_vars_size": 0,
  31.         "saved_regs_size": 4096,
  32.         "args_size": 0,
  33.         "frame_delta": 44,
  34.         "color": 0
  35.       }
  36.     }
  37.   },
  38.   "timestamp": 24542015
  39. }
复制代码
find_function_by_name

接收搜索关键词参数,校验非空后,调用服务端 Function 类的 FindFunctionByName 接口,模糊搜索包含关键词的函数信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Function(config)
  6.     print(info_page.find_function_by_name("WinMain"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "functions": [
  5.       {
  6.         "index": 0,
  7.         "name": "_WinMain@16",
  8.         "start_address": 4198400,
  9.         "start_address_hex": "0x401000",
  10.         "end_address": 4198672,
  11.         "end_address_hex": "0x0",
  12.         "is_entry": true,
  13.         "is_tail": false,
  14.         "bitness": 32,
  15.         "total_size": 272,
  16.         "visible": true,
  17.         "returns": true,
  18.         "flags": {
  19.           "raw_value": 4198672,
  20.           "FUNC_NORET": false,
  21.           "FUNC_FAR": false,
  22.           "FUNC_LIB": false,
  23.           "FUNC_STATICDEF": false,
  24.           "FUNC_FRAME": true,
  25.           "FUNC_THUNK": false,
  26.           "FUNC_SP_READY": false,
  27.           "FUNC_PROLOG_OK": true
  28.         },
  29.         "frame_info": {
  30.           "frame_netnode": 21520,
  31.           "local_vars_size": 0,
  32.           "saved_regs_size": 4096,
  33.           "args_size": 0,
  34.           "frame_delta": 44,
  35.           "color": 0
  36.         }
  37.       },
  38.       {
  39.         "index": 54,
  40.         "name": "_get_wide_winmain_command_line",
  41.         "start_address": 4202094,
  42.         "start_address_hex": "0x401E6E",
  43.         "end_address": 4202100,
  44.         "end_address_hex": "0x0",
  45.         "is_entry": true,
  46.         "is_tail": false,
  47.         "bitness": 32,
  48.         "total_size": 6,
  49.         "visible": false,
  50.         "returns": true,
  51.         "flags": {
  52.           "raw_value": 4202100,
  53.           "FUNC_NORET": false,
  54.           "FUNC_FAR": false,
  55.           "FUNC_LIB": true,
  56.           "FUNC_STATICDEF": false,
  57.           "FUNC_FRAME": true,
  58.           "FUNC_THUNK": false,
  59.           "FUNC_SP_READY": true,
  60.           "FUNC_PROLOG_OK": true
  61.         },
  62.         "frame_info": {
  63.           "frame_netnode": 21696,
  64.           "local_vars_size": 0,
  65.           "saved_regs_size": 7790,
  66.           "args_size": 0,
  67.           "frame_delta": 0,
  68.           "color": 0
  69.         }
  70.       }
  71.     ],
  72.     "match_count": 2
  73.   },
  74.   "timestamp": 24607906
  75. }
复制代码
段处理

段处理模块围绕程序内存区段展开,支持段表读取、段属性解析、地址归属判断等能力,可快速识别代码段、数据段、只读段等关键区域,为内存布局分析、数据提取与指令定位提供结构基础。
get_segments

调用服务端 Segment 类的 GetSegment 接口,获取程序中所有段(Segment)的列表信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Segment(config)
  6.     print(info_page.get_segments())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "segments": [
  5.       {
  6.         "index": 0,
  7.         "name": ".text",
  8.         "start_address": 4198400,
  9.         "start_address_hex": "0x401000",
  10.         "end_address": 0,
  11.         "end_address_hex": "0x0",
  12.         "total_size": 4290768896,
  13.         "type": 255,
  14.         "selector": 0,
  15.         "bitness": 0,
  16.         "permissions": 0,
  17.         "class": "CODE"
  18.       },
  19.       {
  20.         "index": 1,
  21.         "name": ".idata",
  22.         "start_address": 4202496,
  23.         "start_address_hex": "0x402000",
  24.         "end_address": 0,
  25.         "end_address_hex": "0x0",
  26.         "total_size": 4290764800,
  27.         "type": 255,
  28.         "selector": 0,
  29.         "bitness": 0,
  30.         "permissions": 0,
  31.         "class": "DATA"
  32.       },
  33.       {
  34.         "index": 2,
  35.         "name": ".rdata",
  36.         "start_address": 4202752,
  37.         "start_address_hex": "0x402100",
  38.         "end_address": 0,
  39.         "end_address_hex": "0x0",
  40.         "total_size": 4290764544,
  41.         "type": 255,
  42.         "selector": 0,
  43.         "bitness": 0,
  44.         "permissions": 0,
  45.         "class": "DATA"
  46.       },
  47.       {
  48.         "index": 3,
  49.         "name": ".data",
  50.         "start_address": 4206592,
  51.         "start_address_hex": "0x403000",
  52.         "end_address": 0,
  53.         "end_address_hex": "0x0",
  54.         "total_size": 4290760704,
  55.         "type": 255,
  56.         "selector": 0,
  57.         "bitness": 0,
  58.         "permissions": 0,
  59.         "class": "DATA"
  60.       },
  61.       {
  62.         "index": 4,
  63.         "name": ".gfids",
  64.         "start_address": 4210688,
  65.         "start_address_hex": "0x404000",
  66.         "end_address": 0,
  67.         "end_address_hex": "0x0",
  68.         "total_size": 4290756608,
  69.         "type": 255,
  70.         "selector": 0,
  71.         "bitness": 0,
  72.         "permissions": 0,
  73.         "class": "DATA"
  74.       }
  75.     ],
  76.     "total_segments": 5,
  77.     "description": "Segments information based on template"
  78.   },
  79.   "timestamp": 24864687
  80. }
复制代码
get_segment_count

调用服务端 Segment 类的 GetSegmentCount 接口,获取程序中段的总数。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Segment(config)
  6.     print(info_page.get_segment_count())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "total_segments": 5,
  5.     "description": "Total number of segments in the current disassembled file"
  6.   },
  7.   "timestamp": 24996453
  8. }
复制代码
get_segment_from_addr

接收地址参数,验证地址格式后,调用服务端 Segment 类的 GetSegmentFromAddr 接口,获取指定地址所属段的信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Segment(config)
  6.     print(info_page.get_segment_from_addr("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "parsed_address": 4198400,
  5.     "parsed_address_hex": "0x401000",
  6.     "segment_name": ".text",
  7.     "address": 4198400,
  8.     "address_hex": "0x401000",
  9.     "segment_start": 4198400,
  10.     "segment_start_hex": "0x401000",
  11.     "segment_end": 0,
  12.     "segment_end_hex": "0x0",
  13.     "description": "Segment containing the specified address"
  14.   },
  15.   "timestamp": 25144109
  16. }
复制代码
逆向分析

逆向分析模块集成反汇编、伪代码还原、指令序列提取、代码行与地址互转等核心能力,实现从机器指令到高级语义的转换,大幅降低人工阅读汇编代码的成本,是深度逆向与逻辑还原的核心引擎。
disassembly_function

接收地址参数,验证地址格式后,调用服务端 Reverse 类的 DisassembleFunction 接口,对指定地址的函数进行反汇编。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.disassembly_function("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "function_info": {
  5.       "start_address": 4198400,
  6.       "start_address_hex": "0x401000",
  7.       "end_address": 4198672,
  8.       "end_address_hex": "0x401110",
  9.       "total_instructions": 100,
  10.       "total_size": 272
  11.     },
  12.     "disassembly": [
  13.       {
  14.         "address": 4198400,
  15.         "address_hex": "0x401000",
  16.         "disassembly": "push    ebp",
  17.         "length": 1,
  18.         "bytes": "55"
  19.       },
  20.       {
  21.         "address": 4198401,
  22.         "address_hex": "0x401001",
  23.         "disassembly": "mov     ebp, esp",
  24.         "length": 2,
  25.         "bytes": "8bec"
  26.       },
  27.       {
  28.         "address": 4198403,
  29.         "address_hex": "0x401003",
  30.         "disassembly": "sub     esp, 24h",
  31.         "length": 3,
  32.         "bytes": "83ec24"
  33.       }
  34.     ]
  35.   },
  36.   "timestamp": 25281343
  37. }
复制代码
disassembly_count

接收地址和行数参数,验证地址格式并校验行数在 1-1024 范围内后,调用服务端 Reverse 类的 DisassemblyCount 接口,反汇编指定地址开始的指定行数指令。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.disassembly_count("0x401000","3"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "success": true,
  5.     "request_start_address": 4198400,
  6.     "request_start_address_hex": "0x401000",
  7.     "request_line_count": 3,
  8.     "actual_line_count": 3,
  9.     "actual_start_address_hex": "0x401000",
  10.     "actual_end_address_hex": "0x0000000000401006",
  11.     "instructions": [
  12.       {
  13.         "address_hex": "0x401000",
  14.         "address_dec": 4198400,
  15.         "opcode_hex": "55 ",
  16.         "disasm_text": "push    ebp"
  17.       },
  18.       {
  19.         "address_hex": "0x401001",
  20.         "address_dec": 4198401,
  21.         "opcode_hex": "8B EC ",
  22.         "disasm_text": "mov     ebp, esp"
  23.       },
  24.       {
  25.         "address_hex": "0x401003",
  26.         "address_dec": 4198403,
  27.         "opcode_hex": "83 EC 24 ",
  28.         "disasm_text": "sub     esp, 24h"
  29.       }
  30.     ]
  31.   },
  32.   "timestamp": 25588203
  33. }
复制代码
disassembly_range

接收起始和结束地址参数,验证地址格式后,调用服务端 Reverse 类的 DisassemblyRange 接口,反汇编指定地址范围内的指令。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.disassembly_range("0x401000","0x401020"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "success": true,
  5.     "request_start_address": 4198400,
  6.     "request_start_address_hex": "0x401000",
  7.     "request_end_address": 4198432,
  8.     "request_end_address_hex": "0x401020",
  9.     "actual_processed_count": 12,
  10.     "actual_start_address_hex": "0x401000",
  11.     "actual_end_address_hex": "0x0000000000401020",
  12.     "instructions": [
  13.       {
  14.         "address_hex": "0x401000",
  15.         "address_dec": 4198400,
  16.         "opcode_hex": "55 ",
  17.         "disasm_text": "push    ebp"
  18.       },
  19.       {
  20.         "address_hex": "0x401001",
  21.         "address_dec": 4198401,
  22.         "opcode_hex": "8B EC ",
  23.         "disasm_text": "mov     ebp, esp"
  24.       },
  25.       {
  26.         "address_hex": "0x401003",
  27.         "address_dec": 4198403,
  28.         "opcode_hex": "83 EC 24 ",
  29.         "disasm_text": "sub     esp, 24h"
  30.       },
  31.       {
  32.         "address_hex": "0x401006",
  33.         "address_dec": 4198406,
  34.         "opcode_hex": "A1 04 30 40 00 ",
  35.         "disasm_text": "mov     eax, ___security_cookie"
  36.       },
  37.       {
  38.         "address_hex": "0x40100B",
  39.         "address_dec": 4198411,
  40.         "opcode_hex": "33 C5 ",
  41.         "disasm_text": "xor     eax, ebp"
  42.       },
  43.       {
  44.         "address_hex": "0x40100D",
  45.         "address_dec": 4198413,
  46.         "opcode_hex": "89 45 FC ",
  47.         "disasm_text": "mov     [ebp+var_4], eax"
  48.       },
  49.       {
  50.         "address_hex": "0x401010",
  51.         "address_dec": 4198416,
  52.         "opcode_hex": "56 ",
  53.         "disasm_text": "push    esi"
  54.       },
  55.       {
  56.         "address_hex": "0x401011",
  57.         "address_dec": 4198417,
  58.         "opcode_hex": "8B 35 80 20 40 00 ",
  59.         "disasm_text": "mov     esi, ds:LoadStringW"
  60.       },
  61.       {
  62.         "address_hex": "0x401017",
  63.         "address_dec": 4198423,
  64.         "opcode_hex": "57 ",
  65.         "disasm_text": "push    edi"
  66.       },
  67.       {
  68.         "address_hex": "0x401018",
  69.         "address_dec": 4198424,
  70.         "opcode_hex": "8B 7D 08 ",
  71.         "disasm_text": "mov     edi, [ebp+hInstance]"
  72.       },
  73.       {
  74.         "address_hex": "0x40101B",
  75.         "address_dec": 4198427,
  76.         "opcode_hex": "6A 64 ",
  77.         "disasm_text": "push    64h ; 'd'; cchBufferMax"
  78.       },
  79.       {
  80.         "address_hex": "0x40101D",
  81.         "address_dec": 4198429,
  82.         "opcode_hex": "68 48 34 ",
  83.         "disasm_text": "push    offset WindowName; lpBuffer"
  84.       }
  85.     ],
  86.     "note": "The specified address range has been completely disassembled"
  87.   },
  88.   "timestamp": 25678687
  89. }
复制代码
decompile_checked

接收地址参数,验证地址格式后,调用服务端 Reverse 类的 DecompileChecked 接口,对指定地址进行反编译校验。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.decompile_checked("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "requested_address": 4198400,
  5.     "requested_address_hex": "0x401000",
  6.     "flag": "true"
  7.   },
  8.   "timestamp": 25813265
  9. }
复制代码
decompile_micro_code

接收地址参数,验证地址格式后,调用服务端 Reverse 类的 GetMicroCode 接口,获取指定地址的微代码反编译结果。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.decompile_micro_code("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "function_start_address": 4198400,
  5.     "function_start_address_hex": "0x401000",
  6.     "requested_address": 4198400,
  7.     "requested_address_hex": "0x401000",
  8.     "microcode": "\u0001\u00130. 0 \u0002\u0013\u0001\u0003; STKD=30 MINREF=3C/END=60 ARGS: OFF=64/MINREF=164/END=164/SHADOW=0\u0002\u0003\n\n\u0001\u00130. 0 \u0002\u0013\u0001\u0003; SAVEDREGS: ebp.4,esi.4,edi.4,ebx.4\u0002\u0003\n\n\u0001\u00130. 0 \u0002\u0013\u0001\u0003; 1WAY-BLOCK 0 FAKE OUTBOUNDS: 1 [START=401000 END=401000] MINREFS: STK=60/ARG=164, MAXBSP: 0\u0002\u0003\n\n\u0001\u00130. 0 \u0002\u0013\u0001\u0003; DEF: (eax.4,esi.4,sp+38.8,sp+44.4,arg+0.4,arg+C.4)\u0002\u0003\n\n\u0001\u00130"
  9.   },
  10.   "timestamp": 25935843
  11. }
复制代码
decompile_from_addr

接收地址参数,验证地址格式后,调用服务端 Reverse 类的 DecompileFunctionFromAddr 接口,根据地址反编译对应函数。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.decompile_from_addr("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "success": true,
  5.     "func_ea": 4198400,
  6.     "func_ea_hex": "0x401000",
  7.     "func_name": "_WinMain@16",
  8.     "pseudocode": "int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)\n{\n  HWND Window; // eax\n  HWND v5; // esi\n  HACCEL hAccTable; // [esp+8h] [ebp-24h]\n  tagMSG Msg; // [esp+Ch] [ebp-20h] BYREF\n\n  LoadStringW(hInstance, 0x67u, &WindowName, 100);\n  LoadStringW(hInstance, 0x6Du, &ClassName, 100);\n  sub_401110(hInstance);\n  ::hInstance = hInstance;\n  Window = CreateWindowExW(0, &ClassName, &WindowName, 0xCF0000u, 0x80000000, 0, 0x80000000, 0, 0, 0, hInstance, 0);\n  v5 = Window;\n  if ( !Window )\n    return 0;\n  ShowWindow(Window, nShowCmd);\n  UpdateWindow(v5);\n  hAccTable = LoadAcceleratorsW(hInstance, (LPCWSTR)0x6D);\n  while ( GetMessageW(&Msg, 0, 0, 0) )\n  {\n    if ( !TranslateAcceleratorW(Msg.hwnd, hAccTable, &Msg) )\n    {\n      TranslateMessage(&Msg);\n      DispatchMessageW(&Msg);\n    }\n  }\n  return Msg.wParam;\n}\n",
  9.     "line_count": 28
  10.   },
  11.   "timestamp": 26053203
  12. }
复制代码
decompile_from_name

接收函数名称参数,校验非空后,调用服务端 Reverse 类的 DecompileFunctionFromName 接口,根据名称反编译对应函数。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.decompile_from_name("_WinMain@16"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "success": true,
  5.     "func_ea": 4198400,
  6.     "func_ea_hex": "0x401000",
  7.     "func_name": "_WinMain@16",
  8.     "pseudocode": "int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)\n{\n  HWND Window; // eax\n  HWND v5; // esi\n  HACCEL hAccTable; // [esp+8h] [ebp-24h]\n  tagMSG Msg; // [esp+Ch] [ebp-20h] BYREF\n\n  LoadStringW(hInstance, 0x67u, &WindowName, 100);\n  LoadStringW(hInstance, 0x6Du, &ClassName, 100);\n  sub_401110(hInstance);\n  ::hInstance = hInstance;\n  Window = CreateWindowExW(0, &ClassName, &WindowName, 0xCF0000u, 0x80000000, 0, 0x80000000, 0, 0, 0, hInstance, 0);\n  v5 = Window;\n  if ( !Window )\n    return 0;\n  ShowWindow(Window, nShowCmd);\n  UpdateWindow(v5);\n  hAccTable = LoadAcceleratorsW(hInstance, (LPCWSTR)0x6D);\n  while ( GetMessageW(&Msg, 0, 0, 0) )\n  {\n    if ( !TranslateAcceleratorW(Msg.hwnd, hAccTable, &Msg) )\n    {\n      TranslateMessage(&Msg);\n      DispatchMessageW(&Msg);\n    }\n  }\n  return Msg.wParam;\n}\n",
  9.     "line_count": 28
  10.   },
  11.   "timestamp": 26105687
  12. }
复制代码
decompile_line_to_address

接收地址和行号参数,验证地址格式并校验行号非空后,调用服务端 Reverse 类的 DecompileLineToAddress 接口,将反编译代码的行号映射到对应内存地址。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.decompile_line_to_address("0x401000","8"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "line_number": 8,
  5.     "function_address": 4198400,
  6.     "function_address_hex": "0x401000",
  7.     "memory_address": 4198437,
  8.     "memory_address_hex": "0x401025"
  9.   },
  10.   "timestamp": 26320421
  11. }
复制代码
decompile_address_to_line

接收地址参数,验证地址格式后,调用服务端 Reverse 类的 DecompileAddressToLine 接口,将指定地址映射到反编译代码的行号。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.decompile_address_to_line("0x401025"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "line_number": 8,
  5.     "address": 4198437,
  6.     "address_hex": "0x401025"
  7.   },
  8.   "timestamp": 26457390
  9. }
复制代码
get_select_decompile

调用服务端 Reverse 类的 GetSelectDecompile 接口,获取当前选中区域的反编译代码。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.get_select_decompile())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "start_ea": 4198502,
  5.     "start_ea_hex": "0x401066",
  6.     "end_ea": 4198535,
  7.     "end_ea_hex": "0x401087",
  8.     "function_start_ea": 4198400,
  9.     "function_start_ea_hex": "0x401000",
  10.     "filtered_pseudocode_lines": [
  11.       {
  12.         "line": 12,
  13.         "address": 4198502,
  14.         "address_hex": "0x401066",
  15.         "pseudocode": "  Window = CreateWindowExW(0, &ClassName, &WindowName, 0xCF0000u, 0x80000000, 0, 0x80000000, 0, 0, 0, hInstance, 0);"
  16.       },
  17.       {
  18.         "line": 13,
  19.         "address": 4198508,
  20.         "address_hex": "0x40106C",
  21.         "pseudocode": "  v5 = Window;"
  22.       },
  23.       {
  24.         "line": 14,
  25.         "address": 4198512,
  26.         "address_hex": "0x401070",
  27.         "pseudocode": "  if ( !Window )"
  28.       },
  29.       {
  30.         "line": 16,
  31.         "address": 4198522,
  32.         "address_hex": "0x40107A",
  33.         "pseudocode": "  ShowWindow(Window, nShowCmd);"
  34.       },
  35.       {
  36.         "line": 17,
  37.         "address": 4198529,
  38.         "address_hex": "0x401081",
  39.         "pseudocode": "  UpdateWindow(v5);"
  40.       }
  41.     ],
  42.     "matched_line_count": 5,
  43.     "has_matched": true
  44.   },
  45.   "timestamp": 26635062
  46. }
复制代码
get_select_disassembly

调用服务端 Reverse 类的 GetSelectDisassembly 接口,获取当前选中区域的反汇编指令。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.get_select_disassembly())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "selected_start_address": 4198582,
  5.     "selected_start_address_hex": "0x4010B6",
  6.     "selected_end_address": 4198598,
  7.     "selected_end_address_hex": "0x4010C6",
  8.     "actual_processed_count": 5,
  9.     "actual_start_address_hex": "0x4010B6",
  10.     "actual_end_address_hex": "0x4010C6",
  11.     "instructions": [
  12.       {
  13.         "address_hex": "0x4010B6",
  14.         "address_dec": 4198582,
  15.         "opcode_hex": "8D 45 E0 ",
  16.         "disasm_text": "lea     eax, [ebp+Msg]"
  17.       },
  18.       {
  19.         "address_hex": "0x4010B9",
  20.         "address_dec": 4198585,
  21.         "opcode_hex": "50 ",
  22.         "disasm_text": "push    eax; lpMsg"
  23.       },
  24.       {
  25.         "address_hex": "0x4010BA",
  26.         "address_dec": 4198586,
  27.         "opcode_hex": "FF 75 DC ",
  28.         "disasm_text": "push    [ebp+hAccTable]; hAccTable"
  29.       },
  30.       {
  31.         "address_hex": "0x4010BD",
  32.         "address_dec": 4198589,
  33.         "opcode_hex": "FF 75 E0 ",
  34.         "disasm_text": "push    [ebp+Msg.hwnd]; hWnd"
  35.       },
  36.       {
  37.         "address_hex": "0x4010C0",
  38.         "address_dec": 4198592,
  39.         "opcode_hex": "FF 15 70 20 40 00 ",
  40.         "disasm_text": "call    ds:TranslateAcceleratorW"
  41.       }
  42.     ],
  43.     "note": "The selected address range has been completely disassembled."
  44.   },
  45.   "timestamp": 26719015
  46. }
复制代码
get_select_hex

调用服务端 Reverse 类的 GetSelectHex 接口,获取当前选中区域的十六进制数据。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Reverse(config)
  6.     print(info_page.get_select_hex())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "selected_start_address": 4198688,
  5.     "selected_start_address_hex": "0x401120",
  6.     "selected_end_address": 4198698,
  7.     "selected_end_address_hex": "0x40112A",
  8.     "actual_read_byte_count": 10,
  9.     "actual_start_address_hex": "0x401120",
  10.     "actual_end_address_hex": "0x401129",
  11.     "hex_bytes": [
  12.       {
  13.         "address_hex": "0x401120",
  14.         "address_dec": 4198688,
  15.         "byte_hex": "6A",
  16.         "ascii_char": "j"
  17.       },
  18.       {
  19.         "address_hex": "0x401121",
  20.         "address_dec": 4198689,
  21.         "byte_hex": "6B",
  22.         "ascii_char": "k"
  23.       },
  24.       {
  25.         "address_hex": "0x401122",
  26.         "address_dec": 4198690,
  27.         "byte_hex": "51",
  28.         "ascii_char": "Q"
  29.       },
  30.       {
  31.         "address_hex": "0x401123",
  32.         "address_dec": 4198691,
  33.         "byte_hex": "C7",
  34.         "ascii_char": "."
  35.       },
  36.       {
  37.         "address_hex": "0x401124",
  38.         "address_dec": 4198692,
  39.         "byte_hex": "45",
  40.         "ascii_char": "E"
  41.       },
  42.       {
  43.         "address_hex": "0x401125",
  44.         "address_dec": 4198693,
  45.         "byte_hex": "CC",
  46.         "ascii_char": "."
  47.       },
  48.       {
  49.         "address_hex": "0x401126",
  50.         "address_dec": 4198694,
  51.         "byte_hex": "30",
  52.         "ascii_char": "0"
  53.       },
  54.       {
  55.         "address_hex": "0x401127",
  56.         "address_dec": 4198695,
  57.         "byte_hex": "00",
  58.         "ascii_char": "."
  59.       },
  60.       {
  61.         "address_hex": "0x401128",
  62.         "address_dec": 4198696,
  63.         "byte_hex": "00",
  64.         "ascii_char": "."
  65.       },
  66.       {
  67.         "address_hex": "0x401129",
  68.         "address_dec": 4198697,
  69.         "byte_hex": "00",
  70.         "ascii_char": "."
  71.       }
  72.     ],
  73.     "hex_batch": "6A 6B 51 C7 45 CC 30 00 00 00 ",
  74.     "ascii_batch": "jkQ.E.0...",
  75.     "note": "The selected address range has been completely read (hex bytes + ASCII)."
  76.   },
  77.   "timestamp": 26822062
  78. }
复制代码
内存操作

内存操作模块提供内存数据读取、结构体解析、字符串提取、内存搜索与交叉引用查询等能力,支持按字节/字/双字精准读取数据,并追踪代码与数据间的引用关系,实现对程序运行时状态的完整观测。
get_entry_points

调用服务端 Memory 类的 GetEntryPoints 接口,获取程序的所有入口点地址信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_entry_points())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "entry_points": [
  5.       {
  6.         "ordinal": 4199684,
  7.         "address": 4199684,
  8.         "address_hex": "0x401504",
  9.         "name": "start",
  10.         "forwarder": "",
  11.         "index": 0
  12.       }
  13.     ],
  14.     "total_count": 1
  15.   },
  16.   "timestamp": 35475343
  17. }
复制代码
get_defined_struct

调用服务端 Memory 类的 GetDefinedStruct 接口,获取程序中已定义的所有结构体信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_defined_struct())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "defined_types": [
  5.       {
  6.         "ordinal": 1,
  7.         "get_success": true,
  8.         "name": "_GUID",
  9.         "size_bytes": 16,
  10.         "size_hex": "0x10",
  11.         "is_union": false,
  12.         "is_struct": true,
  13.         "is_enum": false,
  14.         "is_typedef": false,
  15.         "is_ptr": false,
  16.         "is_array": false,
  17.         "type_string": "_GUID"
  18.       },
  19.       {
  20.         "ordinal": 2,
  21.         "get_success": true,
  22.         "name": "GUID",
  23.         "size_bytes": 16,
  24.         "size_hex": "0x10",
  25.         "is_union": false,
  26.         "is_struct": true,
  27.         "is_enum": false,
  28.         "is_typedef": true,
  29.         "is_ptr": false,
  30.         "is_array": false,
  31.         "type_string": "GUID"
  32.       },
  33.       {
  34.         "ordinal": 3,
  35.         "get_success": true,
  36.         "name": "_EH4_SCOPETABLE_RECORD",
  37.         "size_bytes": 12,
  38.         "size_hex": "0xC",
  39.         "is_union": false,
  40.         "is_struct": true,
  41.         "is_enum": false,
  42.         "is_typedef": false,
  43.         "is_ptr": false,
  44.         "is_array": false,
  45.         "type_string": "_EH4_SCOPETABLE_RECORD"
  46.       }
  47.     ],
  48.     "total_count": 79
  49.   },
  50.   "timestamp": 35726906
  51. }
复制代码
get_memory_byte

接收地址参数,验证地址格式后,调用服务端 Memory 类的 GetMemoryByte 接口,获取指定地址的 1 字节内存数据。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_memory_byte("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "address": 4198400,
  5.     "address_hex": "0x401000",
  6.     "byte_value": 85,
  7.     "byte_hex": "55"
  8.   },
  9.   "timestamp": 35917234
  10. }
复制代码
get_memory_word

接收地址参数,验证地址格式后,调用服务端 Memory 类的 GetMemoryWord 接口,获取指定地址的 2 字节(Word)内存数据。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_memory_word("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "address": 4198400,
  5.     "address_hex": "0x401000",
  6.     "word_value": 35669,
  7.     "word_hex": "8B55"
  8.   },
  9.   "timestamp": 36064421
  10. }
复制代码
get_memory_dword
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_memory_dword("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "address": 4198400,
  5.     "address_hex": "0x401000",
  6.     "dword_value": 2213317461,
  7.     "dword_hex": "83EC8B55"
  8.   },
  9.   "timestamp": 36239218
  10. }
复制代码
get_memory_qword

接收地址参数,验证地址格式后,调用服务端 Memory 类的 GetMemoryQword 接口,获取指定地址的 8 字节(Qword)内存数据。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_memory_qword("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "address": 4198400,
  5.     "address_hex": "0x401000",
  6.     "qword_value": 10040244221420278000,
  7.     "qword_hex": "-74A9E3137C1374AB"
  8.   },
  9.   "timestamp": 36541093
  10. }
复制代码
get_memory_bytes

接收地址和长度参数,验证地址格式并校验长度为正数后,调用服务端 Memory 类的 GetMemoryBytes 接口,获取指定地址开始的指定长度内存数据。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_memory_bytes("0x401000","5"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "address": 4198400,
  5.     "address_hex": "0x401000",
  6.     "requested_length": 5,
  7.     "actual_length": 5,
  8.     "bytes": [
  9.       85,
  10.       139,
  11.       236,
  12.       131,
  13.       236
  14.     ],
  15.     "bytes_hex": [
  16.       "55",
  17.       "8b",
  18.       "ec",
  19.       "83",
  20.       "ec"
  21.     ]
  22.   },
  23.   "timestamp": 36614296
  24. }
复制代码
get_string_info

调用服务端 Memory 类的 GetStringInfo 接口,获取程序中所有字符串相关信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_string_info())
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "strings": [
  5.       {
  6.         "index": 0,
  7.         "start_address": 4203052,
  8.         "start_address_hex": "0x40222C",
  9.         "end_address": 4203143,
  10.         "end_address_hex": "0x402287",
  11.         "size": 91
  12.       },
  13.       {
  14.         "index": 1,
  15.         "start_address": 4203176,
  16.         "start_address_hex": "0x4022A8",
  17.         "end_address": 4203185,
  18.         "end_address_hex": "0x4022B1",
  19.         "size": 9
  20.       },
  21.       {
  22.         "index": 2,
  23.         "start_address": 4203196,
  24.         "start_address_hex": "0x4022BC",
  25.         "end_address": 4203205,
  26.         "end_address_hex": "0x4022C5",
  27.         "size": 9
  28.       }
  29.     ],
  30.     "total_count": 94
  31.   },
  32.   "timestamp": 36942859
  33. }
复制代码
get_memory_search

接收起始地址、结束地址和搜索参数,验证地址格式并校验搜索参数非空后,调用服务端 Memory 类的 MemorySearch 接口,在指定地址范围内搜索指定内容。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_memory_search("0x401000","0x402000","688033"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "found_address": 4198431,
  5.     "found_address_hex": "0x40101F",
  6.     "searched_pattern": "688033",
  7.     "search_start": 4198400,
  8.     "search_start_hex": "0x401000",
  9.     "search_end": 4202496,
  10.     "search_end_hex": "0x402000"
  11.   },
  12.   "timestamp": 37278640
  13. }
复制代码
get_type_by_name

接收类型名称参数,校验非空后,调用服务端 Memory 类的 GetTypeByName 接口,根据名称获取对应的类型定义信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.get_type_by_name("_GUID"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "type_info": {
  5.       "original_name": "_GUID",
  6.       "size_bytes": 16
  7.     }
  8.   },
  9.   "timestamp": 37370109
  10. }
复制代码
xref_code_first_to

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefCodeFirstTo 接口,获取指向该地址的第一条代码交叉引用。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_code_first_to("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "xrefs": [
  5.       {
  6.         "basic_info": {
  7.           "from_address": 4199565,
  8.           "to_address": 4199570,
  9.           "from_address_hex": "0x40148D",
  10.           "to_address_hex": "0x401492",
  11.           "is_code_ref": false,
  12.           "is_user_defined": true
  13.         },
  14.         "type_details": {
  15.           "type_code": 16,
  16.           "type_char": "P",
  17.           "base_type_masked": 16,
  18.           "code_ref_type": "Call Far (This xref creates a function at the referenced location)",
  19.           "xref_flags": {
  20.             "XREF_USER": false,
  21.             "XREF_TAIL": false,
  22.             "XREF_BASE": false,
  23.             "XREF_PASTEND": false
  24.           }
  25.         },
  26.         "from_address_details": {
  27.           "disassembly": "call    _WinMain@16",
  28.           "is_head_address": true
  29.         },
  30.         "function_info": {
  31.           "function_start": 4199324,
  32.           "function_start_hex": "0x40139C",
  33.           "function_name": "?__scrt_common_main_seh@@YAHXZ",
  34.           "function_flags": 4199684
  35.         },
  36.         "segment_info": {
  37.           "segment_start": 4198400,
  38.           "segment_start_hex": "0x401000",
  39.           "segment_name": ".text",
  40.           "segment_type": 255,
  41.           "segment_perm": "None"
  42.         },
  43.         "reference_flags": {
  44.           "has_external_references": false,
  45.           "has_jump_flow_xrefs": true
  46.         },
  47.         "outgoing_references": {
  48.           "code_references": [
  49.             4199570,
  50.             4198400
  51.           ],
  52.           "far_code_references": [
  53.             4198400
  54.           ]
  55.         },
  56.         "incoming_references": {
  57.           "code_references_to": [
  58.             4199560
  59.           ],
  60.           "far_code_references_to": []
  61.         }
  62.       }
  63.     ]
  64.   },
  65.   "timestamp": 37865437
  66. }
复制代码
xref_code_first_from

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefCodeFirstFrom 接口,获取从该地址出发的第一条代码交叉引用。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_code_first_from("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "xrefs": [
  5.       {
  6.         "basic_info": {
  7.           "from_address": 4198400,
  8.           "to_address": 0,
  9.           "from_address_hex": "0x401000",
  10.           "to_address_hex": "0x0",
  11.           "is_code_ref": true,
  12.           "is_user_defined": true
  13.         },
  14.         "type_details": {
  15.           "type_code": 16,
  16.           "type_char": "P",
  17.           "base_type_masked": 16,
  18.           "code_ref_type": "Call Far (This xref creates a function at the referenced location)",
  19.           "xref_flags": {
  20.             "XREF_USER": false,
  21.             "XREF_TAIL": false,
  22.             "XREF_BASE": false,
  23.             "XREF_PASTEND": false
  24.           }
  25.         },
  26.         "from_address_details": {
  27.           "disassembly": "push    ebp",
  28.           "is_head_address": false
  29.         },
  30.         "function_info": {
  31.           "function_start": 4198400,
  32.           "function_start_hex": "0x401000",
  33.           "function_name": "_WinMain@16",
  34.           "function_flags": 4198638
  35.         },
  36.         "segment_info": {
  37.           "segment_start": 4198400,
  38.           "segment_start_hex": "0x401000",
  39.           "segment_name": ".text",
  40.           "segment_type": 255,
  41.           "permissions": "",
  42.           "segment_perm": ""
  43.         },
  44.         "reference_flags": {
  45.           "has_external_references": true,
  46.           "has_jump_flow_xrefs": false
  47.         },
  48.         "outgoing_references": {
  49.           "code_references": [
  50.             4199565
  51.           ],
  52.           "far_code_references": [
  53.             4199565
  54.           ]
  55.         },
  56.         "incoming_references": {
  57.           "code_references_to": [
  58.             4199565
  59.           ],
  60.           "far_code_references_to": [
  61.             4199565
  62.           ]
  63.         }
  64.       }
  65.     ]
  66.   },
  67.   "timestamp": 37980640
  68. }
复制代码
xref_data_first_to

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefDataFirstTo 接口,获取指向该地址的第一条数据交叉引用。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_data_first_to("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "analysis_result": {
  5.       "analyzed_address": 4198400,
  6.       "data_xrefs_to": [],
  7.       "outgoing_references": {
  8.         "code_xrefs_from": [],
  9.         "data_xrefs_from": [],
  10.         "far_code_xrefs_from": []
  11.       },
  12.       "switch_analysis": {
  13.         "status": "No switch table references found"
  14.       }
  15.     }
  16.   },
  17.   "timestamp": 38080250
  18. }
复制代码
xref_data_first_from

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefDataFirstFrom 接口,获取从该地址出发的第一条数据交叉引用。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_data_first_from("0x401007"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "outgoing_data_xrefs": [
  5.       {
  6.         "from_address_hex": "0x401007",
  7.         "basic_info": {
  8.           "from_address": 4198407,
  9.           "is_user_defined": true,
  10.           "is_code_origin": true
  11.         },
  12.         "type_info": {
  13.           "type_code": 32,
  14.           "type_char": "?",
  15.           "base_type_masked": 0,
  16.           "data_ref_type": "Undefined data reference type"
  17.         },
  18.         "flags_info": {
  19.           "XREF_USER": true,
  20.           "XREF_TAIL": false,
  21.           "XREF_BASE": false,
  22.           "XREF_PASTEND": false
  23.         },
  24.         "from_address_details": {
  25.           "disassembly": "mov     esi, ds:LoadStringW",
  26.           "item_type": "Code (instruction)"
  27.         },
  28.         "function_info": {
  29.           "function_name": "_WinMain@16",
  30.           "function_start": 4198400,
  31.           "function_start_hex": "0x401000",
  32.           "frame_size": 60
  33.         },
  34.         "segment_comparison": {
  35.           "note": "One or both addresses have no valid segment"
  36.         },
  37.         "target_data_details": {
  38.           "note": "Target is not recognized data (unanalyzed or gap)",
  39.           "has_incoming_refs": false
  40.         }
  41.       }
  42.     ]
  43.   },
  44.   "timestamp": 38226593
  45. }
复制代码
xref_code_to_array

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefCodeFromArray 接口,获取所有从该地址出发的代码交叉引用列表。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_code_to_array("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "code_xrefs_to": [
  5.       {
  6.         "from_address": 4199565,
  7.         "to_address": 0,
  8.         "is_code_ref": false,
  9.         "direction": "Down (target address <= from address)"
  10.       }
  11.     ]
  12.   },
  13.   "timestamp": 38309062
  14. }
复制代码
xref_data_from_array

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefDataFromArray 接口,获取所有从该地址出发的数据交叉引用列表。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_code_from_array("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "code_xrefs_from": [],
  5.     "note": "No FAR code references from the specified address"
  6.   },
  7.   "timestamp": 38380906
  8. }
复制代码
xref_get_list_array

接收地址参数,验证地址格式后,调用服务端 Memory 类的 XrefGetListArray 接口,获取该地址相关的所有交叉引用列表。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_data_to_array("0x402080"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "data_xrefs_to": [
  5.       {
  6.         "from_address": 4198407,
  7.         "to_address": 4202624,
  8.         "is_code_origin": true,
  9.         "direction": "Up (target address > from address)"
  10.       }
  11.     ]
  12.   },
  13.   "timestamp": 38484250
  14. }
复制代码
通用辅助

通用辅助模块提供注释编辑、符号重命名、变量修改、结构成员管理等便捷操作,用于优化 IDA 展示效果、提升分析效率,让逆向成果更易沉淀、共享与二次利用,是工程化分析必不可少的辅助能力。
set_assembly_comment

接收地址和注释参数,验证地址格式并校验注释非空后,调用服务端 Other 类的 SetAssemblyComment 接口,为指定地址的汇编指令添加注释。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_data_from_array("0x402080"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "data_xrefs_from": [],
  5.     "note": "No data references from the specified address"
  6.   },
  7.   "timestamp": 38516921
  8. }
复制代码
set_function_comment

接收地址和注释参数,验证地址格式并校验注释非空后,调用服务端 Other 类的 SetFunctionComment 接口,为指定地址的函数添加注释。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Memory(config)
  6.     print(info_page.xref_get_list_array("0x402080"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "target_address_dec": 4202624,
  5.     "target_address_hex": "0x402080",
  6.     "xref_counts": {
  7.       "code_to": 2,
  8.       "code_from": 0,
  9.       "data_to": 1,
  10.       "data_from": 0
  11.     },
  12.     "total_xrefs": 3
  13.   },
  14.   "timestamp": 38595187
  15. }
复制代码
get_function_name

接收地址参数,验证地址格式后,调用服务端 Other 类的 GetFunctionName 接口,获取指定地址所属函数的名称。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     print(info_page.set_assembly_commnet("0x401000","new comm"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "set_success": true,
  5.     "target_address_dec": 4198400,
  6.     "target_address_hex": "0x401000",
  7.     "comment_content": "new comm",
  8.     "comment_type": "repeatable_comment"
  9.   },
  10.   "timestamp": 38946781
  11. }
复制代码
set_function_name

接收地址和函数名称参数,验证地址格式并校验名称非空后,调用服务端 Other 类的 SetFunctionName 接口,修改指定地址所属函数的名称。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     print(info_page.set_function_comment("0x401000","new comm"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "requested_address": 4198400,
  5.     "requested_address_hex": "0x401000",
  6.     "comment_content": "new comm",
  7.     "is_global": true,
  8.     "flag": "true"
  9.   },
  10.   "timestamp": 39185687
  11. }
复制代码
switch_pseudocode_to

接收地址参数,验证地址格式后,调用服务端 Other 类的 SwitchPseudoCodeTo 接口,切换伪代码窗口到指定地址位置并反编译。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     print(info_page.get_function_name("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "requested_address": 4198400,
  5.     "requested_address_hex": "0x401000",
  6.     "flag": "true",
  7.     "function_name": "_WinMain@16",
  8.     "actual_function_start_address": 4198400,
  9.     "actual_function_start_address_hex": "0x401000"
  10.   },
  11.   "timestamp": 39246453
  12. }
复制代码
get_function_var_name

接收地址参数,验证地址格式后,调用服务端 Other 类的 GetFunctionVarName 接口,获取指定地址所属函数的变量名称。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     print(info_page.set_function_name("0x401000","MyFunc"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "requested_address": 4198400,
  5.     "requested_address_hex": "0x401000",
  6.     "new_function_name": "MyFunc",
  7.     "flag": "true",
  8.     "actual_function_start_address": 4198400,
  9.     "actual_function_start_address_hex": "0x401000",
  10.     "final_function_name": "MyFunc"
  11.   },
  12.   "timestamp": 39369609
  13. }
复制代码
set_function_var_name

接收地址、UID 和变量名称参数,验证地址格式并校验 UID 和变量名称非空后,调用服务端 Other 类的 SetFunctionVarName 接口,修改指定地址函数中指定 UID 的变量名称。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     print(info_page.switch_pseudocode_to("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "message": "Successfully switched to pseudocode",
  5.     "function_address": "0x401000"
  6.   },
  7.   "timestamp": 39529218
  8. }
复制代码
get_struct_member_name

接收结构体名称和偏移量参数,校验结构体名称非空且偏移量为非负整数后,调用服务端 Other 类的 GetStructMemberName 接口,获取指定结构体中指定偏移量的成员名称。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     info_page.switch_pseudocode_to("0x401000")
  7.     print(info_page.get_function_var_name("0x401000"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "variables": [
  5.       {
  6.         "name": "hInstance",
  7.         "location": "stack offset: 0x5C",
  8.         "width_bytes": 4,
  9.         "type": "HINSTANCE",
  10.         "is_user_defined": false,
  11.         "index": 0
  12.       },
  13.       {
  14.         "name": "hPrevInstance",
  15.         "location": "stack offset: 0x60",
  16.         "width_bytes": 4,
  17.         "type": "HINSTANCE",
  18.         "is_user_defined": false,
  19.         "index": 1
  20.       },
  21.       {
  22.         "name": "lpCmdLine",
  23.         "location": "stack offset: 0x64",
  24.         "width_bytes": 4,
  25.         "type": "LPSTR",
  26.         "is_user_defined": false,
  27.         "index": 2
  28.       },
  29.       {
  30.         "name": "nShowCmd",
  31.         "location": "stack offset: 0x68",
  32.         "width_bytes": 4,
  33.         "type": "int",
  34.         "is_user_defined": false,
  35.         "index": 3
  36.       },
  37.       {
  38.         "name": "Window",
  39.         "location": "register: r8",
  40.         "width_bytes": 4,
  41.         "type": "HWND",
  42.         "is_user_defined": false,
  43.         "index": 4
  44.       },
  45.       {
  46.         "name": "v5",
  47.         "location": "register: zf",
  48.         "width_bytes": 4,
  49.         "type": "HWND",
  50.         "is_user_defined": false,
  51.         "index": 5
  52.       },
  53.       {
  54.         "name": "Msg",
  55.         "location": "stack offset: 0x38",
  56.         "width_bytes": 28,
  57.         "type": "tagMSG",
  58.         "is_user_defined": true,
  59.         "index": 7
  60.       },
  61.       {
  62.         "name": "hInstancea",
  63.         "location": "stack offset: 0x5C",
  64.         "width_bytes": 4,
  65.         "type": "HACCEL",
  66.         "is_user_defined": true,
  67.         "index": 8
  68.       }
  69.     ],
  70.     "function_address": "0x401000",
  71.     "found_variables_count": 8
  72.   },
  73.   "timestamp": 39635265
  74. }
复制代码
set_struct_member_name

接收结构体名称、偏移量和新成员名称参数,校验结构体名称非空、偏移量为非负整数且新名称非空后,调用服务端 Other 类的 SetStructMemberName 接口,修改指定结构体中指定偏移量的成员名称。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     info_page.switch_pseudocode_to("0x401000")
  7.     print(info_page.set_function_var_name("0x401000","4","new_var"))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "function_address": "0x401000",
  5.     "var_index": 4,
  6.     "new_name": "new_var",
  7.     "message": "Local variable renamed successfully"
  8.   },
  9.   "timestamp": 39949484
  10. }
复制代码
get_current_select

调用服务端 Other 类的 GetCurrentSelect 接口,获取当前选中区域的相关信息。
  1. from IDAMoles import *
  2. if __name__ == '__main__':
  3.     config=Config(address="127.0.0.1",port=8000)
  4.     client = BaseHttpClient(config)
  5.     info_page = Other(config)
  6.     print(info_page.get_struct_member_name("_GUID", 0))
  7.     print(info_page.get_struct_member_name("_GUID", 1))
复制代码
输出JSON格式:
  1. {
  2.   "status": "success",
  3.   "result": {
  4.     "member_info": {
  5.       "struct_name": "_GUID",
  6.       "member_name": "Data1",
  7.       "offset_bits": 0,
  8.       "offset_bytes": 0,
  9.       "size_bits": 32,
  10.       "size_bytes": 4,
  11.       "type": "unsigned int",
  12.       "effective_alignment_bytes": 1,
  13.       "field_alignment_shift": 255,
  14.       "flags": {
  15.         "is_bitfield": false,
  16.         "is_zero_length_bitfield": false,
  17.         "is_unaligned": false,
  18.         "is_baseclass_member": false,
  19.         "is_virtual_baseclass_member": false,
  20.         "is_vftable_member": false,
  21.         "is_method_member": false,
  22.         "is_gap": false,
  23.         "is_anonymous": false
  24.       }
  25.     }
  26.   },
  27.   "timestamp": 40099000
  28. }
复制代码
项目地址

https://gitee.com/lyshark/IDA-Moles
https://github.com/lyshark/IDA-Moles

来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

相关推荐

您需要登录后才可以回帖 登录 | 立即注册