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