MCPcopy Create free account
hub / github.com/JHUAPL/CodeCut / getFunctionsInRange

Function getFunctionsInRange

codecut-gui/ghidra_scripts/std.py:117–138  ·  view source on GitHub ↗
(start, end, externFunc, inRangeFunc)

Source from the content-addressed store, hash-verified

115# Get each in range funciton entry point & Functions called by in range functions
116# Get each in range funciton entry point & Functions called by in range functions
117def getFunctionsInRange(start, end, externFunc, inRangeFunc):
118 fm = currentProgram.getFunctionManager()
119 programsymbols = fm.getFunctions(True)
120 for symbol in programsymbols:
121 item = int(symbol.getEntryPoint().toString(), 16)
122
123 if item in range(start, end):
124 funcName = fm.getFunctionAt(getAddress(item))
125
126 if funcName.getName() not in std:
127 print("Found function %s in range" % funcName.getName())
128 inRangeFunc.append(funcName.getEntryPoint().toString())
129 func = currentProgram.getFunctionManager().getFunctionAt(funcName.getEntryPoint())
130
131 func_list = funcName.getCalledFunctions(getMonitor())
132 print(func_list)
133
134 for item in func_list:
135 print(item)
136 #item = item.replace(",", "")
137 if item.getEntryPoint() not in inRangeFunc and item.getName() not in std:
138 externFunc.append(item.getName())
139
140
141# Wrapper function to write to file

Callers

nothing calls this directly

Calls 3

getAddressFunction · 0.85
toStringMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected