Browse Source

Remove the last partition in ME 6

The last partition in ME 6 has 0xffffffff as size and was previously
ignored by me_cleaner.
Nicola Corna 6 years ago
parent
commit
5bd27b36ba
1 changed files with 6 additions and 0 deletions
  1. 6 0
      me_cleaner.py

+ 6 - 0
me_cleaner.py

@@ -691,6 +691,12 @@ if __name__ == "__main__":
                     part_name = "????"
 
                 part_start, part_length = unpack("<II", partition[0x08:0x10])
+
+                # ME 6: the last partition has 0xffffffff as size
+                if variant == "ME" and version[0] == 6 and \
+                   i == entries - 1 and part_length == 0xffffffff:
+                    part_length = me_end - part_start
+
                 part_end = part_start + part_length
 
                 if flags & 0x7f == 2: