Delete app.py
Browse files
app.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import tempfile
|
| 3 |
-
from inference.analyze import analyze
|
| 4 |
-
from yara.generate import generate_yara
|
| 5 |
-
|
| 6 |
-
def analyze_file(file):
|
| 7 |
-
if file is None:
|
| 8 |
-
return None, None
|
| 9 |
-
|
| 10 |
-
path = file.name
|
| 11 |
-
prompt = f"Suspicious file uploaded: {path}"
|
| 12 |
-
|
| 13 |
-
result = analyze(prompt)
|
| 14 |
-
yara = generate_yara(result)
|
| 15 |
-
|
| 16 |
-
return result, yara
|
| 17 |
-
|
| 18 |
-
with gr.Blocks() as demo:
|
| 19 |
-
gr.Markdown("# 🛡️ MCMA – Malware Static Analyzer")
|
| 20 |
-
|
| 21 |
-
file = gr.File(label="Drag & drop malware sample (static analysis only)")
|
| 22 |
-
json_out = gr.JSON(label="Analysis Result")
|
| 23 |
-
|
| 24 |
-
# CHANGED: language="yara" -> language="c"
|
| 25 |
-
yara_out = gr.Code(label="Generated YARA Rule", language="c")
|
| 26 |
-
|
| 27 |
-
btn = gr.Button("Analyze")
|
| 28 |
-
btn.click(analyze_file, inputs=file, outputs=[json_out, yara_out])
|
| 29 |
-
|
| 30 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|