MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetFileSignature

Method GetFileSignature

CoreLib/Crypto.cpp:100–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100bool CryptoUtils::GetFileSignature(std::wstring const& path, PackageSignature& signature)
101{
102 std::vector<uint8_t> contents;
103 if (!LoadFile(path, contents)) return false;
104
105 if (contents.size() < sizeof(PackageSignature)) return false;
106
107 auto sig = reinterpret_cast<PackageSignature*>(contents.data() + contents.size() - sizeof(PackageSignature));
108 if (sig->Magic != PackageSignature::MAGIC_V1) return false;
109
110 signature = *sig;
111 return true;
112}
113
114bool CryptoUtils::VerifySignedFile(std::wstring const& zipPath, std::string& reason)
115{

Callers

nothing calls this directly

Calls 3

LoadFileFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected