From e98ceea1d69e3cf633bd6b0a96892ff1623c01c6 Mon Sep 17 00:00:00 2001 From: Eljakim Herrewijnen Date: Sat, 7 Dec 2024 21:02:52 +0100 Subject: [PATCH] removed unnecesary code --- source/exploit/exploit.py | 17 +---------------- source/exploit/exynos.py | 2 ++ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/source/exploit/exploit.py b/source/exploit/exploit.py index 1c76bd9..6d42130 100644 --- a/source/exploit/exploit.py +++ b/source/exploit/exploit.py @@ -178,22 +178,7 @@ class S7Exploit(ExynosDevice): return - def usb_write(self, data): - assert len(data) <= 0x200, "Data too big" - transferred = ctypes.c_int() - res = libusb1.libusb_bulk_transfer(self.handle._USBDeviceHandle__handle, ENDPOINT_BULK_OUT, data, len(data), ctypes.byref(transferred), 300) - - assert res == 0, f"Error sending data {res}" - assert transferred.value == len(data), f"Invalid transfered size {transferred.value} != {len(data)}" - return transferred.value - - - def usb_read(self, size): - transferred = ctypes.c_int() - buf = ctypes.c_buffer(b"", size) - res = libusb1.libusb_bulk_transfer(self.handle._USBDeviceHandle__handle, ENDPOINT_BULK_IN, buf, len(buf), ctypes.byref(transferred), 300) - assert res == 0, f"Error receiving data {res}" - return buf.raw[:transferred.value] + def setup_concrete_device(self, concrete_device : ConcreteDevice): diff --git a/source/exploit/exynos.py b/source/exploit/exynos.py index 863466d..b02fa7b 100644 --- a/source/exploit/exynos.py +++ b/source/exploit/exynos.py @@ -75,10 +75,12 @@ class ExynosDevice(): assert len(data) <= 0x200, "Data too big" transferred = ctypes.c_int() res = libusb1.libusb_bulk_transfer(self.handle._USBDeviceHandle__handle, ENDPOINT_BULK_OUT, data, len(data), ctypes.byref(transferred), 300) + assert res == 0, f"Error sending data {res}" assert transferred.value == len(data), f"Invalid transfered size {transferred.value} != {len(data)}" return transferred.value + def usb_read(self, size): transferred = ctypes.c_int() buf = ctypes.c_buffer(b"", size)