; @file\r
; Search for the SEC Core entry point\r
;\r
-; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
; This program and the accompanying materials\r
; are licensed and made available under the terms and conditions of the BSD License\r
; which accompanies this distribution. The full text of the license may be found at\r
OneTimeCallRet Flat32SearchForSecEntryPoint\r
\r
%define EFI_SECTION_PE32 0x10\r
+%define EFI_SECTION_TE 0x12\r
\r
;\r
; Input:\r
cmp byte [eax + 3], EFI_SECTION_PE32\r
je getEntryPointOfFfsFileFoundPe32Section\r
\r
+ cmp byte [eax + 3], EFI_SECTION_TE\r
+ je getEntryPointOfFfsFileFoundTeSection\r
+\r
;\r
- ; The section type was not PE32, so move to next section\r
+ ; The section type was not PE32 or TE, so move to next section\r
;\r
mov ebx, dword [eax]\r
and ebx, 0x00ffffff\r
getEntryPointOfFfsFileFoundPe32Section:\r
add eax, 4 ; EAX = Start of PE32 image\r
\r
- mov ebx, eax\r
cmp word [eax], 'MZ'\r
- jne thereIsNotAnMzSignature\r
+ jne getEntryPointOfFfsFileErrorReturn\r
movzx ebx, word [eax + 0x3c]\r
add ebx, eax\r
-thereIsNotAnMzSignature:\r
+\r
+ ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)\r
+ cmp dword [ebx], `PE\x00\x00`\r
+ jne getEntryPointOfFfsFileErrorReturn\r
+\r
+ ; *EntryPoint = (VOID *)((UINTN)Pe32Data +\r
+ ; (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));\r
+ add eax, [ebx + 0x4 + 0x14 + 0x10]\r
+ jmp getEntryPointOfFfsFileReturn\r
+\r
+getEntryPointOfFfsFileFoundTeSection:\r
+ add eax, 4 ; EAX = Start of TE image\r
+ mov ebx, eax\r
\r
; if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE)\r
cmp word [ebx], 'VZ'\r
- jne thereIsNoVzSignature\r
+ jne getEntryPointOfFfsFileErrorReturn\r
; *EntryPoint = (VOID *)((UINTN)Pe32Data +\r
; (UINTN)(Hdr.Te->AddressOfEntryPoint & 0x0ffffffff) +\r
; sizeof(EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize);\r
sub eax, ebx\r
jmp getEntryPointOfFfsFileReturn\r
\r
-thereIsNoVzSignature:\r
-\r
- ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)\r
- cmp dword [ebx], `PE\x00\x00`\r
- jne getEntryPointOfFfsFileErrorReturn\r
-\r
- ; *EntryPoint = (VOID *)((UINTN)Pe32Data +\r
- ; (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));\r
- add eax, [ebx + 0x4 + 0x14 + 0x10]\r
- jmp getEntryPointOfFfsFileReturn\r
-\r
getEntryPointOfFfsFileErrorReturn:\r
mov eax, 0\r
\r