1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2008, Intel Corporation
4 ; All rights reserved. This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 ; SearchForBfvBase.asm
18 ; Search for the Boot FV Base Address
20 ;------------------------------------------------------------------------------
22 ;#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \
23 ; { 0x8c8ce578, 0x8a3d, 0x4f1c, { 0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } }
24 %define FFS_GUID_DWORD0 0x8c8ce578
25 %define FFS_GUID_DWORD1 0x4f1c8a3d
26 %define FFS_GUID_DWORD2 0x61893599
27 %define FFS_GUID_DWORD3 0xd32dc385
36 ; EBP - BFV Base Address
41 Flat32SearchForBfvBase:
44 searchingForBfvHeaderLoop:
47 jb searchedForBfvHeaderButNotFound
52 cmp dword [eax + 0x10], FFS_GUID_DWORD0
53 jne searchingForBfvHeaderLoop
54 cmp dword [eax + 0x14], FFS_GUID_DWORD1
55 jne searchingForBfvHeaderLoop
56 cmp dword [eax + 0x18], FFS_GUID_DWORD2
57 jne searchingForBfvHeaderLoop
58 cmp dword [eax + 0x1c], FFS_GUID_DWORD3
59 jne searchingForBfvHeaderLoop
64 cmp dword [eax + 0x24], 0
65 jne searchingForBfvHeaderLoop
67 add ebx, dword [eax + 0x20]
68 jnz searchingForBfvHeaderLoop
70 jmp searchedForBfvHeaderAndItWasFound
72 searchedForBfvHeaderButNotFound:
76 searchedForBfvHeaderAndItWasFound:
87 OneTimeCallRet Flat32SearchForBfvBase