From f75a14acc5e89a4dfb8f9e4ea94a85bf7e6ab330 Mon Sep 17 00:00:00 2001 From: ek0ms savi0r <4+ek0mssavi0r@noreply.git.churchofmalware.org> Date: Mon, 6 Jul 2026 06:11:12 +0000 Subject: [PATCH] Upload files to "utils" --- utils/__init__.py | Bin 0 -> 1024 bytes utils/packet.py | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 utils/__init__.py create mode 100644 utils/packet.py diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4af10487da3d20 GIT binary patch literal 1024 ScmZQz7zLvtFd70QH3R?z00031 literal 0 HcmV?d00001 diff --git a/utils/packet.py b/utils/packet.py new file mode 100644 index 0000000..358c8ba --- /dev/null +++ b/utils/packet.py @@ -0,0 +1,22 @@ +import struct + +HEAD_STANDARD = 0x05 +HEAD_FOTA = 0x15 +CMD_GET_BUILD = 0x1E08 +CMD_READ_FLASH = 0x0403 +CMD_GET_BD_ADDR = 0x0C05 + +def build_race_packet(cmd: int, payload: bytes = b'', head: int = HEAD_STANDARD) -> bytes: + pkt_type = 0x00 + length = 2 + len(payload) + header = struct.pack(' dict: + if len(data) < 6: + return {"error": "Packet too short"} + head, pkt_type, length = struct.unpack_from('