2019-11-20 12:40:37 +01:00
|
|
|
#!/usr/bin/env python3
|
2022-06-16 11:23:26 +02:00
|
|
|
from edl.Library.tcpclient import tcpclient
|
2019-11-15 20:30:18 +01:00
|
|
|
|
2024-06-10 01:06:20 +08:00
|
|
|
|
2024-06-10 01:19:09 +08:00
|
|
|
class client:
|
2019-11-15 20:30:18 +01:00
|
|
|
def __init__(self):
|
2024-06-10 01:06:20 +08:00
|
|
|
self.commands = []
|
2019-11-15 20:30:18 +01:00
|
|
|
|
|
|
|
def send(self):
|
2020-11-14 17:28:32 +01:00
|
|
|
self.tcp = tcpclient(1340)
|
2019-11-15 20:30:18 +01:00
|
|
|
self.tcp.sendcommands(self.commands)
|
|
|
|
|
2024-06-10 01:06:20 +08:00
|
|
|
def read(self, src):
|
2019-11-15 20:30:18 +01:00
|
|
|
self.commands.append(f"peekqword:{hex(src)}")
|
|
|
|
|
2024-06-10 01:06:20 +08:00
|
|
|
def write(self, dest, value):
|
2019-11-15 20:30:18 +01:00
|
|
|
self.commands.append(f"pokeqword:{hex(dest)},{hex(value)}")
|
|
|
|
|
2024-06-10 01:06:20 +08:00
|
|
|
def memcpy(self, dest, src, size):
|
2019-11-15 20:30:18 +01:00
|
|
|
self.commands.append(f"memcpy:{hex(dest)},{hex(src)},{hex(size)}")
|
|
|
|
|
2024-06-10 01:06:20 +08:00
|
|
|
|
2019-11-15 20:30:18 +01:00
|
|
|
def main():
|
2024-06-10 01:06:20 +08:00
|
|
|
exp = client()
|
2019-11-15 20:30:18 +01:00
|
|
|
exp.commands = [
|
2020-12-22 22:19:37 +01:00
|
|
|
"send:nop",
|
|
|
|
"r:boot,boot.img",
|
|
|
|
"peek:0x00100000,0x8,qfp.bin"
|
2020-11-14 17:28:32 +01:00
|
|
|
#"pokehex:0x1402C2CC,1f2003d5",
|
|
|
|
#"peek:0x14084840,0xC00,uart.bin"
|
2019-11-15 20:30:18 +01:00
|
|
|
]
|
|
|
|
exp.send()
|
|
|
|
|
2024-06-10 01:06:20 +08:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2019-11-15 20:30:18 +01:00
|
|
|
main()
|