On Feb 5, 2014, at 8:27 AM, Murali Selvaraj <[email protected]> wrote:
> Hi All, > > I am trying to decode the UEFI image file and to extract compressed modules. > I use the following function to extract compressed modules: > > EFI_STATUS > Extract ( > IN VOID *Source, > IN UINT32 SrcSize, > OUT UCHAR **Destination, > OUT UINT32 *DstSize, > IN UINTN Algorithm > ) > > Where Algorithm 1 EFI Decompress > Algorithm 2 Tiano Decompress > > On analysing, the difference between the two algorithm is that mPBit is set > to 4 for EFI decompress algorithm and 5 for Tiano decompress algorithm. Few > ROM files uses Algorithm 1 and few uses Algorithm 2. > EFI vs. Tiano compression is a PI concept, and has to do with Firmware Volumes. https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Pi/PiFirmwareFile.h Basically an encapsulating section can be a compression section, or a GUIDed encapsulation section can be used to represent an alternate decompression scheme. So it is the section header that defines the compression type, and the data is just the payload (in the form of a leaf section). If you wan’t to read a compressed section from an FV you just use the Firmware Volume 2 protocol to ReadSection() the section you care about. The encapsulation sections are processed automatically and the leaf sections are returned. https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Protocol/FirmwareVolume2.h If I remember correctly the UEFI protocol is just abstracting a single scheme, so the scheme is implied. Thanks, Andrew Fish > Is there any way by which I can arrive the Algorithm from the compressed data? > >> From UEFI Spec 2.4, Section 18.2 gives details of compressed data format. >> Can you please guide me on how to proceed from this. > Thanks, > Murali.S > > The contents of this e-mail and any attachment(s) may contain confidential or > privileged information for the intended recipient(s). Unintended recipients > are prohibited from taking action on the basis of information in this e-mail > and using or disseminating the information, and must notify the sender and > delete it from their system. L&T Infotech will not accept responsibility or > liability for the accuracy or completeness of, or the presence of any virus > or disabling code in this e-mail" > ************************************************************************* > This email and attachments have been scanned for > potential proprietary or sensitive information leakage. > Websense Data Security, Protecting Your Information from the Inside Out. > www.websense.com > ************************************************************************* > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
