Skip to content

Commit

Permalink
Merge pull request #565 from ChrisEric1/master
Browse files Browse the repository at this point in the history
Fix footer command & Partially revert commit a9e5008
  • Loading branch information
bkerler authored Jun 26, 2024
2 parents ffcb926 + bd0d892 commit f22a53b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
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

0 comments on commit f22a53b

Please sign in to comment.