MdePkg/PeCoffGetEntryPointLib: Add PeCoffSerachImageBase()

This new API only works on DEBUG build. It will search the PE/COFF image base
forward the input address in this PE/COFF image and returns it.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Jeff Fan
2017-04-01 13:29:00 +08:00
parent a30d5f9f90
commit 412e9dea4b
2 changed files with 90 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Provides a service to retrieve the PE/COFF entry point from a PE/COFF image.
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -101,4 +101,22 @@ PeCoffGetSizeOfHeaders (
IN VOID *Pe32Data
);
/**
Returns PE/COFF image base specified by the address in this PE/COFF image.
On DEBUG build, searches the PE/COFF image base forward the address in this
PE/COFF image and returns it.
@param Address Address located in one PE/COFF image.
@retval 0 RELEASE build or cannot find the PE/COFF image base.
@retval others PE/COFF image base found.
**/
UINTN
EFIAPI
PeCoffSerachImageBase (
IN UINTN Address
);
#endif