Dmtlant commited on
Commit
97278ad
·
verified ·
1 Parent(s): 4dad437

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -17
app.py CHANGED
@@ -1,22 +1,44 @@
 
1
  import streamlit as st
2
- import requests
3
 
4
- # Set up the API endpoint and headers
5
- API_URL = "https://api-inference.huggingface.co/models/tencent/Tencent-Hunyuan-Large"
6
- HF_API_KEY = st.secrets["HF_API_KEY"] # Load the API key from secrets
 
 
 
 
 
 
7
 
8
- def query(payload):
9
- headers = {"Authorization": f"Bearer {HF_API_KEY}"}
10
- response = requests.post(API_URL, headers=headers, json=payload)
11
- return response.json()
 
 
 
 
 
 
12
 
13
- # Create a text input field for the user
14
- st.title("Tencent-Hunyuan-Large Model Demo")
15
- user_input = st.text_input("Enter your text:", "")
 
16
 
17
- # Create a button to trigger the API request
18
- if st.button("Query Model"):
19
- # Prepare the payload and send the request
20
- payload = {"inputs": user_input}
21
- response = query(payload)
22
- st.write(response)
 
 
 
 
 
 
 
 
 
 
1
+ import frida
2
  import streamlit as st
 
3
 
4
+ # Функция для получения логов из Frida
5
+ def get_frida_logs(pid):
6
+ try:
7
+ session = frida.attach(pid)
8
+
9
+ # Пример скрипта для перехвата сообщений
10
+ script_content = """
11
+ Java.perform(function() {
12
+ var MainActivity = Java.use('com.example.fridatest.MainActivity');
13
 
14
+ MainActivity.dispatchTakePictureIntent.implementation = function() {
15
+ send("Camera intent called");
16
+ return this.dispatchTakePictureIntent();
17
+ };
18
+ });
19
+ """
20
+
21
+ script = session.create_script(script_content)
22
+ script.on('message', on_message)
23
+ script.load()
24
 
25
+ # Ожидание сообщений
26
+ st.write("Waiting for logs...")
27
+ while True:
28
+ pass # Задержка для демонстрации
29
 
30
+ except Exception as e:
31
+ st.error(f"Ошибка: {str(e)}")
32
+
33
+ def on_message(message, data):
34
+ st.write(f"[*] Message from Frida: {message}")
35
+
36
+ # Streamlit интерфейс
37
+ st.title("Frida Log Viewer")
38
+ pid = st.text_input("Введите PID процесса:", "")
39
+
40
+ if st.button("Получить логи"):
41
+ if pid:
42
+ get_frida_logs(int(pid))
43
+ else:
44
+ st.warning("Пожалуйста, введите PID процесса.")