IDA Pro入门教程:如何生成sig文件

本文介绍如何生成sig文件。

sig

识别静态链接且被去除符号的库函数

IDA会用签名匹配IDA数据库中的函数,如果匹配上会自动重命名函数

注意:只有使用 IDA 哑名的函数才能被自动重命名。换言之,如果你已经对一个函数进行了重命名,而后这个函数与一个签名相匹配,那么,这时 IDA 不会再对这个函数进行重命名。因此,在分析过程中,你应该尽可能早地应用签名

步骤

1、获取要创建签名文件的静态库文件(.lib)
2、利用FLAIR解析器为该库创建一个模式文件(.pat)
3、运行sigmake.exe处理创建的模式文件,生成一个签名文件(.sig)
4、复制签名文件到/sig目录,Shift+F5应用新签名文件

静态库

使用VS创建工程,添加代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//lib库函数声明
int sum(int a, int b);

//lib库函数实现
#include "stdafx.h"
#include "static.h"
#include "stdio.h"
#include <windows.h>

int sum(int x, int y)
{
int s;
s = (x + y)*1;

CloseHandle(NULL);
return s;
}

//lib库函数调用
#include "stdafx.h"
#include "static.h"

int _tmain(int argc, _TCHAR* argv[])
{
int num = 0;
num = sum(1,2);
printf("sum = %d\n", num);

return 0;
}

编译为静态库。

生成

将IDA Pro目录下的SDK77.zip解压并再次解压flair77.zip

创建模式文件

1
2
pcf.exe test.lib test.pat
C:\Users\Administrator\Documents\test\Debug\test.lib: skipped 0, total 6

创建签名文件

1
sigmake.exe test.pat test.sig

IDA Pro入门教程:如何生成sig文件
https://feater.top/idapro/how-to-generate-sig-file/
作者
JackeyLea
发布于
2024年3月14日
许可协议