]>
Commit | Line | Data |
---|---|---|
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 | |
6 | # This program and the accompanying materials\r | |
7 | # are licensed and made available under the terms and conditions of the BSD License\r | |
8 | # which accompanies this distribution. The full text of the license may be found at\r | |
9 | # http://opensource.org/licenses/bsd-license.php\r | |
10 | #\r | |
11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | #\r | |
14 | \r | |
15 | import sys\r | |
16 | \r | |
17 | filename = sys.argv[1]\r | |
18 | \r | |
eee1d2ca JJ |
19 | d = open(sys.argv[1], 'rb').read()\r |
20 | c = ((len(d) + 4 + 7) & ~7) - 4\r | |
21 | if c > len(d):\r | |
22 | c -= len(d)\r | |
23 | f = open(sys.argv[1], 'wb')\r | |
24 | f.write('\x90' * c)\r | |
25 | f.write(d)\r | |
26 | f.close()\r |