# show exports
#
# Open a new tab with a list of all exports, can be slow for extremely large files, modify to dump an external html for a perf improvement
import time
def genRow(sym, exportType):
return f"
| {hex(sym.address)} | {sym.short_name} | {exportType} |
\n"
begin = time.time()
# [ Offset, Symbol, Type]
html = "Exports
\n\n"
html += "| Offset | Name | Type |
\n"
html += f"| {hex(bv.entry_point)} | {bv.entry_function.name} | Entry |
\n"
for sym in bv.get_symbols_of_type(SymbolType.FunctionSymbol):
if sym.binding == SymbolBinding.GlobalBinding:
html += genRow(sym, "Export Function")
for sym in bv.get_symbols_of_type(SymbolType.DataSymbol):
if sym.binding == SymbolBinding.GlobalBinding:
html += genRow(sym, "Export Data Var")
html += "
"
lines = len(html.split("\n"))
generated=time.time()
log_info(f"Lines: {lines}")
log_info(f"Time: {generated - begin}")
bv.show_html_report("Exports", html)
render = time.time()
log_info(f"Render: {render - generated }")