-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathida_export.idc
59 lines (50 loc) · 1.32 KB
/
ida_export.idc
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <idc.idc>
static FuncDump(f, start)
{
auto ea, str, mangled_str, count, ref;
auto end;
auto teststr;
ea = start;
fprintf(f, "mangled_name;unmangled_name;address\n");
while( ea != BADADDR )
{
mangled_str = GetFunctionName(ea);
if( mangled_str != 0 )
{
str = demangle_name(mangled_str, get_inf_attr(INF_LONG_DN));
if(str == 0)
{
str = mangled_str;
}
end = FindFuncEnd(ea);
count = 0;
ref = RfirstB(ea);
while(ref != BADADDR)
{
count = count + 1;
ref = RnextB(ea, ref);
}
teststr = sprintf("sub_%X", ea);
if( teststr != str )
{
fprintf(f, "%s; %s; 0x%X\n", mangled_str, str, ea);
}
//Message("%s, 0x%d, 0x%x, 0x%x, 0x%x, %d\n", str, count, ea, end, end-ea, end-ea );
}
ea = NextFunction(ea);
}
}
static main()
{
auto current = GetInputFile();
current = AskFile(-1, current, "Where should I write the symbols to?");
if(current == 0)
{
return -1;
}
auto f = fopen(current, "wb");
Message("FuncDump: Start\n");
FuncDump(f,0x00000);
fclose(f);
Message("FuncDump: Done\n");
}