Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix footer command & Partially revert commit a9e5008 #565

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions edl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions edlclient/Library/firehose_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,21 +487,21 @@ def handle_firehose(self, cmd, options):
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}")
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("<I", data[:4])[0]
val = unpack("<I", data.data[:4])[0]
if (val & 0xFFFFFFF0) == 0xD0B5B1C0:
with open(filename, "wb") as write_handle:
write_handle.write(data)
self.printer(f"Dumped footer from {partition.name} as {filename}.")
self.printer(f"Dumped footer from {partition} as {filename}.")
return True
self.error("Error: Couldn't detect footer partition.")
return False
Expand Down
Loading