Spaces:
Running
Running
Commit
·
ec41d0e
1
Parent(s):
2696a55
number of vars
Browse files- main.py +3 -3
- scripts/dump_functions.py +1 -1
main.py
CHANGED
@@ -125,11 +125,11 @@ with gr.Blocks() as demo:
|
|
125 |
# print(fun_data)
|
126 |
|
127 |
addrs = [
|
128 |
-
(f"{name} ({hex(int(addr))})", int(addr))
|
129 |
-
for addr, (name, cf) in fun_data.items()
|
130 |
]
|
131 |
|
132 |
-
cfs = {name: cf for (name, cf) in fun_data.values()}
|
133 |
except Exception as e:
|
134 |
raise gr.Error(f"Unable to analyze binary with Ghidra: {e}")
|
135 |
|
|
|
125 |
# print(fun_data)
|
126 |
|
127 |
addrs = [
|
128 |
+
(f"{name} ({hex(int(addr))}; {numvars} vars)", int(addr))
|
129 |
+
for addr, (name, cf, numvars) in fun_data.items()
|
130 |
]
|
131 |
|
132 |
+
cfs = {name: cf for (name, cf, _numvars) in fun_data.values()}
|
133 |
except Exception as e:
|
134 |
raise gr.Error(f"Unable to analyze binary with Ghidra: {e}")
|
135 |
|
scripts/dump_functions.py
CHANGED
@@ -30,7 +30,7 @@ def dump_functions_to_json():
|
|
30 |
|
31 |
# Add function name and address to the dictionary
|
32 |
if example.is_valid_example:
|
33 |
-
functions_dict[func_address] = (func_name, cf.to_json())
|
34 |
|
35 |
# Convert the dictionary to a JSON object
|
36 |
json_data = json.dumps(functions_dict, indent=4)
|
|
|
30 |
|
31 |
# Add function name and address to the dictionary
|
32 |
if example.is_valid_example:
|
33 |
+
functions_dict[func_address] = (func_name, cf.to_json(), len(example.source))
|
34 |
|
35 |
# Convert the dictionary to a JSON object
|
36 |
json_data = json.dumps(functions_dict, indent=4)
|