From 9f78e26c11c27d48777ed63e977a8eed3a5f45bb Mon Sep 17 00:00:00 2001 From: Christopher Lentocha Date: Tue, 25 Jun 2024 18:50:09 -0400 Subject: [PATCH 1/3] Fix footer command The footer command had syntax issues that prevented the use of it. I mentioned about it on https://github.com/bkerler/edl/pull/564 but decided to fix it myself for everyone. Signed-off-by: Christopher Lentocha --- edlclient/Library/firehose_client.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/edlclient/Library/firehose_client.py b/edlclient/Library/firehose_client.py index cb699b0..2200784 100644 --- a/edlclient/Library/firehose_client.py +++ b/edlclient/Library/firehose_client.py @@ -487,21 +487,22 @@ class firehose_client(metaclass=LogBase): pnames = ["userdata2", "metadata", "userdata", "reserved1", "reserved2", "reserved3"] for pname in pnames: for partition in guid_gpt.partentries: - if partition.name != pname: + if partition != pname: continue - self.printer(f"Detected partition: {partition.name}") + self.printer(f"Detected partition: {partition}") + print data = self.firehose.cmd_read_buffer(lun, - partition.sector + - (partition.sectors - + guid_gpt.partentries[partition].sector + + ((guid_gpt.partentries[partition].sectors) - (0x4000 // self.firehose.cfg.SECTOR_SIZE_IN_BYTES)), (0x4000 // self.firehose.cfg.SECTOR_SIZE_IN_BYTES), False) if data == b"": continue - val = unpack(" Date: Tue, 25 Jun 2024 18:51:42 -0400 Subject: [PATCH 2/3] Partially revert commit a9e5008 This commit fixes this from happening on running a edl command without rebooting the device on every command: ``` Qualcomm Sahara / Firehose Client V3.62 (c) B.Kerler 2018-2024. main - Using loader 0000000000000000_b01193679ab2eac7_fhprg_peek.bin ... main - Waiting for the device main - Device detected :) main - Mode detected: firehose Traceback (most recent call last): File "/usr/local/bin/edl", line 393, in base.run() File "/usr/local/bin/edl", line 295, in run version = conninfo.get("data").version AttributeError: 'NoneType' object has no attribute 'version' root@HP-PAVILION-590:~# ``` Signed-off-by: Christopher Lentocha --- edl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/edl b/edl index ed61e9a..be073e6 100755 --- a/edl +++ b/edl @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # (c) B.Kerler 2018-2024 under GPLv3 license # If you use my code, make sure you refer to my name @@ -290,9 +290,9 @@ class main(metaclass=LogBase): conninfo = self.doconnect(loop) mode = conninfo["mode"] if conninfo.get("data"): - version = 2 - else: version = conninfo.get("data").version + else: + version = 2 if mode == "sahara": cmd = conninfo["cmd"] if cmd == cmd_t.SAHARA_HELLO_REQ: From bd0d89224c5506d5b734cf994c312b46a78e7eea Mon Sep 17 00:00:00 2001 From: Christopher Lentocha Date: Tue, 25 Jun 2024 18:57:30 -0400 Subject: [PATCH 3/3] Remove the print command used during testing On "Fix footer command" commit Signed-off-by: Christopher Lentocha --- edlclient/Library/firehose_client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/edlclient/Library/firehose_client.py b/edlclient/Library/firehose_client.py index 2200784..dab84b0 100644 --- a/edlclient/Library/firehose_client.py +++ b/edlclient/Library/firehose_client.py @@ -490,10 +490,9 @@ class firehose_client(metaclass=LogBase): if partition != pname: continue self.printer(f"Detected partition: {partition}") - print data = self.firehose.cmd_read_buffer(lun, guid_gpt.partentries[partition].sector + - ((guid_gpt.partentries[partition].sectors) - + (guid_gpt.partentries[partition].sectors - (0x4000 // self.firehose.cfg.SECTOR_SIZE_IN_BYTES)), (0x4000 // self.firehose.cfg.SECTOR_SIZE_IN_BYTES), False) if data == b"":