mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-06-01 07:48:22 -04:00
UEFITool 0.18.4 / UEFIExtract 0.2.2
- added new FFS GUID found new in Apple EFI images - added PDR region parsing as BIOS space (Apple feature again) - changed default directory for saving to the directory containing opened file - focus and cursor position are now set properly for GUID tab in search dialog - search dialog resized to fit the whole GUID - codebase cleaned form unnecessary spaces
This commit is contained in:
parent
6e1f226aa0
commit
534f01fcd5
35 changed files with 3589 additions and 3656 deletions
|
@ -500,7 +500,6 @@ VOID
|
|||
// Special usage of 'next'
|
||||
//
|
||||
mNext[LoopVar4] = mPos;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -914,7 +913,6 @@ IN UINT32 x
|
|||
mSubBitBuf |= x << (mBitCount -= LoopVar8);
|
||||
}
|
||||
else {
|
||||
|
||||
Temp = (UINT8)(mSubBitBuf | (x >> (LoopVar8 -= mBitCount)));
|
||||
if (mDst < mDstUpperLimit) {
|
||||
*mDst++ = Temp;
|
||||
|
@ -925,7 +923,6 @@ IN UINT32 x
|
|||
mSubBitBuf = x << (mBitCount = UINT8_BIT - LoopVar8);
|
||||
}
|
||||
else {
|
||||
|
||||
Temp = (UINT8)(x >> (LoopVar8 - UINT8_BIT));
|
||||
if (mDst < mDstUpperLimit) {
|
||||
*mDst++ = Temp;
|
||||
|
@ -1031,7 +1028,7 @@ VOID
|
|||
}
|
||||
}
|
||||
else {
|
||||
ASSERT((LoopVar3 + 2)<(2 * NT - 1));
|
||||
ASSERT((LoopVar3 + 2) < (2 * NT - 1));
|
||||
mTFreq[LoopVar3 + 2]++;
|
||||
}
|
||||
}
|
||||
|
@ -1135,7 +1132,7 @@ VOID
|
|||
}
|
||||
}
|
||||
else {
|
||||
ASSERT((LoopVar3 + 2)<NPT);
|
||||
ASSERT((LoopVar3 + 2) < NPT);
|
||||
PutBits(mPTLen[LoopVar3 + 2], mPTCode[LoopVar3 + 2]);
|
||||
}
|
||||
}
|
||||
|
@ -1456,7 +1453,6 @@ IN OUT UINT64 *DstSize
|
|||
*DstSize = mCompSize + 1 + 8;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
UINT8 EfiCompress(CONST VOID* SrcBuffer, CONST UINT64 SrcSize, VOID* DstBuffer, UINT64* DstSize)
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2008, 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
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
TianoCompress.h
|
||||
TianoCompress.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Header file for compression routine.
|
||||
|
||||
Header file for compression routine.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _EFITIANOCOMPRESS_H_
|
||||
|
@ -32,69 +32,69 @@ Abstract:
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*++
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Routine Description:
|
||||
|
||||
Tiano compression routine.
|
||||
Tiano compression routine.
|
||||
|
||||
Arguments:
|
||||
Arguments:
|
||||
|
||||
SrcBuffer - The buffer storing the source data
|
||||
SrcSize - The size of source data
|
||||
DstBuffer - The buffer to store the compressed data
|
||||
DstSize - On input, the size of DstBuffer; On output,
|
||||
the size of the actual compressed data.
|
||||
SrcBuffer - The buffer storing the source data
|
||||
SrcSize - The size of source data
|
||||
DstBuffer - The buffer to store the compressed data
|
||||
DstSize - On input, the size of DstBuffer; On output,
|
||||
the size of the actual compressed data.
|
||||
|
||||
Returns:
|
||||
Returns:
|
||||
|
||||
EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. this case,
|
||||
DstSize contains the size needed.
|
||||
EFI_SUCCESS - Compression is successful.
|
||||
EFI_OUT_OF_RESOURCES - No resource to complete function.
|
||||
EFI_INVALID_PARAMETER - Parameter supplied is wrong.
|
||||
EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. this case,
|
||||
DstSize contains the size needed.
|
||||
EFI_SUCCESS - Compression is successful.
|
||||
EFI_OUT_OF_RESOURCES - No resource to complete function.
|
||||
EFI_INVALID_PARAMETER - Parameter supplied is wrong.
|
||||
|
||||
--*/
|
||||
UINT8
|
||||
TianoCompress (
|
||||
CONST VOID *SrcBuffer,
|
||||
CONST UINT64 SrcSize,
|
||||
VOID *DstBuffer,
|
||||
UINT64 *DstSize
|
||||
)
|
||||
;
|
||||
--*/
|
||||
UINT8
|
||||
TianoCompress(
|
||||
CONST VOID *SrcBuffer,
|
||||
CONST UINT64 SrcSize,
|
||||
VOID *DstBuffer,
|
||||
UINT64 *DstSize
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Routine Description:
|
||||
|
||||
EFI 1.1 compression routine.
|
||||
EFI 1.1 compression routine.
|
||||
|
||||
Arguments:
|
||||
Arguments:
|
||||
|
||||
SrcBuffer - The buffer storing the source data
|
||||
SrcSize - The size of source data
|
||||
DstBuffer - The buffer to store the compressed data
|
||||
DstSize - On input, the size of DstBuffer; On output,
|
||||
the size of the actual compressed data.
|
||||
SrcBuffer - The buffer storing the source data
|
||||
SrcSize - The size of source data
|
||||
DstBuffer - The buffer to store the compressed data
|
||||
DstSize - On input, the size of DstBuffer; On output,
|
||||
the size of the actual compressed data.
|
||||
|
||||
Returns:
|
||||
Returns:
|
||||
|
||||
EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. this case,
|
||||
DstSize contains the size needed.
|
||||
EFI_SUCCESS - Compression is successful.
|
||||
EFI_OUT_OF_RESOURCES - No resource to complete function.
|
||||
EFI_INVALID_PARAMETER - Parameter supplied is wrong.
|
||||
EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. this case,
|
||||
DstSize contains the size needed.
|
||||
EFI_SUCCESS - Compression is successful.
|
||||
EFI_OUT_OF_RESOURCES - No resource to complete function.
|
||||
EFI_INVALID_PARAMETER - Parameter supplied is wrong.
|
||||
|
||||
--*/
|
||||
UINT8
|
||||
EfiCompress (
|
||||
CONST VOID *SrcBuffer,
|
||||
CONST UINT64 SrcSize,
|
||||
VOID *DstBuffer,
|
||||
UINT64 *DstSize
|
||||
)
|
||||
;
|
||||
--*/
|
||||
UINT8
|
||||
EfiCompress(
|
||||
CONST VOID *SrcBuffer,
|
||||
CONST UINT64 SrcSize,
|
||||
VOID *DstBuffer,
|
||||
UINT64 *DstSize
|
||||
)
|
||||
;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -103,7 +103,6 @@ Returns: (VOID)
|
|||
Sd->mBitBuf = (UINT32)(Sd->mBitBuf << NumOfBits);
|
||||
|
||||
while (NumOfBits > Sd->mBitCount) {
|
||||
|
||||
Sd->mBitBuf |= (UINT32)(Sd->mSubBitBuf << (NumOfBits = (UINT16)(NumOfBits - Sd->mBitCount)));
|
||||
|
||||
if (Sd->mCompSize > 0) {
|
||||
|
@ -114,7 +113,6 @@ Returns: (VOID)
|
|||
Sd->mSubBitBuf = 0;
|
||||
Sd->mSubBitBuf = Sd->mSrcBase[Sd->mInBuf++];
|
||||
Sd->mBitCount = 8;
|
||||
|
||||
}
|
||||
else {
|
||||
//
|
||||
|
@ -122,7 +120,6 @@ Returns: (VOID)
|
|||
//
|
||||
Sd->mSubBitBuf = 0;
|
||||
Sd->mBitCount = 8;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +267,6 @@ BAD_TABLE - The table is corrupted.
|
|||
Mask = (UINT16)(1U << (15 - TableBits));
|
||||
|
||||
for (Char = 0; Char < NumOfChar; Char++) {
|
||||
|
||||
Len = BitLen[Char];
|
||||
if (Len == 0 || Len >= 17) {
|
||||
continue;
|
||||
|
@ -279,17 +275,14 @@ BAD_TABLE - The table is corrupted.
|
|||
NextCode = (UINT16)(Start[Len] + Weight[Len]);
|
||||
|
||||
if (Len <= TableBits) {
|
||||
|
||||
for (Index = Start[Len]; Index < NextCode; Index++) {
|
||||
// Check to prevent possible heap corruption
|
||||
if (Index >= (UINT16)(1U << TableBits))
|
||||
return (UINT16)BAD_TABLE;
|
||||
Table[Index] = Char;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Index3 = Start[Len];
|
||||
Pointer = &Table[Index3 >> JuBits];
|
||||
Index = (UINT16)(Len - TableBits);
|
||||
|
@ -318,7 +311,6 @@ BAD_TABLE - The table is corrupted.
|
|||
}
|
||||
|
||||
*Pointer = Char;
|
||||
|
||||
}
|
||||
|
||||
Start[Len] = NextCode;
|
||||
|
@ -360,7 +352,6 @@ The position value decoded.
|
|||
Mask = 1U << (BITBUFSIZ - 1 - 8);
|
||||
|
||||
do {
|
||||
|
||||
if (Sd->mBitBuf & Mask) {
|
||||
Val = Sd->mRight[Val];
|
||||
}
|
||||
|
@ -443,7 +434,6 @@ BAD_TABLE - Table is corrupted.
|
|||
Index = 0;
|
||||
|
||||
while (Index < Number) {
|
||||
|
||||
CharC = (UINT16)(Sd->mBitBuf >> (BITBUFSIZ - 3));
|
||||
|
||||
if (CharC == 7) {
|
||||
|
@ -521,13 +511,11 @@ Returns: (VOID)
|
|||
|
||||
Index = 0;
|
||||
while (Index < Number) {
|
||||
|
||||
CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
|
||||
if (CharC >= NT) {
|
||||
Mask = 1U << (BITBUFSIZ - 1 - 8);
|
||||
|
||||
do {
|
||||
|
||||
if (Mask & Sd->mBitBuf) {
|
||||
CharC = Sd->mRight[CharC];
|
||||
}
|
||||
|
@ -536,7 +524,6 @@ Returns: (VOID)
|
|||
}
|
||||
|
||||
Mask >>= 1;
|
||||
|
||||
} while (CharC >= NT);
|
||||
}
|
||||
//
|
||||
|
@ -545,7 +532,6 @@ Returns: (VOID)
|
|||
FillBuf(Sd, Sd->mPTLen[CharC]);
|
||||
|
||||
if (CharC <= 2) {
|
||||
|
||||
if (CharC == 0) {
|
||||
CharC = 1;
|
||||
}
|
||||
|
@ -559,12 +545,9 @@ Returns: (VOID)
|
|||
while ((INT16)(--CharC) >= 0) {
|
||||
Sd->mCLen[Index++] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Sd->mCLen[Index++] = (UINT8)(CharC - 2);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -687,7 +670,6 @@ Returns: (VOID)
|
|||
else {
|
||||
Sd->mDstBase[Sd->mOutBuf++] = (UINT8)CharC;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
//
|
||||
|
@ -1007,4 +989,4 @@ EFI_INVALID_PARAMETER - The source data is corrupted
|
|||
ScratchSize,
|
||||
2
|
||||
);
|
||||
}
|
||||
}
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2008, 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
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Decompress.h
|
||||
Decompress.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Header file for decompression routine.
|
||||
Providing both EFI and Tiano decompress algorithms.
|
||||
Header file for decompression routine.
|
||||
Providing both EFI and Tiano decompress algorithms.
|
||||
|
||||
--*/
|
||||
|
||||
|
@ -32,108 +32,108 @@ Abstract:
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
UINT32 CompSize;
|
||||
UINT32 OrigSize;
|
||||
} EFI_TIANO_HEADER;
|
||||
typedef struct {
|
||||
UINT32 CompSize;
|
||||
UINT32 OrigSize;
|
||||
} EFI_TIANO_HEADER;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EfiTianoGetInfo (
|
||||
VOID *Source,
|
||||
UINT32 SrcSize,
|
||||
UINT32 *DstSize,
|
||||
UINT32 *ScratchSize
|
||||
)
|
||||
/*++
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EfiTianoGetInfo(
|
||||
VOID *Source,
|
||||
UINT32 SrcSize,
|
||||
UINT32 *DstSize,
|
||||
UINT32 *ScratchSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Routine Description:
|
||||
|
||||
The implementation is same as that of EFI_DECOMPRESS_PROTOCOL.GetInfo().
|
||||
The implementation is same as that of EFI_DECOMPRESS_PROTOCOL.GetInfo().
|
||||
|
||||
Arguments:
|
||||
Arguments:
|
||||
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SrcSize - The size of source buffer
|
||||
DstSize - The size of destination buffer.
|
||||
ScratchSize - The size of scratch buffer.
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SrcSize - The size of source buffer
|
||||
DstSize - The size of destination buffer.
|
||||
ScratchSize - The size of scratch buffer.
|
||||
|
||||
Returns:
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
|
||||
EFI_INVALID_PARAMETER - The source data is corrupted
|
||||
EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
|
||||
EFI_INVALID_PARAMETER - The source data is corrupted
|
||||
|
||||
--*/
|
||||
;
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EfiDecompress (
|
||||
VOID *Source,
|
||||
UINT32 SrcSize,
|
||||
VOID *Destination,
|
||||
UINT32 DstSize,
|
||||
VOID *Scratch,
|
||||
UINT32 ScratchSize
|
||||
)
|
||||
/*++
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EfiDecompress(
|
||||
VOID *Source,
|
||||
UINT32 SrcSize,
|
||||
VOID *Destination,
|
||||
UINT32 DstSize,
|
||||
VOID *Scratch,
|
||||
UINT32 ScratchSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Routine Description:
|
||||
|
||||
The implementation is same as that of EFI_DECOMPRESS_PROTOCOL.Decompress().
|
||||
The implementation is same as that of EFI_DECOMPRESS_PROTOCOL.Decompress().
|
||||
|
||||
Arguments:
|
||||
Arguments:
|
||||
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SrcSize - The size of source buffer
|
||||
Destination - The destination buffer to store the decompressed data
|
||||
DstSize - The size of destination buffer.
|
||||
Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
|
||||
ScratchSize - The size of scratch buffer.
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SrcSize - The size of source buffer
|
||||
Destination - The destination buffer to store the decompressed data
|
||||
DstSize - The size of destination buffer.
|
||||
Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
|
||||
ScratchSize - The size of scratch buffer.
|
||||
|
||||
Returns:
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Decompression is successful
|
||||
EFI_INVALID_PARAMETER - The source data is corrupted
|
||||
EFI_SUCCESS - Decompression is successful
|
||||
EFI_INVALID_PARAMETER - The source data is corrupted
|
||||
|
||||
--*/
|
||||
;
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TianoDecompress (
|
||||
VOID *Source,
|
||||
UINT32 SrcSize,
|
||||
VOID *Destination,
|
||||
UINT32 DstSize,
|
||||
VOID *Scratch,
|
||||
UINT32 ScratchSize
|
||||
)
|
||||
/*++
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TianoDecompress(
|
||||
VOID *Source,
|
||||
UINT32 SrcSize,
|
||||
VOID *Destination,
|
||||
UINT32 DstSize,
|
||||
VOID *Scratch,
|
||||
UINT32 ScratchSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Routine Description:
|
||||
|
||||
The implementation is same as that of EFI_TIANO_DECOMPRESS_PROTOCOL.Decompress().
|
||||
The implementation is same as that of EFI_TIANO_DECOMPRESS_PROTOCOL.Decompress().
|
||||
|
||||
Arguments:
|
||||
Arguments:
|
||||
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SrcSize - The size of source buffer
|
||||
Destination - The destination buffer to store the decompressed data
|
||||
DstSize - The size of destination buffer.
|
||||
Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
|
||||
ScratchSize - The size of scratch buffer.
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SrcSize - The size of source buffer
|
||||
Destination - The destination buffer to store the decompressed data
|
||||
DstSize - The size of destination buffer.
|
||||
Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
|
||||
ScratchSize - The size of scratch buffer.
|
||||
|
||||
Returns:
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Decompression is successful
|
||||
EFI_INVALID_PARAMETER - The source data is corrupted
|
||||
EFI_SUCCESS - Decompression is successful
|
||||
EFI_INVALID_PARAMETER - The source data is corrupted
|
||||
|
||||
--*/
|
||||
;
|
||||
--*/
|
||||
;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue