Skip to content

Commit

Permalink
add basic xgun compat check
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf109909 committed Sep 8, 2024
1 parent 73d6bca commit d81e2f8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions primedev/Northstar.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_library(
"core/anticheat.cpp"
"core/anticheat.h"

"client/xgun_compat.cpp"
"client/igig/igig.cpp"
"client/igig/igig.h"
"client/igig/ime.cpp"
Expand Down
24 changes: 24 additions & 0 deletions primedev/client/xgun_compat.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<openssl/md5.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

std::string GenerateMD5Hash(void* moduleBase, size_t moduleSize) {
MD5_CTX md5Context;
MD5_Init(&md5Context);
MD5_Update(&md5Context, moduleBase, moduleSize);
unsigned char hash[MD5_DIGEST_LENGTH];
MD5_Final(hash, &md5Context);

std::ostringstream oss;
for (int i = 0; i < MD5_DIGEST_LENGTH; ++i) {
oss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(hash[i]);
}

return oss.str();
}
ON_DLL_LOAD("engine.dll", XGUNSignatureCheck, (CModule module))
{
std::string md5String = GenerateMD5Hash((void*)module.GetModuleBase(),module.GetModuleSize());
spdlog::info("[XGUN] Loading XGUN DLL with Signature: {}", md5String);
}
2 changes: 1 addition & 1 deletion primedev/ns_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#ifndef NORTHSTAR_VERSION
// Turning off clang-format here so it doesn't mess with style as it needs to be this way for regex-ing with CI
// clang-format off
#define NORTHSTAR_VERSION 1,17,1,0
#define NORTHSTAR_VERSION 1,17,3,0
// clang-format on
#endif

0 comments on commit d81e2f8

Please sign in to comment.