]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / ResetVector / Vtf0 / Tools / FixupForRawSection.py
1 ## @file
2 # Apply fixup to VTF binary image for FFS Raw section
3 #
4 # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
5 #
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
7 #
8
9 import sys
10
11 filename = sys.argv[1]
12
13 d = open(sys.argv[1], 'rb').read()
14 c = ((len(d) + 4 + 7) & ~7) - 4
15 if c > len(d):
16 c -= len(d)
17 f = open(sys.argv[1], 'wb')
18 f.write('\x90' * c)
19 f.write(d)
20 f.close()