mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-25 10:47:47 +02:00
ImageTool: Remove unused code
This commit is contained in:
parent
baded9d1f9
commit
c5e36c7b7e
@ -234,72 +234,3 @@ ScanPeGetSegmentInfo (
|
|||||||
|
|
||||||
return RETURN_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
ScanPeGetDebugInfo (
|
|
||||||
OUT image_tool_debug_info_t *DebugInfo,
|
|
||||||
IN PE_COFF_LOADER_IMAGE_CONTEXT *Context
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const CHAR8 *PdbPath;
|
|
||||||
UINT32 PdbPathSize;
|
|
||||||
RETURN_STATUS Status;
|
|
||||||
|
|
||||||
Status = PeCoffGetPdbPath (Context, &PdbPath, &PdbPathSize);
|
|
||||||
if (Status == RETURN_NOT_FOUND) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (RETURN_ERROR (Status)) {
|
|
||||||
fprintf (stderr, "ImageTool: Could not get PdbPath\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugInfo->SymbolsPath = malloc (PdbPathSize);
|
|
||||||
if (DebugInfo->SymbolsPath == NULL) {
|
|
||||||
fprintf (stderr, "ImageTool: Could not allocate memory for SymbolsPath\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
memmove (DebugInfo->SymbolsPath, PdbPath, PdbPathSize);
|
|
||||||
|
|
||||||
assert (PdbPathSize >= 1);
|
|
||||||
assert (DebugInfo->SymbolsPath[PdbPathSize - 1] == '\0');
|
|
||||||
|
|
||||||
DebugInfo->SymbolsPathLen = PdbPathSize - 1;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ScanPeGetHiiInfo (
|
|
||||||
OUT image_tool_hii_info_t *HiiInfo,
|
|
||||||
IN PE_COFF_LOADER_IMAGE_CONTEXT *Context
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UINT32 HiiRva;
|
|
||||||
UINT32 HiiSize;
|
|
||||||
RETURN_STATUS Status;
|
|
||||||
const char *ImageBuffer;
|
|
||||||
|
|
||||||
Status = PeCoffGetHiiDataRva (Context, &HiiRva, &HiiSize);
|
|
||||||
if (Status == RETURN_NOT_FOUND) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (RETURN_ERROR (Status)) {
|
|
||||||
fprintf (stderr, "ImageTool: Could not get HiiRva\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
HiiInfo->Data = calloc (1, HiiSize);
|
|
||||||
if (HiiInfo->Data == NULL) {
|
|
||||||
fprintf (stderr, "ImageTool: Could not allocate memory for HiiInfo Data\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageBuffer = (char *)PeCoffLoaderGetImageAddress (Context);
|
|
||||||
|
|
||||||
memmove (HiiInfo->Data, ImageBuffer + HiiRva, HiiSize);
|
|
||||||
HiiInfo->DataSize = HiiSize;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user