ReXGlue SDK
Loading...
Searching...
No Matches
rex::filesystem::IXEXImage Class Referenceabstract

#include <rex/filesystem/xex.h>

Public Member Functions

virtual const kernel::XEXHeader & GetHeader () const =0
virtual std::span< const u8 > GetHeaderBytes () const =0
template<typename T>
const T * GetOptHeader (kernel::XEXHeaderKey key) const
virtual std::optional< u32 > GetOptHeaderValue (kernel::XEXHeaderKey key) const =0
virtual const XEXSecurityInfo & GetSecurity () const =0
virtual std::span< const XEXImportLibrary > GetImports () const =0
virtual std::vector< u32 > GetAlternateTitleIDs () const =0
virtual bool IsPatch () const =0
virtual XEXKey GetKey () const =0
virtual u32 GetImageSize () const =0
virtual Result< void > Decode (std::span< const u8 > file, std::span< u8 > image)=0
virtual Result< std::unique_ptr< IXEXImage > > ApplyHeaderDelta (const IXEXImage &patch) const =0
virtual Result< void > ApplyImageDelta (const IXEXImage &patch, std::span< u8 > image) const =0

Protected Member Functions

virtual const void * FindOptHeader (kernel::XEXHeaderKey key) const =0

Detailed Description

Parsed XEX header, security info and import libraries. Create one with IFileSystemFactory.

Member Function Documentation

◆ ApplyHeaderDelta()

virtual Result< std::unique_ptr< IXEXImage > > rex::filesystem::IXEXImage::ApplyHeaderDelta ( const IXEXImage & patch) const
nodiscardpure virtual

Returns this image with the header delta of a patch applied.

Parameters
patchA patch image from the same factory.

◆ ApplyImageDelta()

virtual Result< void > rex::filesystem::IXEXImage::ApplyImageDelta ( const IXEXImage & patch,
std::span< u8 > image ) const
nodiscardpure virtual

Applies the image delta of a patch to a decoded image.

Parameters
patchThe patch image ApplyHeaderDelta used.
imageThe decoded image, sized for the larger of the old and new images.
Returns
Ok, or a Crypto or Compression error.

◆ Decode()

virtual Result< void > rex::filesystem::IXEXImage::Decode ( std::span< const u8 > file,
std::span< u8 > image )
nodiscardpure virtual

Decrypts and decompresses the image, trying the keys in XEXKey order.

Parameters
fileThe whole file the image was parsed from.
imageReceives the image. Bytes past the decoded data are 0.
Returns
Ok when a key yields a PE image, else the last error.

◆ GetHeader()

virtual const kernel::XEXHeader & rex::filesystem::IXEXImage::GetHeader ( ) const
pure virtual

Returns the byte swapped XEX header.

◆ GetImageSize()

virtual u32 rex::filesystem::IXEXImage::GetImageSize ( ) const
pure virtual

Returns the image size from the page descriptors.

◆ GetKey()

virtual XEXKey rex::filesystem::IXEXImage::GetKey ( ) const
pure virtual

Returns the key Decode selected. Retail before a successful Decode.

◆ GetOptHeader()

template<typename T>
const T * rex::filesystem::IXEXImage::GetOptHeader ( kernel::XEXHeaderKey key) const
inline

Returns the data of an optional header whose key low byte is not 0 or 1, or null when absent.

◆ GetOptHeaderValue()

virtual std::optional< u32 > rex::filesystem::IXEXImage::GetOptHeaderValue ( kernel::XEXHeaderKey key) const
pure virtual

Returns the value of an optional header whose key low byte is 0 or 1, or nothing when absent.


The documentation for this class was generated from the following file: