Spaces:
Sleeping
Sleeping
Commit ·
53bcd0f
1
Parent(s): f154634
Add examples, use code widgets.
Browse files- Dockerfile +1 -1
- examples/ls +0 -0
- examples/true +0 -0
- main.py +11 -3
Dockerfile
CHANGED
|
@@ -27,7 +27,7 @@ RUN unzip ghidrathon/Ghidrathon-v4.0.0.zip -d /ghidra/Ghidra/Extensions
|
|
| 27 |
|
| 28 |
WORKDIR /
|
| 29 |
|
| 30 |
-
RUN git clone -b main https://github.com/edmcman/DIRTY # 09-
|
| 31 |
#ADD ./DIRTY /DIRTY
|
| 32 |
|
| 33 |
RUN --mount=type=cache,target=/root/.cache pip install --upgrade -r /DIRTY/requirements.txt
|
|
|
|
| 27 |
|
| 28 |
WORKDIR /
|
| 29 |
|
| 30 |
+
RUN git clone -b main https://github.com/edmcman/DIRTY # 09-21-24
|
| 31 |
#ADD ./DIRTY /DIRTY
|
| 32 |
|
| 33 |
RUN --mount=type=cache,target=/root/.cache pip install --upgrade -r /DIRTY/requirements.txt
|
examples/ls
ADDED
|
Binary file (138 kB). View file
|
|
|
examples/true
ADDED
|
Binary file (26.9 kB). View file
|
|
|
main.py
CHANGED
|
@@ -58,13 +58,15 @@ with gr.Blocks() as demo:
|
|
| 58 |
)
|
| 59 |
|
| 60 |
with gr.Row(visible=True) as result:
|
| 61 |
-
disassembly = gr.
|
| 62 |
label="Disassembly", value="Please wait...", lines=20
|
| 63 |
)
|
| 64 |
-
original_decompile = gr.
|
|
|
|
| 65 |
label="Original Decompilation", value="Please wait...", lines=20
|
| 66 |
)
|
| 67 |
-
decompile = gr.
|
|
|
|
| 68 |
label="Renamed and retyped Decompilation",
|
| 69 |
value="Please wait...",
|
| 70 |
lines=20,
|
|
@@ -77,6 +79,12 @@ with gr.Blocks() as demo:
|
|
| 77 |
# interpret_button = gr.Button("Interpret (very slow)")
|
| 78 |
# interpretation = gr.components.Interpretation(disassembly)
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
def file_change_fn(file):
|
| 81 |
|
| 82 |
if file is None:
|
|
|
|
| 58 |
)
|
| 59 |
|
| 60 |
with gr.Row(visible=True) as result:
|
| 61 |
+
disassembly = gr.Code(
|
| 62 |
label="Disassembly", value="Please wait...", lines=20
|
| 63 |
)
|
| 64 |
+
original_decompile = gr.Code(
|
| 65 |
+
language="c",
|
| 66 |
label="Original Decompilation", value="Please wait...", lines=20
|
| 67 |
)
|
| 68 |
+
decompile = gr.Code(
|
| 69 |
+
language="c",
|
| 70 |
label="Renamed and retyped Decompilation",
|
| 71 |
value="Please wait...",
|
| 72 |
lines=20,
|
|
|
|
| 79 |
# interpret_button = gr.Button("Interpret (very slow)")
|
| 80 |
# interpretation = gr.components.Interpretation(disassembly)
|
| 81 |
|
| 82 |
+
example_widget = gr.Examples(
|
| 83 |
+
examples=[f.path for f in os.scandir(os.path.join(os.path.dirname(__file__), "examples"))],
|
| 84 |
+
inputs=file_widget,
|
| 85 |
+
outputs=[state, disassembly, original_decompile, decompile, model_output],
|
| 86 |
+
)
|
| 87 |
+
|
| 88 |
def file_change_fn(file):
|
| 89 |
|
| 90 |
if file is None:
|