From 0050429654c63ec4c5e2c00bd08220d4e70cfd50 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 15 Jan 2016 22:51:47 +0100 Subject: [PATCH] Various fixes and stuff. --- premake5.lua | 5 +---- src/Components/Modules/Exception.cpp | 18 ++++++++++++++++++ src/Components/Modules/FileSystem.cpp | 3 +++ src/Components/Modules/QuickPatch.cpp | 27 +++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/premake5.lua b/premake5.lua index eda4932d..eaacfbed 100644 --- a/premake5.lua +++ b/premake5.lua @@ -51,7 +51,7 @@ workspace "iw4x" location "./build" objdir "%{wks.location}/obj" targetdir "%{wks.location}/bin/%{cfg.buildcfg}" - configurations { "Normal", "Debug", "DebugStatic", "Release", "ReleaseStatic" } + configurations { "Debug", "DebugStatic", "Release", "ReleaseStatic" } -- VS 2015 toolset only toolset "msc-140" @@ -78,9 +78,6 @@ workspace "iw4x" files { "./src/**.hpp", "./src/**.cpp" } includedirs { "%{prj.location}", "./src" } architecture "x32" - configmap { - ["Normal"] = "Debug" - } -- Pre-compiled header pchheader "STDInclude.hpp" -- must be exactly same as used in #include directives diff --git a/src/Components/Modules/Exception.cpp b/src/Components/Modules/Exception.cpp index a3788975..cb27d29e 100644 --- a/src/Components/Modules/Exception.cpp +++ b/src/Components/Modules/Exception.cpp @@ -49,7 +49,25 @@ namespace Components Exception::Exception() { +#ifndef DEBUG Utils::Hook::Set(0x6D70AC, Exception::SetUnhandledExceptionFilterStub); SetUnhandledExceptionFilter(&Exception::ExceptionFilter); +#endif + + Command::Add("stressTest", [] (Command::Params params) + { + std::string command; + for (int i = 0;; i++) + { + char* mapname = (char*)0x7471D0 + 40 * i; + if (!*mapname) break; + + if(i % 2) command.append(Utils::VA("wait 500;disconnect;wait 500;", mapname)); // Test a disconnect + else command.append(Utils::VA("wait 500;", mapname)); // Test direct map switch + command.append(Utils::VA("map %s;", mapname)); + } + + Command::Execute(command, false); + }); } } diff --git a/src/Components/Modules/FileSystem.cpp b/src/Components/Modules/FileSystem.cpp index 2e960baa..7adff3bc 100644 --- a/src/Components/Modules/FileSystem.cpp +++ b/src/Components/Modules/FileSystem.cpp @@ -90,5 +90,8 @@ namespace Components // ignore 'no iwd files found in main' Utils::Hook::Nop(0x642A4B, 5); + + // Ignore bad magic, when trying to free hunk when it's already cleared + Utils::Hook::Set(0x49AACE, 0xC35E); } } diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index d3984c8a..428b6bf7 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -139,6 +139,33 @@ namespace Components Utils::Hook::Nop(0x4AA89F, 2); Utils::Hook::Nop(0x4AA8A1, 6); + // remove activeAction execution (exploit in mods) + Utils::Hook::Set(0x5A1D43, 0xEB); + + // disable bind protection + Utils::Hook::Set(0x4DACA2, 0xEB); + + // require Windows 5 + Utils::Hook::Set(0x467ADF, 5); + Utils::Hook::Set(0x6DF5D6, '5'); + + // disable 'ignoring asset' notices + Utils::Hook::Nop(0x5BB902, 5); + + // disable migration_dvarErrors + Utils::Hook::Set(0x60BDA7, 0); + + // allow joining 'developer 1' servers + Utils::Hook::Set(0x478BA2, 0xEB); + + // fs_game fixes + Utils::Hook::Nop(0x4A5D74, 2); // remove fs_game profiles + Utils::Hook::Set(0x4081FD, 0xEB); // defaultweapon + + // Filter log (initially com_logFilter, but I don't see why that dvar is needed) + Utils::Hook::Nop(0x647466, 5); // 'dvar set' lines + Utils::Hook::Nop(0x5DF4F2, 5); // 'sending splash open' lines + // intro stuff Utils::Hook::Nop(0x60BEE9, 5); // Don't show legals Utils::Hook::Set(0x60BED2, "unskippablecinematic IW_logo\n");