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

Function ComputePathDigest

UpdateSigner/UpdateSigner.cpp:117–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117int ComputePathDigest(int argc, char** argv)
118{
119 if (argc != 4) {
120 std::cout << "Usage: UpdateSigner compute-path <PackagePath> <DLLPath>" << std::endl;
121 return 1;
122 }
123
124 auto packagePath = FromStdUTF8(std::string(argv[2]));
125 auto dllPath = FromStdUTF8(std::string(argv[3]));
126 auto digest = GetFileDigest(packagePath);
127 if (!digest) {
128 std::cout << "Failed to load package file: " << ToUTF8(packagePath) << std::endl;
129 return 5;
130 }
131
132 auto version = GetFileVersion(dllPath);
133 if (!version) {
134 std::cout << "Failed to load DLL file to check version number: " << ToUTF8(dllPath) << std::endl;
135 return 6;
136 }
137
138 std::cout << "v" + version->ToString() + "-" + *digest + ".package" << std::endl;
139 return 0;
140}
141
142_Post_writable_byte_size_(size) void* OSAlloc(std::size_t size)
143{

Callers 1

SignerMainFunction · 0.85

Calls 5

FromStdUTF8Function · 0.85
GetFileDigestFunction · 0.85
GetFileVersionFunction · 0.85
ToUTF8Function · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected