当前位置:网站首页>Dephi逆向工具Dede导出函数名MAP导入到IDA中
Dephi逆向工具Dede导出函数名MAP导入到IDA中
2022-08-05 04:49:00 【向往生】
1.背景
在逆向Dephi程序时,会出现Dede软件可以看到函数的函数名,但是IDA逆向的时候看不到,为了解决这个问题,可以通过以下的方法来实现:

2.基础知识
IDA因为没有PDB文件,无法还原函数的原始名称,通过逆向工程师的汇编代码识别,可以给函数手工重新命名,也可以使用IDC脚本语言来给特定的地址命名:
MakeName(0x006E624C, "TSingleForm.ComboBox1Change");基于这个原理,我们查找一下DEde如何生成这样的“地址:函数”的对应表。
3.实操
1.从Dede中导出地址函数表

找到文件夹里的events.txt,这就是包含函数地址和函数名的文件。

2.运行python脚本把events.txt转化为IDC脚本;
以下的脚本打开脚本相同目录下的events.txt,用.split()方法把地址和函数名装入list[0]和list[1]中,无函数名的过滤掉。
import os
try:
import chardet
except:
os.system('pip install chardet')
import chardet
def check_charset(file_path):
import chardet
with open(file_path, "rb") as f:
data = f.read(4)
charset = chardet.detect(data)['encoding']
return charset
def map2idc(in_file, out_file):
with open(out_file, 'w') as fout:
fout.write('#include <idc.idc>\n')
fout.write('static main()\n{\n')
with open(in_file,encoding=check_charset(in_file)) as fin:
for line in fin:
list = line.split()
if len(list) == 2 and len(str(list[1])) == 8 and str(list[1]).isalnum():
if(list[1][-4:]!=list[0][-4:]): #函数名==地址的,不要
fout.write('\tMakeName(0x%s, "%s");\n' % (list[1], list[0]))
fout.write('}\n')
def main():
return map2idc("./events.txt","./ida.idc")把上面的python复制到.py文件里,python脚本和events.txt放在同一个目录下,运行python脚本,就会生成ida.idc文件。一个简单的idc脚本如下:
#include <idc.idc>
static main()
{
MakeName(0x0040178C, "TObject.System.GetSpace(Integer):TBlock;");
}3.运行idc脚本,重命名函数
打开Ida,File-->Script file,选择刚才生成的ida.idc文件,即可批量重命名函数了。

这样,你的dehpi就有函数名了。
4.总结
通过这个脚本,我们就可以把专业dephi程序分析的结果,转移到IDA专业逆向代码分析的平台,实现联动。
边栏推荐
猜你喜欢

Use IDEA to connect to TDengine server

不看后悔,appium自动化环境完美搭建

浅析主流跨端技术方案

Homework 8.4 Interprocess Communication Pipes and Signals

App rapid development and construction experience: the importance of small programs + custom plug-ins

【8.4】代码源 - 【数学】【历法】【删库】【不朴素的数列(Bonus)】

The production method of the powered small sailboat is simple, the production method of the electric small sailboat

四位数显表头设计

Mysql的undo log详解

What is ASEMI photovoltaic diode, the role of photovoltaic diode
随机推荐
JeeSite新建报表
[SWPU2019]Web1
程序开发的一些常规套路(一)
为什么刚考完PMP,就开始准备软考了?
动力小帆船制作方法简单,电动小帆船制作方法
Haproxy搭建Web群集
8.04 Day35-----MVC three-tier architecture
【informix】解决启动报错大全,以及解决办法
[Surveying] Quick Summary - Excerpt from Gaoshu Gang
8.04 Day35-----MVC三层架构
【8.2】代码源 - 【货币系统】【硬币】【新年的问题(数据加强版)】【三段式】
Four-digit display header design
【测量学】速成汇总——摘录高数帮
虚证、实证如何鉴别?
The first performance test practice, there are "100 million" a little nervous
说说数据治理中常见的20个问题
Learning and finishing of probability theory 8: Geometric and hypergeometric distributions
Cron(Crontab)--use/tutorial/example
【转】什么是etcd
mysql数据库表什么字段类型的存储长度最大?