-
Notifications
You must be signed in to change notification settings - Fork 3
/
get_function_comments.idc
69 lines (55 loc) · 1.39 KB
/
get_function_comments.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
60
61
62
63
64
65
66
67
68
69
//
// Dump specific comment script
// by tomsons26
//
// Search comment strings, for example from a imported symbol table, where the line numbers and source files are commented
//
#include <idc.idc>
static main()
{
auto Path, Handle;
auto Comment;
// Path = AskFile (1, "*.txt", "Text file to save output to");
// if (Path == "") {
// return;
// }
// Handle = fopen(Path, "w");
// if (!Handle) {
// return;
// }
Comment = AskStr("", "Enter String to Search for:\n");
if (Comment != 0)
{
//Print_Comments(Comment, Handle);
Print_Comments(Comment);
}
}
//static Print_Comments(Comment, handle)
static Print_Comments(comment)
{
auto Address, Function_Comment;
auto Function_Name, Demangled;
Message("//Start of list.\n//\n//\n");
for (Address = 0; Address != BADADDR; Address = NextFunction(Address))
{
Function_Comment = GetFunctionCmt(Address, 1);
if (Function_Comment != "")
{
if (strstr(Function_Comment, comment) != -1)
{
//print comment
//fprintf(handle,"//comment %s\n", Function_Comment);
//Message("//comment %s\n", Function_Comment);
Function_Name = GetFunctionName(Address);
Demangled = Demangle(Function_Name, INF_LONG_DN);
if (Demangled == "")
{
Demangled = Function_Name;
}
//fprintf(handle, "%s\n", Demangled);
Message("%s\n", Demangled);
}
}
}
Message("// End of list.\n");
}