From a398d2c2b5fd6ab0545d8bb019f9a970b2309404 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:16:34 +0200 Subject: Adding upstream version 3.6. Signed-off-by: Daniel Baumann --- tests/gpt-header-move | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 tests/gpt-header-move (limited to 'tests/gpt-header-move') diff --git a/tests/gpt-header-move b/tests/gpt-header-move new file mode 100755 index 0000000..18f58d0 --- /dev/null +++ b/tests/gpt-header-move @@ -0,0 +1,42 @@ +#!/usr/bin/python3 + +# open img file, subtract 33 from altlba address, and move the last 33 sectors +# back by 33 sectors + +from struct import unpack_from, pack_into +from zipfile import crc32 +import array +import sys + +file = open(sys.argv[1],'rb+') +file.seek(512) +gptheader = file.read(512) +altlba = unpack_from('