Image / app.py
Dmtlant's picture
Update app.py
97278ad verified
raw
history blame
1.39 kB
import frida
import streamlit as st
# Функция для получения логов из Frida
def get_frida_logs(pid):
try:
session = frida.attach(pid)
# Пример скрипта для перехвата сообщений
script_content = """
Java.perform(function() {
var MainActivity = Java.use('com.example.fridatest.MainActivity');
MainActivity.dispatchTakePictureIntent.implementation = function() {
send("Camera intent called");
return this.dispatchTakePictureIntent();
};
});
"""
script = session.create_script(script_content)
script.on('message', on_message)
script.load()
# Ожидание сообщений
st.write("Waiting for logs...")
while True:
pass # Задержка для демонстрации
except Exception as e:
st.error(f"Ошибка: {str(e)}")
def on_message(message, data):
st.write(f"[*] Message from Frida: {message}")
# Streamlit интерфейс
st.title("Frida Log Viewer")
pid = st.text_input("Введите PID процесса:", "")
if st.button("Получить логи"):
if pid:
get_frida_logs(int(pid))
else:
st.warning("Пожалуйста, введите PID процесса.")