Analyzes all of the (source) functions for a single compiled file.
()
| 6 | import traceback |
| 7 | |
| 8 | def analyzeFile(): |
| 9 | """Analyzes all of the (source) functions for a single compiled file.""" |
| 10 | disas = getDisas() |
| 11 | logger.info("Started the Script") |
| 12 | contexts = [] |
| 13 | # check for windows binary |
| 14 | if disas.inputFile().endswith(".obj"): |
| 15 | logger.debug("Activating Windows mode") |
| 16 | setWindowsMode() |
| 17 | # build the list of exported (non-static) functions |
| 18 | exported = disas.exports() |
| 19 | for segment_idx in range(disas.numSegments()): |
| 20 | if ".text" not in disas.segmentName(segment_idx): |
| 21 | continue |
| 22 | for function_ea in disas.segmentFunctions(segment_idx): |
| 23 | src_ctx = disas.analyzeFunction(function_ea, True) |
| 24 | # check if static or not |
| 25 | if src_ctx.name not in exported: |
| 26 | src_ctx.markStatic() |
| 27 | contexts.append(src_ctx) |
| 28 | functionsToFile(disas.inputFile(), contexts) |
| 29 | logger.info("Finished Successfully") |
| 30 | |
| 31 | |
| 32 | # Create a basic logger for the init phase |
no test coverage detected