mirror of
https://github.com/bkerler/edl.git
synced 2024-11-24 00:17:52 -05:00
Merge pull request #565 from ChrisEric1/master
Fix footer command & Partially revert commit a9e5008
This commit is contained in:
commit
f22a53bed2
2 changed files with 9 additions and 9 deletions
6
edl
6
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:
|
||||
|
|
|
@ -487,21 +487,21 @@ 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}")
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue