Spaces:
Sleeping
Sleeping
Commit
·
523d28e
1
Parent(s):
24b4dd3
Let's go
Browse files
main.py
CHANGED
@@ -133,6 +133,8 @@ def predict(target_bytes, source, compiler, flags, disasm_arch, disasm_options):
|
|
133 |
hexdump(compiled_bytes, result="return"),
|
134 |
hexdump(target_bytes, result="return"),
|
135 |
editdistance.eval(compiled_bytes, target_bytes),
|
|
|
|
|
136 |
compile_output,
|
137 |
compiled_disassembly,
|
138 |
compiled_relocs,
|
@@ -143,6 +145,8 @@ def predict(target_bytes, source, compiler, flags, disasm_arch, disasm_options):
|
|
143 |
"Compilation failed",
|
144 |
hexdump(target_bytes, result="return"),
|
145 |
-1,
|
|
|
|
|
146 |
compile_output,
|
147 |
compiled_disassembly,
|
148 |
compiled_relocs,
|
@@ -174,6 +178,8 @@ def run():
|
|
174 |
gr.Textbox(label="Compiled bytes"),
|
175 |
gr.Textbox(label="Target bytes"),
|
176 |
gr.Number(label="Edit distance (lower is better)"),
|
|
|
|
|
177 |
gr.Textbox(label="Compiler Output"),
|
178 |
gr.Textbox(label="Compiled Disassembly"),
|
179 |
gr.JSON(label="Compiled relocations", open=True),
|
|
|
133 |
hexdump(compiled_bytes, result="return"),
|
134 |
hexdump(target_bytes, result="return"),
|
135 |
editdistance.eval(compiled_bytes, target_bytes),
|
136 |
+
reloc_edit_distance,
|
137 |
+
str(reloc_operations),
|
138 |
compile_output,
|
139 |
compiled_disassembly,
|
140 |
compiled_relocs,
|
|
|
145 |
"Compilation failed",
|
146 |
hexdump(target_bytes, result="return"),
|
147 |
-1,
|
148 |
+
None,
|
149 |
+
None,
|
150 |
compile_output,
|
151 |
compiled_disassembly,
|
152 |
compiled_relocs,
|
|
|
178 |
gr.Textbox(label="Compiled bytes"),
|
179 |
gr.Textbox(label="Target bytes"),
|
180 |
gr.Number(label="Edit distance (lower is better)"),
|
181 |
+
gr.Number(label="Edit distance (ignoring relocs; lower is better)"),
|
182 |
+
gr.Textbox(label="Edit description (ignoring relocs)"),
|
183 |
gr.Textbox(label="Compiler Output"),
|
184 |
gr.Textbox(label="Compiled Disassembly"),
|
185 |
gr.JSON(label="Compiled relocations", open=True),
|