Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,26 @@
|
|
1 |
import streamlit as st
|
2 |
-
from model_utils import load_model,
|
3 |
from binary_utils import binary_to_text, text_to_binary
|
|
|
4 |
|
5 |
-
st.title("
|
6 |
|
7 |
-
binary_input = st.text_area("Enter Binary
|
8 |
|
9 |
if binary_input:
|
10 |
-
st.subheader("π
|
11 |
original_text = binary_to_text(binary_input)
|
12 |
-
st.code(original_text
|
13 |
|
14 |
-
if st.button("
|
15 |
-
st.
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
-
st.subheader("
|
20 |
-
st.code(
|
21 |
|
22 |
-
st.subheader("π¦
|
23 |
-
|
24 |
-
st.code(
|
|
|
1 |
import streamlit as st
|
2 |
+
from model_utils import load_model, generate_deceptive_code
|
3 |
from binary_utils import binary_to_text, text_to_binary
|
4 |
+
from deception_engine import inject_deception
|
5 |
|
6 |
+
st.title("π‘οΈ Deceptive SoC Clone Generator (GEN AI)")
|
7 |
|
8 |
+
binary_input = st.text_area("π₯ Enter Binary from Primary SoC", height=150)
|
9 |
|
10 |
if binary_input:
|
11 |
+
st.subheader("π Step 1: Decode Original Binary")
|
12 |
original_text = binary_to_text(binary_input)
|
13 |
+
st.code(original_text)
|
14 |
|
15 |
+
if st.button("π§ Generate Deceptive Clone"):
|
16 |
+
with st.spinner("Loading model and crafting deception..."):
|
17 |
+
tokenizer, model = load_model()
|
18 |
+
raw_generated = generate_deceptive_code(tokenizer, model, original_text)
|
19 |
+
deceptive_code = inject_deception(raw_generated)
|
20 |
|
21 |
+
st.subheader("π Step 2: Deceptive Code Output")
|
22 |
+
st.code(deceptive_code, language='c')
|
23 |
|
24 |
+
st.subheader("π¦ Step 3: Reconvert to Binary (for Secondary SoC)")
|
25 |
+
deceptive_binary = text_to_binary(deceptive_code)
|
26 |
+
st.code(deceptive_binary)
|