aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/version.cpp
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-03-28 23:48:05 +0200
committerGitHub <noreply@github.com>2022-03-28 23:48:05 +0200
commitb8a7feabea6456f7fa5e8403c8d9bd2630401045 (patch)
treed6fa62ef39eb4fcfac1c1711f49ad86b2b6c59d3 /NorthstarDedicatedTest/version.cpp
parent379cbc8bc251307777a14b901e5617e834398485 (diff)
downloadNorthstarLauncher-b8a7feabea6456f7fa5e8403c8d9bd2630401045.tar.gz
NorthstarLauncher-b8a7feabea6456f7fa5e8403c8d9bd2630401045.zip
More exploit fixes by KIttenPopo (#126)
* Quick fix for a bug I caused * Typo * Update kitten-fixes branch to my repo (#122) * Added string hash macro * Added convenient vtfunc macro * Made lil ConCommand creation macro * Fixed multiple NET_SetConVar exploits * Quick fixerino * Fix convar struct (and other things) * Revive clang-format (but good, i think) * Update .clang-format * Reformatted code to meet .clang-format requirements * Minor formatting fixes * Fixed Northstar "crashing" when console is closed * Update .clang-format * Quick fix for a bug I caused * Typo * NSMem Update * ExplotFixes: Only block excessive convar counts if server * Update ExploitFixes.cpp * Update ExploitFixes.cpp * Updated bytepatch format * reformatted all code for clang-format * Updated my clang-format to v13.0.0 * 3 fixes in 1 - ANTITAMPER fixed - NSMem simplification update - Fixed bad byte string in serverauthentication.cpp * Improved ExploitFixes logging and NET_SetConVar patch * clang-format unironically sabotaged my code * Made ns_exploitfixes_log on by default * Fixed IsMemoryReadable (oops) Co-authored-by: KittenPopo <Pokeberry123@gmail.com>
Diffstat (limited to 'NorthstarDedicatedTest/version.cpp')
-rw-r--r--NorthstarDedicatedTest/version.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/NorthstarDedicatedTest/version.cpp b/NorthstarDedicatedTest/version.cpp
index dfeb9670..a0bcee20 100644
--- a/NorthstarDedicatedTest/version.cpp
+++ b/NorthstarDedicatedTest/version.cpp
@@ -4,7 +4,8 @@
char version[16];
char NSUserAgent[32];
-void InitialiseVersion() {
+void InitialiseVersion()
+{
HRSRC hResInfo;
DWORD dwSize;
HGLOBAL hResData;
@@ -14,13 +15,16 @@ void InitialiseVersion() {
HINSTANCE hInst = ::GetModuleHandle(NULL);
hResInfo = FindResourceW(hInst, MAKEINTRESOURCE(1), RT_VERSION);
- if (hResInfo != NULL) {
+ if (hResInfo != NULL)
+ {
dwSize = SizeofResource(hInst, hResInfo);
hResData = LoadResource(hInst, hResInfo);
- if (hResData != NULL) {
+ if (hResData != NULL)
+ {
pRes = LockResource(hResData);
pResCopy = LocalAlloc(LMEM_FIXED, dwSize);
- if (pResCopy != 0) {
+ if (pResCopy != 0)
+ {
CopyMemory(pResCopy, pRes, dwSize);
VerQueryValueW(pResCopy, L"\\", (LPVOID*)&lpFfi, &uLen);
@@ -35,11 +39,13 @@ void InitialiseVersion() {
// We actually use the rightmost integer do determine whether or not we're a debug/dev build
// If it is set to 1 (as in resources.rc), we are a dev build
// On github CI, we set this 1 to a 0 automatically as we replace the 0.0.0.1 with the real version number
- if (dwRightMost == 1) {
+ if (dwRightMost == 1)
+ {
sprintf(version, "%d.%d.%d.%d+dev", dwLeftMost, dwSecondLeft, dwSecondRight, dwRightMost);
sprintf(NSUserAgent, "R2Northstar/%d.%d.%d+dev", dwLeftMost, dwSecondLeft, dwSecondRight);
}
- else {
+ else
+ {
sprintf(version, "%d.%d.%d.%d", dwLeftMost, dwSecondLeft, dwSecondRight, dwRightMost);
sprintf(NSUserAgent, "R2Northstar/%d.%d.%d", dwLeftMost, dwSecondLeft, dwSecondRight);
}