mirror of
https://github.com/krystalgamer/spidey-decomp.git
synced 2025-02-17 11:27:50 +00:00
fileCRCCheck
This commit is contained in:
parent
9561fd1092
commit
7558dbbd02
18
pkr.cpp
18
pkr.cpp
@ -1,8 +1,22 @@
|
||||
#include "pkr.h"
|
||||
#include "zlib.h"
|
||||
|
||||
i32 fileCRCCheck(u8* buf, i32 size, u32 expected)
|
||||
// @BIGTODO
|
||||
void PKR_ReportError(const char*, ...)
|
||||
{
|
||||
u32 res = crc32(0,0 ,0);
|
||||
printf("void PKR_ReportError(const char*, ...)");
|
||||
}
|
||||
|
||||
// @Ok
|
||||
u8 fileCRCCheck(u8* buf, i32 size, u32 expected)
|
||||
{
|
||||
u32 res = crc32(crc32(0,0,0), buf, size);
|
||||
|
||||
if (res != expected)
|
||||
{
|
||||
PKR_ReportError("fileCRCCheck: Bad CRC. %08X bad. %08X correct. File is Damaged.", res, expected);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user