2007-10-20 09:03:51 +02:00
|
|
|
#
|
|
|
|
# Reference Lister
|
|
|
|
#
|
|
|
|
# List all functions and all references to them in the current section.
|
|
|
|
#
|
|
|
|
# Implemented using direct IDA Plugin API calls
|
|
|
|
#
|
|
|
|
from idaapi import *
|
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
def main():
|
|
|
|
# Get current ea
|
|
|
|
ea = get_screen_ea()
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
# Get segment class
|
|
|
|
seg = getseg(ea)
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
# Loop from segment start to end
|
|
|
|
func = get_next_func(seg.startEA)
|
|
|
|
seg_end = seg.endEA
|
|
|
|
while func is not None and func.startEA < seg_end:
|
|
|
|
funcea = func.startEA
|
|
|
|
print "Function %s at 0x%x" % (GetFunctionName(funcea), funcea)
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
ref = get_first_cref_to(funcea)
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
while ref != BADADDR:
|
|
|
|
print " called from %s(0x%x)" % (get_func_name(ref), ref)
|
|
|
|
ref = get_next_cref_to(funcea, ref)
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
func = get_next_func(funcea)
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2011-04-18 18:07:00 +02:00
|
|
|
|
|
|
|
main()
|