mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-10-30 07:11:38 +00:00
XenonUtils: Fix image size for basic compressed XEX and expose resource info.
This commit is contained in:
parent
b6675ec638
commit
aa65a781ed
2 changed files with 11 additions and 1 deletions
|
|
@ -11,6 +11,9 @@ struct Image
|
|||
size_t base{};
|
||||
uint32_t size{};
|
||||
|
||||
uint32_t resource_offset{};
|
||||
uint32_t resource_size{};
|
||||
|
||||
size_t entry_point{};
|
||||
std::set<Section, SectionComparer> sections{};
|
||||
SymbolTable symbols{};
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ Image Xex2LoadImage(const uint8_t* data, size_t dataSize)
|
|||
}
|
||||
|
||||
image.data = std::move(result);
|
||||
image.size = security->imageSize;
|
||||
image.size = imageSize;
|
||||
|
||||
// Map image
|
||||
const auto* dosHeader = reinterpret_cast<IMAGE_DOS_HEADER*>(image.data.get());
|
||||
|
|
@ -270,6 +270,13 @@ Image Xex2LoadImage(const uint8_t* data, size_t dataSize)
|
|||
{
|
||||
image.base = *reinterpret_cast<const be<uint32_t>*>(xex2BaseAddressPtr);
|
||||
}
|
||||
const void* xex2ResourceInfoPtr = getOptHeaderPtr(data, XEX_HEADER_RESOURCE_INFO);
|
||||
if (xex2ResourceInfoPtr != nullptr)
|
||||
{
|
||||
const Xex2ResourceInfo* resourceInfo = reinterpret_cast<const Xex2ResourceInfo*>(xex2ResourceInfoPtr);
|
||||
image.resource_offset = resourceInfo->offset;
|
||||
image.resource_size = resourceInfo->sizeOfData;
|
||||
}
|
||||
const void* xex2EntryPointPtr = getOptHeaderPtr(data, XEX_HEADER_ENTRY_POINT);
|
||||
if (xex2EntryPointPtr != nullptr)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue