Spaces:
Sleeping
Sleeping
Edward J. Schwartz
commited on
Commit
·
0ed5800
1
Parent(s):
76d23b8
Disassembly
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ with gr.Blocks() as demo:
|
|
67 |
gr.Markdown(
|
68 |
"""
|
69 |
# Function/Method Detector
|
70 |
-
First, upload a binary.
|
71 |
"""
|
72 |
)
|
73 |
|
@@ -76,6 +76,7 @@ with gr.Blocks() as demo:
|
|
76 |
with gr.Column(visible=False) as col:
|
77 |
#output = gr.Textbox("Output")
|
78 |
fun_dropdown = gr.Dropdown(label="Select a function", choices=["Woohoo!"], interactive=True)
|
|
|
79 |
|
80 |
def file_change_fn(file):
|
81 |
|
@@ -93,8 +94,12 @@ with gr.Blocks() as demo:
|
|
93 |
fun_dropdown: gr.Dropdown.update(choices=addrs, value=addrs[0]),
|
94 |
all_dis_state: fun_data
|
95 |
}
|
96 |
-
|
|
|
|
|
97 |
|
98 |
file_widget.change(file_change_fn, file_widget, [col, fun_dropdown, all_dis_state])
|
99 |
|
|
|
|
|
100 |
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|
|
|
67 |
gr.Markdown(
|
68 |
"""
|
69 |
# Function/Method Detector
|
70 |
+
First, upload a binary. Then, select a function from the dropdown. The function's disassembly will be displayed below.
|
71 |
"""
|
72 |
)
|
73 |
|
|
|
76 |
with gr.Column(visible=False) as col:
|
77 |
#output = gr.Textbox("Output")
|
78 |
fun_dropdown = gr.Dropdown(label="Select a function", choices=["Woohoo!"], interactive=True)
|
79 |
+
disassembly = gr.Textbox("Disassembly", lines=20, readonly=True, visible=True)
|
80 |
|
81 |
def file_change_fn(file):
|
82 |
|
|
|
94 |
fun_dropdown: gr.Dropdown.update(choices=addrs, value=addrs[0]),
|
95 |
all_dis_state: fun_data
|
96 |
}
|
97 |
+
|
98 |
+
def function_change_fn(fun, fun_data):
|
99 |
+
return {disassembly: gr.Textbox.update(value=fun_data[int(fun, 16)])}
|
100 |
|
101 |
file_widget.change(file_change_fn, file_widget, [col, fun_dropdown, all_dis_state])
|
102 |
|
103 |
+
fun_dropdown.change(function_change_fn, [fun_dropdown, all_dis_state], [disassembly])
|
104 |
+
|
105 |
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|