AbdulMajeed776 commited on
Commit
a58ecbb
Β·
verified Β·
1 Parent(s): 6db303b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -1,24 +1,26 @@
1
  import streamlit as st
2
- from model_utils import load_model, generate_code
3
  from binary_utils import binary_to_text, text_to_binary
 
4
 
5
- st.title("🧠 Binary Clone Generator using GenAI")
6
 
7
- binary_input = st.text_area("Enter Binary Input (from primary SoC)", height=200)
8
 
9
  if binary_input:
10
- st.subheader("πŸ” Converting Binary to Text")
11
  original_text = binary_to_text(binary_input)
12
- st.code(original_text, language='text')
13
 
14
- if st.button("πŸ›  Generate Replica for Secondary SoC"):
15
- st.write("⏳ Loading model and generating...")
16
- tokenizer, model = load_model()
17
- gen_code = generate_code(tokenizer, model, original_text)
 
18
 
19
- st.subheader("🎯 Generated Code/Text")
20
- st.code(gen_code, language='python')
21
 
22
- st.subheader("πŸ“¦ Re-converted to Binary for SoC")
23
- generated_binary = text_to_binary(gen_code)
24
- st.code(generated_binary, language='text')
 
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)