mirror of
https://github.com/wiiu-env/libromfs_wiiu.git
synced 2024-11-30 05:34:18 +01:00
Check for magic value "WUHB"
This commit is contained in:
parent
63953409aa
commit
e5fc7dc71c
@ -13,7 +13,8 @@
|
||||
|
||||
/// RomFS header.
|
||||
typedef struct {
|
||||
uint64_t headerSize; ///< Size of the header.
|
||||
uint32_t headerMagic; ///< Magic value.
|
||||
uint32_t headerSize; ///< Size of the header.
|
||||
uint64_t dirHashTableOff; ///< Offset of the directory hash table.
|
||||
uint64_t dirHashTableSize; ///< Size of the directory hash table.
|
||||
uint64_t dirTableOff; ///< Offset of the directory table.
|
||||
|
@ -286,6 +286,10 @@ int32_t romfsMountCommon(const char *name, romfs_mount *mount) {
|
||||
goto fail_io;
|
||||
}
|
||||
|
||||
if (memcmp(&mount->header.headerMagic, "WUHB", sizeof(mount->header.headerMagic)) != 0) {
|
||||
goto fail_io;
|
||||
}
|
||||
|
||||
if (mount->header.headerSize != 0x50) {
|
||||
goto fail_io;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user