core: implement basic integrity verification

This commit is contained in:
Liam 2023-09-06 01:06:03 -04:00
parent 0a51fe7854
commit 716e0a126a
12 changed files with 220 additions and 1 deletions

View file

@ -3,6 +3,7 @@
#pragma once
#include <functional>
#include <iosfwd>
#include <memory>
#include <optional>
@ -132,6 +133,8 @@ enum class ResultStatus : u16 {
ErrorBLZDecompressionFailed,
ErrorBadINIHeader,
ErrorINITooManyKIPs,
ErrorIntegrityVerificationNotImplemented,
ErrorIntegrityVerificationFailed,
};
std::string GetResultStatusString(ResultStatus status);
@ -169,6 +172,13 @@ public:
*/
virtual LoadResult Load(Kernel::KProcess& process, Core::System& system) = 0;
/**
* Try to verify the integrity of the file.
*/
virtual ResultStatus VerifyIntegrity(std::function<bool(size_t, size_t)> progress_callback) {
return ResultStatus::ErrorIntegrityVerificationNotImplemented;
}
/**
* Get the code (typically .code section) of the application
*