PKR_FOOTER

This commit is contained in:
krystalgamer 2024-08-18 17:48:50 +01:00
parent 81bdcee011
commit 6ceff55438
3 changed files with 18 additions and 0 deletions

View File

@ -407,6 +407,7 @@ i32 validate(void)
validate_Sprite2();
validate_SBitServerEntry();
validate_PKR_FILEINFO();
validate_PKR_FOOTER();
puts("[*] Validation done!");

View File

@ -105,3 +105,12 @@ void validate_PKR_FILEINFO(void)
VALIDATE(PKR_FILEINFO, uncompressedSize, 0x2C);
VALIDATE(PKR_FILEINFO, compressedSize, 0x30);
}
void validate_PKR_FOOTER(void)
{
VALIDATE_SIZE(PKR_FOOTER, 0xC);
VALIDATE(PKR_FOOTER, field_0, 0x0);
VALIDATE(PKR_FOOTER, numDirs, 0x4);
VALIDATE(PKR_FOOTER, numFiles, 0x8);
}

8
pkr.h
View File

@ -15,6 +15,13 @@ struct PKR_FILEINFO
u32 compressedSize;
};
struct PKR_FOOTER
{
i32 field_0;
i32 numDirs;
i32 numFiles;
};
EXPORT u8 fileCRCCheck(u8*, i32, u32);
EXPORT void PKR_ReportError(const char*, ...);
@ -23,5 +30,6 @@ EXPORT u8* PKRComp_DecompressFile(PKR_FILEINFO*, u8*, i32);
EXPORT u8 PKR_UnlockFile(FILE** fp);
void validate_PKR_FILEINFO(void);
void validate_PKR_FOOTER(void);
#endif