当前位置:网站首页>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专业逆向代码分析的平台,实现联动。
边栏推荐
- [BJDCTF2020] EasySearch
- 第一次性能测试实践,有“亿”点点紧张
- Qixi Festival code confession
- University Physics---Particle Kinematics
- token, jwt, oauth2, session parsing
- [Nine Lectures on Backpacks - 01 Backpack Problems]
- Mini Program_Dynamic setting of tabBar theme skin
- [Geek Challenge 2019]FinalSQL
- creo怎么测量点到面的距离
- [SWPU2019]Web1
猜你喜欢
随机推荐
Cron(Crontab)--use/tutorial/example
No regrets, the appium automation environment is perfectly built
Talk about 20 common problems in data governance
Day14 jenkins deployment
二叉树基本性质+oj题解析
[informix] Resolving startup errors and solutions
bytebuffer 使用demo
1007 Climb Stairs (贪心 | C思维)
Mysql的redo log详解
Machine Learning Overview
Shell(4)条件控制语句
bytebuffer internal structure
LeetCode:1403. 非递增顺序的最小子序列【贪心】
[极客大挑战 2019]FinalSQL
[8.2] Code Source - [Currency System] [Coins] [New Year's Questions (Data Enhanced Edition)] [Three Stages]
【软考 系统架构设计师】软件架构设计③ 特定领域软件架构(DSSA)
flink reads mongodb data source
C+ +核心编程
Day14 jenkins部署
dedecms dream weaving tag tag does not support capital letters fix








