Spaces:
Sleeping
Sleeping
Edward J. Schwartz
commited on
Commit
·
f3fdb65
1
Parent(s):
cecf2b8
Block stuff
Browse files
app.py
CHANGED
@@ -60,5 +60,36 @@ def get_funs(f):
|
|
60 |
funs = get_all_dis(f.name)
|
61 |
return "\n".join(("%#x" % addr) for addr in funs.keys())
|
62 |
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
funs = get_all_dis(f.name)
|
61 |
return "\n".join(("%#x" % addr) for addr in funs.keys())
|
62 |
|
63 |
+
with gr.Blocks() as demo:
|
64 |
+
|
65 |
+
all_dis_state = gr.State()
|
66 |
+
|
67 |
+
gr.Markdown(
|
68 |
+
"""
|
69 |
+
# Function/Method Detector
|
70 |
+
First, upload a binary.
|
71 |
+
"""
|
72 |
+
)
|
73 |
+
|
74 |
+
file_widget = gr.File(label="Binary file")
|
75 |
+
|
76 |
+
def file_change_fn(file):
|
77 |
+
|
78 |
+
if file is None:
|
79 |
+
return {col: gr.update(visible=False),
|
80 |
+
all_dis_state: None}
|
81 |
+
else:
|
82 |
+
|
83 |
+
fun_data = get_funs(file)
|
84 |
+
|
85 |
+
return {col: gr.update(visible=True),
|
86 |
+
fun_dropdown: gr.update(choices=fun_data.keys()),
|
87 |
+
all_dis_state: fun_data}
|
88 |
+
|
89 |
+
with gr.Column(visible=False) as col:
|
90 |
+
#output = gr.Textbox("Output")
|
91 |
+
fun_dropdown = gr.Dropdown(label="Functions", choices=[""])
|
92 |
+
|
93 |
+
file_widget.change(file_change_fn, file_widget, [col, fun_dropdown, all_dis_state])
|
94 |
+
|
95 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|