-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_hack.py
51 lines (38 loc) · 1.15 KB
/
start_hack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import json
from typing import Literal
import frida
import signal
import sys
import asyncio
def handle_interrupt(signal, frame):
print("Script terminated by user")
sys.exit(0)
# Register the signal handler for Ctrl + C
signal.signal(signal.SIGINT, handle_interrupt)
device = frida.get_usb_device()
# process = device.attach('zombie.survival.craft.z', realm="emulated")
process = device.attach('Last Day On Earth: Survival', realm="emulated")
class Server:
script: frida.core.Script
def on_message(self, message, data):
return
def create_script(self):
with open('./dist/agent.js', 'r', encoding='utf-8') as file:
script = file.read()
self.script = process.create_script(script)
self.script.on('message', self.on_message)
return self.script
async def main():
server = Server()
# controller.send_key(ord('c'))
while True:
command = input("Enter command:")
script = server.create_script()
script.load()
if command == "main":
res = script.exports_sync.main()
print(res)
try:
asyncio.run(main())
finally:
pass