-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathunlinker_helper.py
34 lines (25 loc) · 955 Bytes
/
unlinker_helper.py
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
import idaapi
#Unlinker Helper script
#by tomsons26
#Prints basic info needed for the Unlinker INI's to IDA Output Window
#PROBABLY_TODO
#Make it segment sensetive,
#SegName(ea) returns
#if .text use function format,
#if .rdata use rdata format,
#if .data use data format.
#Get current cursor location
cursor = ScreenEA()
#Get function name at current cursor location
function_name = GetFunctionName(cursor);
#Get current Function start address
function_address = GetFchunkAttr(cursor,FUNCATTR_START);
#Get current function file address
file_address = idaapi.get_fileregion_offset(function_address);
#Get current function size
function_size = GetFchunkAttr(cursor,FUNCATTR_END)-GetFchunkAttr(cursor,FUNCATTR_START);
#Print gathered info to output
Message("[%s]\n" % function_name);
Message("Address=%Xh\n" % function_address);
Message("FileAddress=%Xh\n" % file_address);
Message("Size=%Xh\n" % function_size);