Skip to content

Commit

Permalink
Fix region size
Browse files Browse the repository at this point in the history
The region size was 1 Byte larger
  • Loading branch information
corna committed Feb 1, 2018
1 parent 3051107 commit 9e1611f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions me_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def start_end_to_flreg(start, end):
f.seek(0, 2)
me_start = 0
me_end = f.tell()
mef = RegionFile(f, me_start, me_end + 1)
mef = RegionFile(f, me_start, me_end)

elif magic == b"\x5a\xa5\xf0\x0f":
print("Full image detected")
Expand All @@ -571,7 +571,7 @@ def start_end_to_flreg(start, end):
if me_start >= me_end:
sys.exit("The ME/TXE region in this image has been disabled")

mef = RegionFile(f, me_start, me_end + 1)
mef = RegionFile(f, me_start, me_end)

mef.seek(0x10)
if mef.read(4) != b"$FPT":
Expand Down Expand Up @@ -663,10 +663,10 @@ def start_end_to_flreg(start, end):
shutil.copy(args.file, args.output)
f = open(args.output, "r+b")

mef = RegionFile(f, me_start, me_end + 1)
mef = RegionFile(f, me_start, me_end)

if me_start > 0:
fdf = RegionFile(f, fd_start, fd_end + 1)
fdf = RegionFile(f, fd_start, fd_end)

# ME 6 Ignition: wipe everything
me6_ignition = False
Expand Down

0 comments on commit 9e1611f

Please sign in to comment.