2014-01-22 09:41:16 +01:00
|
|
|
## @file
|
|
|
|
# Apply fixup to VTF binary image for FFS Raw section
|
|
|
|
#
|
2021-07-23 10:25:30 +02:00
|
|
|
# Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.<BR>
|
2014-01-22 09:41:16 +01:00
|
|
|
#
|
2019-04-04 01:07:22 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2014-01-22 09:41:16 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
filename = sys.argv[1]
|
|
|
|
|
2014-08-19 01:03:46 +02:00
|
|
|
d = open(sys.argv[1], 'rb').read()
|
|
|
|
c = ((len(d) + 4 + 7) & ~7) - 4
|
|
|
|
if c > len(d):
|
|
|
|
c -= len(d)
|
|
|
|
f = open(sys.argv[1], 'wb')
|
2021-07-23 10:25:30 +02:00
|
|
|
f.write(b'\x90' * c)
|
2014-08-19 01:03:46 +02:00
|
|
|
f.write(d)
|
|
|
|
f.close()
|