Spaces:
Running
Running
Commit
·
80dd465
1
Parent(s):
5ed5cfe
dev
Browse files
main.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import shutil
|
3 |
import subprocess
|
4 |
import tempfile
|
|
|
5 |
import sys
|
6 |
|
7 |
def new_binary(file):
|
@@ -11,7 +12,7 @@ def new_binary(file):
|
|
11 |
|
12 |
# python3 generate.py --ghidra PATH_TO_GHIDRA_ANALYZEHEADLESS -t NUM_THREADS -n [NUM_FILES|None] -b BINARIES_DIR -o OUTPUT_DIR
|
13 |
print("Running DIRTY-Ghidra...", file=sys.stderr)
|
14 |
-
output = subprocess.check_output(f"python /DIRTY/dataset-gen-ghidra/generate.py --ghidra /ghidra/support/analyzeHeadless -t 1 -b {TEMP_DIR} -o {OUTPUT_DIR}", shell=True)
|
15 |
print(output, file=sys.stderr)
|
16 |
|
17 |
with gr.Blocks() as demo:
|
@@ -52,5 +53,8 @@ with gr.Blocks() as demo:
|
|
52 |
|
53 |
file_widget.change(file_change_fn, file_widget)
|
54 |
|
|
|
|
|
|
|
55 |
demo.queue()
|
56 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
2 |
import shutil
|
3 |
import subprocess
|
4 |
import tempfile
|
5 |
+
import os
|
6 |
import sys
|
7 |
|
8 |
def new_binary(file):
|
|
|
12 |
|
13 |
# python3 generate.py --ghidra PATH_TO_GHIDRA_ANALYZEHEADLESS -t NUM_THREADS -n [NUM_FILES|None] -b BINARIES_DIR -o OUTPUT_DIR
|
14 |
print("Running DIRTY-Ghidra...", file=sys.stderr)
|
15 |
+
output = subprocess.check_output(f"python /DIRTY/dataset-gen-ghidra/generate.py --ghidra /ghidra/support/analyzeHeadless -t 1 -b {TEMP_DIR} -o {OUTPUT_DIR} 2>&1", shell=True)
|
16 |
print(output, file=sys.stderr)
|
17 |
|
18 |
with gr.Blocks() as demo:
|
|
|
53 |
|
54 |
file_widget.change(file_change_fn, file_widget)
|
55 |
|
56 |
+
# spaces only shows stderr..
|
57 |
+
os.dup2(sys.stdout.fileno(), sys.stderr.fileno())
|
58 |
+
|
59 |
demo.queue()
|
60 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|