From cb9895a38ebdd08e7dfdfd01bb49396d063e56e3 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 21 Jul 2017 04:30:15 -0400 Subject: [PATCH] Begin transition to the new ModLoader paradigm. Begin cleaning up code. --- .gitignore | 4 + CommonAPI/Common.suo | Bin 8192 -> 0 bytes CommonAPI/Common/Common.vcxproj | 253 +++--- CommonAPI/Common/Common.vcxproj.filters | 286 +++--- .../Common/Release/Common.lastbuildstate | 4 +- CommonAPI/Common/include/DXAPI/AIConnection.h | 24 + CommonAPI/Common/include/DXAPI/DXAPI.h | 14 +- .../Common/include/DXAPI/GameConnection.h | 14 +- CommonAPI/Common/include/DXAPI/Move.h | 7 +- CommonAPI/Common/include/DXAPI/SimObject.h | 2 + .../Common/include/ModLoader/ModLoader.h | 39 + .../Common/source/DXAPI/AIConnection.cpp | 13 + CommonAPI/Common/source/DXAPI/DXAPI.cpp | 10 + .../Common/source/DXAPI/GameConnection.cpp | 8 +- CommonAPI/Common/source/DXAPI/SimObject.cpp | 3 +- Everything.sln | 118 +-- Everything.suo | Bin 17920 -> 0 bytes Mod Sources/BaseMod/BaseMod.suo | Bin 13824 -> 0 bytes Mod Sources/BaseMod/BaseMod/BaseMod.vcxproj | 1 + Mod Sources/Bullet/BulletDLL.suo | Bin 8192 -> 0 bytes Mod Sources/PythonMod/PythonMod.sln | 20 + .../Debug/PythonMod.dll.embed.manifest.res | Bin 0 -> 68 bytes .../PythonMod/Debug/PythonMod_manifest.rc | Bin 0 -> 210 bytes .../PythonMod/PythonMod/PythonMod.vcxproj | 88 ++ .../PythonMod/PythonMod.vcxproj.user | 3 + .../PythonMod/PythonMod/source/BaseMod.cpp | 7 + .../PythonMod/PythonMod/source/dllmain.cpp | 282 ++++++ Mod Sources/RandomMod/BaseMod.v12.suo | Bin 21504 -> 0 bytes Mod Sources/RandomMod/RandomMod.suo | Bin 25600 -> 0 bytes .../RandomMod/RandomMod/source/BaseMod.cpp | 22 +- Mod Sources/TSExtension/TSExtension.suo | Bin 38912 -> 0 bytes .../TSExtension/TSExtension.vcxproj | 186 ++-- .../TSExtension/source/dllmain.cpp | 837 +++++++----------- Mod Sources/Watchdog/Watchdog.suo | Bin 39424 -> 0 bytes ModLoader/Modloader.suo | Bin 15872 -> 0 bytes .../Release/Modloader.lastbuildstate | 4 +- ModLoader/Modloader/include/stdafx.h | 2 - ModLoader/Modloader/source/modLoader.cpp | 120 ++- ModLoader/Modloader/source/t2dll.cpp | 25 +- 39 files changed, 1429 insertions(+), 967 deletions(-) delete mode 100644 CommonAPI/Common.suo create mode 100644 CommonAPI/Common/include/DXAPI/AIConnection.h create mode 100644 CommonAPI/Common/include/ModLoader/ModLoader.h create mode 100644 CommonAPI/Common/source/DXAPI/AIConnection.cpp delete mode 100644 Everything.suo delete mode 100644 Mod Sources/BaseMod/BaseMod.suo delete mode 100644 Mod Sources/Bullet/BulletDLL.suo create mode 100644 Mod Sources/PythonMod/PythonMod.sln create mode 100644 Mod Sources/PythonMod/PythonMod/Debug/PythonMod.dll.embed.manifest.res create mode 100644 Mod Sources/PythonMod/PythonMod/Debug/PythonMod_manifest.rc create mode 100644 Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj create mode 100644 Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj.user create mode 100644 Mod Sources/PythonMod/PythonMod/source/BaseMod.cpp create mode 100644 Mod Sources/PythonMod/PythonMod/source/dllmain.cpp delete mode 100644 Mod Sources/RandomMod/BaseMod.v12.suo delete mode 100644 Mod Sources/RandomMod/RandomMod.suo delete mode 100644 Mod Sources/TSExtension/TSExtension.suo delete mode 100644 Mod Sources/Watchdog/Watchdog.suo delete mode 100644 ModLoader/Modloader.suo diff --git a/.gitignore b/.gitignore index 0ddbc61..9ae578a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ *.idb *.unsuccessfulbuild *.lastbuildstate +*.cache +*.ipch +*.exp +*.suo diff --git a/CommonAPI/Common.suo b/CommonAPI/Common.suo deleted file mode 100644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a{0TqISTlilaGhm*J!mdAUbv6LVG3>FkKoG_%Uv_DYCx8I;XglOHhVm>H zR{oRd8xIEdy^C0}N}an}iA_i4IY?>ch*4yQOvdjK-y_{no&~_rE=P?dLCN zH+??2eni%N-(ml~x^wLE+`E6yes^V#h>!{qoW+- z;52k$nzI-BP8mDc>AD%dwZ;b@@s1>A1ccH!k` zg8>%WI|(g{@I`O_d$5CSuvQF4{-NwoRBgom6Y%#)#j5MMg(>mQ2srTN$bQtHd#gSwNKC40R#W z^B;^U{4aq7T&mA=&6iO-FX{NKD;X}z$xtF_zOfdBE| z4DJDv{+~tv|1yr;jWK}VAeoidL%>G-zZ-J(`AaF$ - - - - Debug - Win32 - - - Release - Win32 - - - - {9B3A3214-400B-4245-85FD-EA12D5F791D4} - Win32Proj - Common - - - - StaticLibrary - true - Unicode - - - StaticLibrary - false - true - Unicode - - - - - - - - - - - - - true - include;$(IncludePath) - Common - $(SolutionDir) - - - false - include;$(IncludePath) - $(SolutionDir) - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {9B3A3214-400B-4245-85FD-EA12D5F791D4} + Win32Proj + Common + + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + + true + include;$(IncludePath) + Common + $(SolutionDir) + + + false + include;$(IncludePath) + $(SolutionDir) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CommonAPI/Common/Common.vcxproj.filters b/CommonAPI/Common/Common.vcxproj.filters index 2bbd762..07209f1 100644 --- a/CommonAPI/Common/Common.vcxproj.filters +++ b/CommonAPI/Common/Common.vcxproj.filters @@ -1,135 +1,153 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {4e8c3150-9f1d-4cbf-84f2-8dc65b11689f} + + + {cbe0f5ac-7a8c-42ef-872a-f792f27a0cbb} + + + {dac4c4a7-1792-4304-bbc5-7254e1795b10} + + + + + Header Files + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\DXAPI + + + Header Files\ModLoader + + + + + Source Files + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + + Source Files\DXAPI + + \ No newline at end of file diff --git a/CommonAPI/Common/Release/Common.lastbuildstate b/CommonAPI/Common/Release/Common.lastbuildstate index 88c2954..0f58d24 100644 --- a/CommonAPI/Common/Release/Common.lastbuildstate +++ b/CommonAPI/Common/Release/Common.lastbuildstate @@ -1,2 +1,2 @@ -#v4.0:v100 -Release|Win32|C:\t2cpp\T2-CPP-master\| +#v4.0:v100 +Release|Win32|C:\Documents and Settings\NobodyBla\Desktop\T2AI\T2-CPP-master\| diff --git a/CommonAPI/Common/include/DXAPI/AIConnection.h b/CommonAPI/Common/include/DXAPI/AIConnection.h new file mode 100644 index 0000000..0e042eb --- /dev/null +++ b/CommonAPI/Common/include/DXAPI/AIConnection.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +namespace DX +{ + class AIConnection : public GameConnection + { + public: + AIConnection(unsigned int obj); + + //! Whether or not this bot should use custom moves. + bool mUseCustomMoves; + + //! The custom move for this bot. + Move mCustomMove; + + /** + * @brief Computes the current move for this bot. + */ + void generateMove(void); + }; +} // End NameSpace DX diff --git a/CommonAPI/Common/include/DXAPI/DXAPI.h b/CommonAPI/Common/include/DXAPI/DXAPI.h index 0f89eed..a0ab250 100644 --- a/CommonAPI/Common/include/DXAPI/DXAPI.h +++ b/CommonAPI/Common/include/DXAPI/DXAPI.h @@ -38,13 +38,25 @@ namespace DX typedef void* UnresolvedObject; const char *GetModPaths(void); + bool IsFile(const char *filename); - const char * StringTableInsert(const char * str,bool casesensitive) ; + + const char * StringTableInsert(const char * str,bool casesensitive); + bool GetRelativePath(const char *filename, char *ret, int buffer_length); + bool GetRunningMod(char *ret, int buffer_length); + bool memPatch(unsigned int addr, unsigned char * data, unsigned int size); + bool memToHex(unsigned int addr, char * dst, int size, bool spaces); + unsigned int memToUInt(unsigned int addr); + float memToFloat(unsigned int addr); + bool SanitizeFileName(char *ret, int buffer_length); + + //! Initializes all hooks for the engine. + void initializeHooks(void); } // End NameSpace DX \ No newline at end of file diff --git a/CommonAPI/Common/include/DXAPI/GameConnection.h b/CommonAPI/Common/include/DXAPI/GameConnection.h index a05bb7f..16bb060 100644 --- a/CommonAPI/Common/include/DXAPI/GameConnection.h +++ b/CommonAPI/Common/include/DXAPI/GameConnection.h @@ -7,12 +7,18 @@ namespace DX { + /** + * @brief A class representing an incoming connection to the Tribes 2 server. + */ class GameConnection : public NetConnection { - public: - GameConnection(unsigned int obj); + public: + GameConnection(unsigned int obj); - ShapeBase getControlObject(void); - + /** + * @brief Gets the control object this game connection is controlling. + * @return The shapebase instance being controlled. + */ + ShapeBase getControlObject(void); }; } // End NameSpace DX diff --git a/CommonAPI/Common/include/DXAPI/Move.h b/CommonAPI/Common/include/DXAPI/Move.h index 0dd7b59..8a6cba8 100644 --- a/CommonAPI/Common/include/DXAPI/Move.h +++ b/CommonAPI/Common/include/DXAPI/Move.h @@ -6,7 +6,9 @@ #include namespace DX { - + /** + * @brief Move structure. + */ struct Move { int px; int py; @@ -26,13 +28,14 @@ namespace DX bool triggers[6]; }; + struct AIMove { unsigned int id; Move move; bool used; }; + float clampFloat(float in); float clampMove(float in); void generateNullMove(Move * ret); - }; \ No newline at end of file diff --git a/CommonAPI/Common/include/DXAPI/SimObject.h b/CommonAPI/Common/include/DXAPI/SimObject.h index 21d2bf1..8f6e11c 100644 --- a/CommonAPI/Common/include/DXAPI/SimObject.h +++ b/CommonAPI/Common/include/DXAPI/SimObject.h @@ -15,5 +15,7 @@ namespace DX const unsigned int &identifier; const unsigned int base_pointer_value; const unsigned int &dataBlock; + + char& mName; }; } // End NameSpace DX \ No newline at end of file diff --git a/CommonAPI/Common/include/ModLoader/ModLoader.h b/CommonAPI/Common/include/ModLoader/ModLoader.h new file mode 100644 index 0000000..7c83af6 --- /dev/null +++ b/CommonAPI/Common/include/ModLoader/ModLoader.h @@ -0,0 +1,39 @@ +/** + * @brief ModLoader main include file. + */ + +namespace ModLoader +{ + //! A pointer type for a server process function. + typedef void (*ServerProcessPointer)(unsigned int); + + typedef void (*InitializeModPointer)(); + + typedef void (*DeinitializeModPointer)(); + + typedef const char* (*GetManagementNamePointer)(); + + //! A pointer type for reading the supported mod loader version for this mod. + typedef unsigned int (*GetModLoaderVersionPointer)(); + + class ModLoaderCallables + { + public: + //! Hook function that is called when the mod is loaded. + InitializeModPointer mInitializeModPointer; + + //! Hook function that is called when the mod is unloaded. + DeinitializeModPointer mDeinitializeModPointer; + + //! Hook function for the server update loop. + ServerProcessPointer mServerProcessPointer; + + //! Function called to get the name of the script object to use for registering mod management functions. + GetManagementNamePointer mGetManagementName; + }; + + /** + * @brief Returns the hook information from the loaded mod. + */ + typedef ModLoaderCallables* (*GetModCallablesPointer)(); +} \ No newline at end of file diff --git a/CommonAPI/Common/source/DXAPI/AIConnection.cpp b/CommonAPI/Common/source/DXAPI/AIConnection.cpp new file mode 100644 index 0000000..f8f6b06 --- /dev/null +++ b/CommonAPI/Common/source/DXAPI/AIConnection.cpp @@ -0,0 +1,13 @@ +#include + +namespace DX +{ + AIConnection::AIConnection(unsigned int obj) : mUseCustomMoves(false), GameConnection(obj) + { + } + + void AIConnection::generateMove(void) + { + + } +} // End NameSpace DX \ No newline at end of file diff --git a/CommonAPI/Common/source/DXAPI/DXAPI.cpp b/CommonAPI/Common/source/DXAPI/DXAPI.cpp index 6040e79..e89f69c 100644 --- a/CommonAPI/Common/source/DXAPI/DXAPI.cpp +++ b/CommonAPI/Common/source/DXAPI/DXAPI.cpp @@ -33,6 +33,7 @@ namespace DX } return retval; } + bool memPatch(unsigned int addr, unsigned char * data, unsigned int size){ DWORD oldprotect=0; DWORD oldnewprotect=0; @@ -41,6 +42,7 @@ namespace DX VirtualProtect((void *)addr,size,oldprotect,&oldnewprotect); return true; } + float memToFloat(unsigned int addr){ DWORD oldprotect=0; DWORD oldnewprotect=0; @@ -51,6 +53,7 @@ namespace DX VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect); return true; } + unsigned int memToUInt(unsigned int addr){ DWORD oldprotect=0; DWORD oldnewprotect=0; @@ -61,6 +64,7 @@ namespace DX VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect); return true; } + bool memToHex(unsigned int addr, char * dst, int size, bool spaces=false){ DWORD oldprotect=0; DWORD oldnewprotect=0; @@ -80,6 +84,7 @@ namespace DX strncpy(dst,outstr,255); return true; } + const char *GetModPaths(void) { int pointer = *(int*)0x9E8690; @@ -183,4 +188,9 @@ namespace DX return was_dirty; } + + void initializeHooks(void) + { + + } } \ No newline at end of file diff --git a/CommonAPI/Common/source/DXAPI/GameConnection.cpp b/CommonAPI/Common/source/DXAPI/GameConnection.cpp index 312a9e0..601840f 100644 --- a/CommonAPI/Common/source/DXAPI/GameConnection.cpp +++ b/CommonAPI/Common/source/DXAPI/GameConnection.cpp @@ -13,19 +13,19 @@ namespace DX __asm { mov ecx, my_ptr; - add ecx, 3404928; + add ecx, 0x33f480; test ecx, ecx; mov edx, ecx; jz loc_5FDA60_sim; add edx, 4294967136; -loc_5FDA60_sim: - mov eax, [edx + 33372]; + loc_5FDA60_sim: + mov eax, [edx + 0x825c]; test eax, eax; jnz got_valid_ptr; -got_valid_ptr: + got_valid_ptr: mov result_ptr, eax; } diff --git a/CommonAPI/Common/source/DXAPI/SimObject.cpp b/CommonAPI/Common/source/DXAPI/SimObject.cpp index 2c838b9..fef31bc 100644 --- a/CommonAPI/Common/source/DXAPI/SimObject.cpp +++ b/CommonAPI/Common/source/DXAPI/SimObject.cpp @@ -7,7 +7,7 @@ namespace DX { SimObject::SimObject(unsigned int obj) : identifier(*(unsigned int*)(obj + 32)), fieldDictionary(*(unsigned int*)(obj + 0x2C)), dataBlock(*(unsigned int*)(obj + 0x248)), - base_pointer_value(obj) + base_pointer_value(obj), mName(*(char*)(obj + 4)) { } @@ -45,6 +45,7 @@ namespace DX return result; } + const char *SimObject::getFieldValue(const char *slotname) { void * getfieldvalueptr=(void *)0x435210; diff --git a/Everything.sln b/Everything.sln index c09b743..8164e73 100644 --- a/Everything.sln +++ b/Everything.sln @@ -1,56 +1,62 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "CommonAPI\Common\Common.vcxproj", "{9B3A3214-400B-4245-85FD-EA12D5F791D4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modloader", "ModLoader\Modloader\Modloader.vcxproj", "{10159605-BFF5-496F-8C23-0A1FB9850E55}" - ProjectSection(ProjectDependencies) = postProject - {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RandomMod", "Mod Sources\RandomMod\RandomMod\RandomMod.vcxproj", "{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}" - ProjectSection(ProjectDependencies) = postProject - {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TSExtension", "Mod Sources\TSExtension\TSExtension\TSExtension.vcxproj", "{08220905-AEC1-49C9-84E6-78672F9EF5F1}" - ProjectSection(ProjectDependencies) = postProject - {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WatchDog", "Mod Sources\Watchdog\Watchdog\Watchdog.vcxproj", "{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}" - ProjectSection(ProjectDependencies) = postProject - {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.ActiveCfg = Debug|Win32 - {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.Build.0 = Debug|Win32 - {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.ActiveCfg = Release|Win32 - {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.Build.0 = Release|Win32 - {10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.ActiveCfg = Debug|Win32 - {10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.Build.0 = Debug|Win32 - {10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.ActiveCfg = Release|Win32 - {10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.Build.0 = Release|Win32 - {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.Build.0 = Debug|Win32 - {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.ActiveCfg = Release|Win32 - {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.Build.0 = Release|Win32 - {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.ActiveCfg = Debug|Win32 - {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.Build.0 = Debug|Win32 - {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.ActiveCfg = Release|Win32 - {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.Build.0 = Release|Win32 - {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.Build.0 = Debug|Win32 - {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.ActiveCfg = Release|Win32 - {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "CommonAPI\Common\Common.vcxproj", "{9B3A3214-400B-4245-85FD-EA12D5F791D4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modloader", "ModLoader\Modloader\Modloader.vcxproj", "{10159605-BFF5-496F-8C23-0A1FB9850E55}" + ProjectSection(ProjectDependencies) = postProject + {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RandomMod", "Mod Sources\RandomMod\RandomMod\RandomMod.vcxproj", "{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}" + ProjectSection(ProjectDependencies) = postProject + {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TSExtension", "Mod Sources\TSExtension\TSExtension\TSExtension.vcxproj", "{08220905-AEC1-49C9-84E6-78672F9EF5F1}" + ProjectSection(ProjectDependencies) = postProject + {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WatchDog", "Mod Sources\Watchdog\Watchdog\Watchdog.vcxproj", "{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}" + ProjectSection(ProjectDependencies) = postProject + {9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PythonMod", "Mod Sources\PythonMod\PythonMod\PythonMod.vcxproj", "{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.ActiveCfg = Debug|Win32 + {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.Build.0 = Debug|Win32 + {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.ActiveCfg = Release|Win32 + {9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.Build.0 = Release|Win32 + {10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.ActiveCfg = Debug|Win32 + {10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.Build.0 = Debug|Win32 + {10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.ActiveCfg = Release|Win32 + {10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.Build.0 = Release|Win32 + {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.ActiveCfg = Debug|Win32 + {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.Build.0 = Debug|Win32 + {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.ActiveCfg = Release|Win32 + {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.Build.0 = Release|Win32 + {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.ActiveCfg = Debug|Win32 + {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.Build.0 = Debug|Win32 + {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.ActiveCfg = Release|Win32 + {08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.Build.0 = Release|Win32 + {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.ActiveCfg = Debug|Win32 + {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.Build.0 = Debug|Win32 + {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.ActiveCfg = Release|Win32 + {1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.Build.0 = Release|Win32 + {2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Debug|Win32.ActiveCfg = Debug|Win32 + {2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Debug|Win32.Build.0 = Debug|Win32 + {2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Release|Win32.ActiveCfg = Release|Win32 + {2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Everything.suo b/Everything.suo deleted file mode 100644 index 478ae41125ff101f9517c5755118c9fe2e9ac0de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17920 zcmeHOdyrdI8Nb^WOIs|Z7OS(Xrsk}QjNBKxWc?4DeClSOCqh90x1{76QiurvfJc zCjut{i-9Eo?PDpf%YajW(}2?f8^CA8hw1QWV6&p*lS5mClr*jxWfxkd`g9_!Mshy0 z!p|0Dm%Pxq`8O@1-nmBQ2q@~xcBKo{2ayXYBNg5<`SFSHK$1SMlb@Epqx~}VDp4h? z>`*o+30!l^7JO^qNtS1gY9+r{Dl=NxcWD3B(x(q)|6=L|-C-pnXl6|wH0UCRk|3~C zaVieQRF?6RN#CnLpM92nvs(J}*-}xm|FKQz2j~N28F`fX!v0U6Kp((o^Z~NYHsr1S zpSqzBDD40A6Z8Q#;B;U)umV^KoB^B(oCTZ>oCB-^sDV~M1?<3ifCF#>E}#u?10J9q zAWxm;$d`*pt|s$;)nBM}a-Sr-9D^p9Orcp5JrAQ`wDAJbUehm)ySm4iwdt z-VDsCss5D8EhqthW4tmQGXq~&^kswEKz=Ba(Xv`P7tJN~bR-(v5gpQ6ZGBoMi~F@s zhh2PHZGn6;m(OTx(^@{4i6&cZk^De15nHeA>eY8>>9qrnwn5Ke$Dq?0_c)?$(bAPd`Q4OyZ>#z8K%IuQ6HabNr$2 z9flSX;2>Q=3ul5peIWg2we;Cz$TO3beptvHhdBN# zbi&7<1OB>E9z!i1PjvWAT6!PKvXCl@U)Z3>9P)9L>A2%qY6tp3N5`8}_)aSwxbH$s zgmB%7_wk;+Ac^OLxL1^0-bb8KUV8fGq|)}c3(^ljKOA*RC)z*zlMSfW{x}}VH(Kd; zqm|hzj6=7g)zWA?9iv$(AJAHd{VxFVUXuYU{o?+okQ2$dadks}%FXzwTKPF&lKr3l zCI^`_kdziXVd*k5)?k4-VX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y;dx6-^;?@J5PmwVqS{S=0I(;@x# zOGy^osf50sM?d#ZB<9VT1?3lbFZMjYOP}<^!uKo8vJ?eebfBQh^e|~p%b@eH${{rF<6QckC diff --git a/Mod Sources/BaseMod/BaseMod/BaseMod.vcxproj b/Mod Sources/BaseMod/BaseMod/BaseMod.vcxproj index ccff6a4..cfc94b0 100644 --- a/Mod Sources/BaseMod/BaseMod/BaseMod.vcxproj +++ b/Mod Sources/BaseMod/BaseMod/BaseMod.vcxproj @@ -14,6 +14,7 @@ {2A498B2D-84B2-4BBF-9532-EA17E5BA51BB} Win32Proj BaseMod + BaseMod diff --git a/Mod Sources/Bullet/BulletDLL.suo b/Mod Sources/Bullet/BulletDLL.suo deleted file mode 100644 index 78e98d6471c77a25f298357ae335d77938efcfab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeHMO^g&p6t3k*egzRkMbv>^{+DqUSXaeG*q!A^XR{+a%u2E`>6z&nn{B!`-95mn zc+e0M6BD?2)2Pvl9taoja`Uu=#EU067_NHrAgte4-M!N^J3T!=2Z+4M>#FXmuJ>Nm ztM9$)xjDP;k8iJUx-CLk@Abm!ez-=9;enF9)vzuLM5{UJYIY=6aJK)1yBFCxwZhBNAdn7$_|~o3)>~?JMfr@#8?+NnE- zGM|0DIr-h1Ew5m@o1(vl=^&zNm@TI!&oRvk;xdlT7eLD!1!s53cpN;L)xsr}{t@<6$-uhgGX z_AASzFkj-5>Zn$PmNYXdRj8=ed?ja^`h;eb%=30KtvE_fo3@i# z%`lXLuF9K{3yx~oT0zq_XC|4YrZ%1w)jb(mQ7yhV?wFQJJ6F~6Dcarw(TGpL!{QAw zIgeg8>O}T}#1*3ZC~&SQjsay`Kz0;Tl4H_5? zW??(z(-z7mdBa8)%%^<(58HoK+FTOjkX^-GP?soze3`FtytwiidWSskFG9*$$YAWJ z*W|=Lu@~Ny#cvW`V~P^iIH(PK4dE>vKNW9HMyc1ZjWMSa#NG5I*xd(iR#CzHDX=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onMod/PythonMod/Debug/PythonMod_manifest.rc new file mode 100644 index 0000000000000000000000000000000000000000..29735e9e05c51c6dcd02dedf30b804bf5bd122a0 GIT binary patch literal 210 zcmZ9Fy9&Zk5JXQc_zxjviU`3U5Fa3DB8g%n1jYCOHHBLE^Xf66g)DoS9nQ>sJre>t zM80DRGA8txt20v7(#;uCGF7GeBd + + + + Debug + Win32 + + + Release + Win32 + + + + {2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3} + Win32Proj + BaseMod + PythonMod + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + true + include;$(IncludePath) + + + false + include;..\..\..\CommonAPI\Common\include;$(IncludePath) + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions) + C:\Python27\include + + + Windows + true + C:\Python27\libs\python27.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions) + C:\Python27\include + + + Windows + true + true + true + C:\Python27\libs\python27.lib;%(AdditionalDependencies) + + + + + + + + + + \ No newline at end of file diff --git a/Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj.user b/Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Mod Sources/PythonMod/PythonMod/source/BaseMod.cpp b/Mod Sources/PythonMod/PythonMod/source/BaseMod.cpp new file mode 100644 index 0000000..4982535 --- /dev/null +++ b/Mod Sources/PythonMod/PythonMod/source/BaseMod.cpp @@ -0,0 +1,7 @@ +// BaseMod.cpp : Defines the exported functions for the DLL application. +// + +extern "C" +{ + +} diff --git a/Mod Sources/PythonMod/PythonMod/source/dllmain.cpp b/Mod Sources/PythonMod/PythonMod/source/dllmain.cpp new file mode 100644 index 0000000..d971f1c --- /dev/null +++ b/Mod Sources/PythonMod/PythonMod/source/dllmain.cpp @@ -0,0 +1,282 @@ +// dllmain.cpp : Defines the entry point for the DLL application. + +#include +#include +#include + +#include +#include + +#include + + +static int aienabled=0; +unsigned int oldaiaddr=0x0; +static unsigned int tmpobjptr=0; +static DX::Move curmove; + + +static char test[100]; +static DX::Move *mechchangedmove; +static char test2[100]; +static void * moveptrmech; +unsigned int updatemoveretptr=0x5d2d7c; +float maxrot=2.9f; +float minrot=-2.9f; +static unsigned int playerptr=0x0; +static float newTurn = 0.1f; +static float turnStrength = 1.0f; + +float MECH_TURNING_SPEED=0.4f; +static unsigned int playerptr2; + +extern "C" +{ + static DX::AIMove aimoves[1024]; +} + +__declspec(naked) void updateMoveHook() +{ + // this gets run from 0x5D2D6E + + __asm { + mov playerptr,ebx + mov eax,[ebp+0x8] + mov moveptrmech,eax + pusha + }; + + MECH_TURNING_SPEED=0.4f; + + if (playerptr!=0) { + playervar=&DX::Player(playerptr); + mechchangedmove=(DX::Move*) moveptrmech; + //_snprintf (command,255,"return(%d.getDataBlock());",playervar->identifier); + //strncpy(buf,Con::evaluate(command,false,NULL,true),255); + if (playervar->dataBlock!=NULL) { + + playerdatavar = &DX::SimObject(playervar->dataBlock); + //Con::printf("Datablock is %s\n",buf); + if (playerdatavar->base_pointer_value!=0) + { + strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechControlEnabled",false))); + Con::printf("mechControlEnabled: %s",buf); + + if ((mechchangedmove)->freelook && ((mechchangedmove)->y>0.0) && dAtob(buf)) + { + //sprintf (command,"return (%d.getDataBlock().mechTurnSpeed);",playervar->identifier); + strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechTurnSpeed",false))); + Con::printf("mechTurnSpeed: %s",buf); + MECH_TURNING_SPEED=atof(buf); + + // FIXME: The 3 here should reference the datablock's maximum turning angle -- we're essentially normalizing our rotation here. + float turnStrength = playervar->headRotationZ / 3; + // Use whatever is leftover in our forward movement + float forwardStrength = 1 - fabs(turnStrength); + // Calculate a new turn value that we use for both the main body and the head. + float newTurn = turnStrength * MECH_TURNING_SPEED; + float newHeadTurn = turnStrength * (MECH_TURNING_SPEED/20); + + (mechchangedmove)->y = forwardStrength; + (mechchangedmove)->x += turnStrength; + + // FIXME: Is the yaw value definitely in radians? + playervar->mRotZ += newTurn + (mechchangedmove)->yaw; + + // Now, we must translate the turning strength into an appropriate subtraction for our + // head rotation. + playervar->headRotationZ += -newTurn; + + (mechchangedmove)->pitch = 0; + (mechchangedmove)->yaw = 0; + (mechchangedmove)->roll = 0; + (mechchangedmove)->freelook = true; + } + } + } + } + __asm + { + popa + mov ebx,playerptr + mov eax,[ebp+8] + mov edx,[eax] + mov [ebx+0x894],edx + mov eax,[eax+4] + jmp [updatemoveretptr] + }; +} + +/* Return the number of arguments of the application command line */ +static PyObject* +ts_tseval(PyObject *self, PyObject *args) +{ + char *input; + if(!PyArg_ParseTuple(args, "s:tseval",&input)) + return NULL; + std::string inputstr=std::string(input); + //Con::printf(inputstr.c_str()); + return Py_BuildValue("s",Con::evaluate(inputstr.c_str(),false,NULL,false)); +} + + +static PyMethodDef TSMethods[] = { + {"tseval", ts_tseval, METH_VARARGS, + "Evaluates TorqueScript."}, + {NULL, NULL, 0, NULL} +}; + +DX::AIMove * getAIMovePtr(unsigned int id) { + int moveindex=0; + bool foundindex=false; + for (int x=0; x<1024; x++) { + if (aimoves[x].id==id && aimoves[x].used==true) { + moveindex=x; + foundindex=true; + break; + } + if (aimoves[x].used==false) { + moveindex=x; + break; + } + } + if (foundindex==true) { + return &aimoves[moveindex]; + } else { + aimoves[moveindex].id=id; + aimoves[moveindex].used=true; + DX::generateNullMove(&(aimoves[moveindex].move)); + return &aimoves[moveindex]; + } +} + +static unsigned int updatemovehookptr = (unsigned int)updateMoveHook; + +DX::Move tmpmove; + +bool consetMove(Linker::SimObject *obj, S32 argc, const char *argv[]) { +// setMove(%aicon, x, y, z, yaw, pitch, roll); + unsigned int aiconid = atoi(argv[1]); + DX::AIMove * aimove = getAIMovePtr(aiconid); + aimove->move.x=DX::clampFloat(std::stof(argv[2])); + aimove->move.y=DX::clampFloat(std::stof(argv[3])); + aimove->move.z=DX::clampFloat(std::stof(argv[4])); + aimove->move.yaw=DX::clampMove(std::stof(argv[5])); + aimove->move.pitch=DX::clampMove(std::stof(argv[6])); + aimove->move.roll=DX::clampMove(std::stof(argv[7])); + //Con::printf ("Set move variables for %d to x:%f y:%f z:%f yaw:%f pitch:%f roll:%f\n",aimove->id,aimove->move.x,aimove->move.y,aimove->move.z,aimove->move.yaw,aimove->move.pitch,aimove->move.roll); + return true; +} + +newAIMoveListGeneratorPtr gen; + + +typedef void (__thiscall *newAIMoveListGeneratorPtr)(void*, DX::Move** moves, unsigned int * moveCount); + +bool consetTrigger(Linker::SimObject *obj, S32 argc, const char *argv[]) { + unsigned int aiconid = atoi(argv[1]); + unsigned int index = atoi(argv[2]); + if (index < 6) { + DX::AIMove * aimove = getAIMovePtr(aiconid); + bool value = dAtob(argv[3]); + aimove->move.triggers[index]=value; + return true; + } + return false; +} + + +bool conDisableNewAI(Linker::SimObject *obj, S32 argc, const char *argv[]) + { + if (aienabled==1) { + Py_Finalize(); + (*((unsigned int *)0x75e360))=(unsigned int)oldaiaddr; + aienabled=0; + return true; + } + return false; + } + bool conEnableNewAI(Linker::SimObject *obj, S32 argc, const char *argv[]) + { + if (aienabled==0) { + Py_Initialize(); + Py_InitModule("ts", TSMethods); + oldaiaddr=(*((unsigned int *)0x75e360)); + gen=(newAIMoveListGeneratorPtr)newAIMoveListGenerator; + (*((unsigned int *)0x75e360))=(unsigned int)(gen); + aienabled=1; + return true; + } + return false; + } + +__declspec(dllexport) void __fastcall newAIMoveListGenerator(void* This, void* notUsed, DX::Move** moves, unsigned int* moveCount) { + tmpobjptr=(unsigned int)This; + + unsigned int * origobjptr; + origobjptr=(unsigned int *) tmpobjptr; + DX::AIMove * aimove; + DX::GameConnection * aiconn; + + //Con::printf ("Possible offsets for ID starting at 0x4\n"); + if (origobjptr !=0 ) + { + //unsigned int * idptr; + //unsigned int offset=0x4; + //for (offset=0x4; offset<0x100; offset+=0x4) { + + //idptr=(unsigned int *)((* (origobjptr))+offset); + //Con::printf ("Offset: %08X Addr: %08X Data: %d",offset, idptr, *idptr); + + //} + aiconn = &DX::GameConnection((unsigned int)origobjptr+0xA0); + aimove = getAIMovePtr(aiconn->identifier); + unsigned int ident=aiconn->identifier; + printf("%d\n",ident); + char movecallback[120]=""; + sprintf_s<120>(movecallback,"AIMoveCallback(%d)\n",ident); + //FILE *f=fopen("AI.py","rb"); + PyRun_SimpleString((std::string("import ts\nfrom ai import AIMoveCallback\nimport ai\n")+std::string(movecallback)).c_str()); + //Con::evaluate(movecallback,false,NULL,NULL); + //Con::printf ("BasePointer: %08X", aiconn.base_pointer_value); + //Con::printf ("Ecx Value: %08X", origobjptr); + //Con::printf("ID: %d\n",aiconn.identifier); + //Con::evaluate ("listPlayers();",true,NULL,NULL); + + //Con::printf("orig: %08X obj: %08X\n",origobjptr,0xBADABEEB); + //Con::printf("Move processed for %08X\n",(aicon.identifier)); + } + //memcpy (&tmpmove,&(aimove->move),sizeof(DX::Move)); + //DX::generateNullMove(&(aimove->move)); + *moves = &(aimove->move); + *moveCount=1; + return; +} + +__declspec(dllexport) void ModInitialize(void) +{ + Con::addMethodB(NULL,"enableNewAI",&conEnableNewAI,"Enables the new Move Generation code for the AI", 1,4); + Con::addMethodB(NULL,"disableNewAI",&conDisableNewAI,"Disables the new Move Generation code for the AI", 1,4); +} + +__declspec(dllexport) void ServerProcess(unsigned int deltaTime) +{ + +} + + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/Mod Sources/RandomMod/BaseMod.v12.suo b/Mod Sources/RandomMod/BaseMod.v12.suo deleted file mode 100644 index 24d8dc736ff120545c31f3898e5afe0354031e4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21504 zcmeHPYiwM_6&{C#ydV#f1~3#hF9?ZuS+8Glf+72`laRP^Y{#LM1*~_k?R7T0);^3w z9JPvoR!S>TArMkqQ7EW1m5Sg;QQxBd(WZZl_*2wBZKNX9hXg+=wLePS@0)wazI(mC zJG)-na>%jH&fI(F&N=fqXU?2C*Y8hm{_Cr6*IpG4cv##du1&2KH{0&lApZq*y-A4M zk>|Z@Q&UsCy$y)$4Om7!@ELerWsTuVq#W+HUD$ZYPU$^FDE>rU8Im^#5s(jK5P@Kre)r)D~i?dKL15pfjM2a#(R;_2N$UHa6Slr2Ip=#GjmNi%ElV4yEzxT6F2fIjsuWmlK}3Y1;N z9{^>S$T49Z)CEchkVonP%D*Z{9iZ~;L!|@k@=tzL8TL&r@Gcqo47 z5NXKDN07DyJAj9QM}U0yQ7dJ>6ZtOzPgwU(BJH;Fy+}`4c@$k1@Z`7G1Upv#EBIn$ zX!y=!7cYbTvf$G&XUIH&!oZ$lO1Om+^YOlH#2CmAb!CjKk;+ALiFB$f8aopmGU_~i zMkb5vwtBx${?&QH`D8AiG1^i_K9`9m>pWfgfn*|f%sAJZK4YZX2K)_!O@l3i_4V;4 zf3zXGS`t$fSLQntu}nIf9?bdr64`t-*^|r16KS7hVaUi#XL{4=bbiW8ZO^F*1CwCzs9`Z0CAuKP`6i zSFz=(>NVQdOx0woL&E7~(ui^NNOC2+NGhJSR5zRWL!fO@DX2l5&-;CNIV=u{{%P%> zMV>3;fYi%e9Xqj3#Gn;2xHE(&8I*`1&$T0m>rq^Xmw;wF z%vE&=Tt>xNaNmKIB`LY}K&y_6{h}F~wI7_a4Fe*NHVq+{5vTD+4lNy)rAu?>!TQ7b zOa0HZ^c&`Q(^e!n>4#(wN71X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_XF H#{d2wkKNQ2 diff --git a/Mod Sources/RandomMod/RandomMod.suo b/Mod Sources/RandomMod/RandomMod.suo deleted file mode 100644 index 11ae5752c3109d522aaf04f1a1ca8449337c99d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25600 zcmeHP3w#vS)t^KV1w;iaDvFD|A6c`TgqH@*X2V0E1PDRt7Q5NqBuh5C={_(Dq1sB7 zqOH`=ueMgLQa>$z7PYNKiq_hfk1A?gX>C=gMXc6hUqXG+|9@ug?#yOqXENEut-s#= z{rBFPxpU9Ck8|$1=ic3CcAvQSw);-oCuM~>(oxa}M~;<_*4!^anvlZ@l2nQW@xhTJ zN0ghAgyet2e^3j&4_*hN^F{#!0QUDF;8@@oU??yc7y=vz3h((%BFz;NJXU<7ay z@G)Q{Fd8@oI2AYzI33_PIRo*Tz!<;*oCQn<#scGj@xTONA}|S<0!#y@0%gG2fDHNilqq=!-fjia0J^ik7t=PL>9yWuASRFLb=qHSfK9pD8(tna)>o)`Mb9 zS|cq0^=72%q)z35#qX1$fwZ-^_?kS1nYTgmO9`n>S|o)LC#4nm4uL0eKVeefIF&x- zhJ2W0mmgDyQnnZxK(|AxmuV(c9ztk~0Pa``qovXk${%IYDt+qgf&4-cGQ>Wi{8JYQ z9Y7wb2Ppp{A9cVQ^_nz=4iNIseB?*uZ$p~$PyIq2K>4R`pbl^VV*rku6hQgsds_LY zZlDgJ{I3J904V>T1*ijDfE%a)DuF6sIxqt`9}s+;gY>zY>+{rf4Pp;a3wVJ#U@kBZ zm=7!fE&vt+i-5(z$AKllmB3P989+J>h*zlTm547?)2k4FLQQ`X@oF{wDa3v?9Y7oe z*y}8-1#v47R|@2^MP1#AF516&SV zbo1TYR~(qL=ySK6?!0~27^>GEg|})sLV6KO@Gf{e!kA%bDZW-WCcL4hR7-t4ln6zW z{$w~7t@j7o{4Jqrj>b?tf$M5lxl{g3bJV6H$y7X49SxPbfT@7@e<#s9M?*-C0|X-EOhJ zPg3t@)AxX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*ACA3_KkVkO#wzng{f~a88wj)uTV!@vHbhUrW9G$P06~Hoh`v>exO1 zxaO||QJ!c95vxRuqt5=)AKA*#$}-lN?evo?3$lKGuS&9W}R-9K@U+1~d9@3;t&z;a2Pa6zB^2{C#TfHK=|Z>vcnB$9p8o+EH{e zXw8SK{A$jM#U>Z1-jCYmk*1Dv zvU|sKg*2k*t8PP2X{!F+f~USoiks$?cFaN9C-sZmUb0kbtQqln4;_dY&%rzIcSxxOnyAIZU3s5 zHa!%Za>1xO2itbMsv}@$(bZpX!REHY6|d1vGv1hFw*GWs&pKb=`g<}m@RXF*QS&VF za<7cRoc>HDqrtbG_4lt))?T$dbNVw3C@Z&F|4B%e0aok(TjaIwf2dFh8GMue1U#Dp zSf&3W@;vRL$Rpj!Y@gAJf@b_1m246J%p)v0qb;6+)1L?Wph|z|0wJaxg6kYwZ z^?z;+*eYG~6UW!)e9GhdW$9bq9i#4P$aRj*Vl#9%{pi?bf%s#_{QqC5{EwV|Pg!rX zbl*zUKhOB$NU*2BJ~7jO{CAFgf%<1EGB6iMQog+6**+wA27;jhXMc?T|CFbS)}rKc z`QJa4{Mp}Au>a=9O?t+x(!ZB^)q>3HZ|eUop@tS(L@hRN^cJ4Js^&1KZ?6Bzp^)Od zgw==tK)hE?i+?iIkHA9OHU%<vvh0yrF>#Cl7 z_>;q*I`r}x?Wa!PWNQ^`u79Xqje{Ng`!I^zs}^Za-*o>kt^2I%|Mx(fXYC3VgzmLU zzfg2VIlZC(pE3UX&WrJIk?OzfSu?i=Y?U6HIPuS$Z~b6}H?AjP Af&c&j diff --git a/Mod Sources/RandomMod/RandomMod/source/BaseMod.cpp b/Mod Sources/RandomMod/RandomMod/source/BaseMod.cpp index df3d729..6713e20 100644 --- a/Mod Sources/RandomMod/RandomMod/source/BaseMod.cpp +++ b/Mod Sources/RandomMod/RandomMod/source/BaseMod.cpp @@ -2,12 +2,17 @@ // #include "BaseMod.h" - +#include #include "LinkerAPI.h" #include "randomCmds.h" extern "C" { + BASEMOD_API unsigned int getModLoaderVersion(void) + { + return 0; + } + BASEMOD_API void ModInitialize(void) { Con::addMethodS(NULL,"getRandom",&conMRandom,"Random number generation based upon the Mersenne Twister algorithm.",1,3); @@ -18,4 +23,19 @@ extern "C" return; } + + BASEMOD_API const char* getManagementName(void) + { + return "RandomMod"; + } + + BASEMOD_API ModLoader::ModLoaderCallables* getModCallables(void) + { + ModLoader::ModLoaderCallables* result = new ModLoader::ModLoaderCallables(); + result->mInitializeModPointer = ModInitialize; + result->mGetManagementName = getManagementName; + return result; + } + + } \ No newline at end of file diff --git a/Mod Sources/TSExtension/TSExtension.suo b/Mod Sources/TSExtension/TSExtension.suo deleted file mode 100644 index d47eacc830a7463ee1fbcdb56366bd484e99e92d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38912 zcmeHQ34B$>)xSZIMFB-X#R_3jLC7;J5H`unq998o0kx*smzS4?yyT^MFBlZ83s@CV z>xvessAz?X1w~tm3sn6;tx#%R&{plwR&i;q{j~i0seJ$cojbgHZ|;`IOGsKKzw>71 z-nsY8nK|donKN@IyLTP`-kObr-d9XvigJ|l?SY=k(Yos?NE6g>oT79=;wZqk2M!z% z7ZnA`BcT(uz&EICH+0@0Kvw|!yE~vKpafdkO~+97z!8$7!EiMa0cLXz(~NEfKh6)#~h@KfGMk5~NE+uitsAZ3Al zLiwjIkUD^Mq#mIB%W~8KS7>?SlsZ7lKg+Q`vOMLVx`jG`ZA4w6*8!COrvQ|HK0_Tq z`KKPB4xs!~4^RjE0YE*#a+Lo!v^4Y70n`Q50nAemPzO-{nWqk*{4-6UT)zd-%RjH{ z<)3-#2+IF?0On^Ro&_NLGJiheIa<0D@mwu^0pbe*Wq=<7E(Sab;4||PUjq2PmM=#f z1XO7GO2k!wYAwG2aV;RM0jSep5Ks)EJsvA8Lv<2Et=fi<`>BHNo>ji%KK4 zq58??=~D;gVQWMNPz~R-r1? zcrZ~KiG(kxsjrA!8ub+fVu8|{hN!Q&roKK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-}IJZNIZcQc`yG->XqWSa;@gI<^#z8OA z(>6YDcm3muS`V$KZe)I^`At~Uom>o+TNpLFIPhQJwIfk|MBvl#x5Jbb=8!*&|A(@ zA8*gjssFf_ohO+Db+(}VnrZK`cMs{EfBmyf$3Au7uWx4T?+Riicgi?Ue`mCRXF>Cu zPqh(T5Ze3YQK5C`?O)eC?EYfks}H+#fz_Vs$iY?mGOXrX9UUqDcjeD5?4U!NjoZz- z?5f5!lS z7uLZOe%JMX^?!vr+*>GwANwv=q~eyiWhaq$7|#@-HV|2grtx7mu9 zbB*5Vu=Lw|TD(v%^x^JRscUvF-L+#%_odyAzJAn3cYSEZFHYAE)&FRx+3c=cafQ|F zusI@p|K*5pn#$pg0ZE&NeeztVT@|w}*~LOCH%j)&;F_WdE4kf5*1pcdlQnHu9aF z$7TpxytCNhPJ3CnN8D;JiL&;uiI$ZmQ?8XAS>qc3P`zW1uHFV_t zBXaKL#V5nL*vWwQ^-EaI=~)wgE55>c}{C`zS^;~ zE{tVI95>Tmt+mD6}E`c-IK?!GeqHx=MRDKcor>YNuEj4QYb_AI)MTgI8b{hR+E*!A#V diff --git a/Mod Sources/TSExtension/TSExtension/TSExtension.vcxproj b/Mod Sources/TSExtension/TSExtension/TSExtension.vcxproj index cdd2c05..ee235b2 100644 --- a/Mod Sources/TSExtension/TSExtension/TSExtension.vcxproj +++ b/Mod Sources/TSExtension/TSExtension/TSExtension.vcxproj @@ -1,93 +1,95 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - - - - {08220905-AEC1-49C9-84E6-78672F9EF5F1} - Win32Proj - BaseMod - TSExtension - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - false - include;..\..\..\CommonAPI\Common\include;$(IncludePath) - $(SolutionDir)\Mods - - - false - include;..\..\..\CommonAPI\Common\include;$(IncludePath) - $(SolutionDir)\Mods - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - ws2_32.lib;Dnsapi.lib;$(SolutionDir)\Common.lib;%(AdditionalDependencies) - - - - - Level3 - NotUsing - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - true - true - ws2_32.lib;Dnsapi.lib;$(SolutionDir)\Common.lib;%(AdditionalDependencies) - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + {08220905-AEC1-49C9-84E6-78672F9EF5F1} + Win32Proj + BaseMod + TSExtension + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + false + include;..\..\..\CommonAPI\Common\include;$(IncludePath) + $(SolutionDir)\Mods + + + false + include;..\..\..\CommonAPI\Common\include;$(IncludePath) + $(SolutionDir)\Mods + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions) + C:\Python27\include;%(AdditionalIncludeDirectories) + + + Windows + true + ws2_32.lib;Dnsapi.lib;C:\Python27\libs\python27.lib;$(SolutionDir)\Common.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions) + C:\Python27\include;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + ws2_32.lib;Dnsapi.lib;$(SolutionDir)\Common.lib;C:\Python27\libs\python27.lib;%(AdditionalDependencies) + + + + + \ No newline at end of file diff --git a/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp b/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp index 0d870a3..86f861d 100644 --- a/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp @@ -1,505 +1,332 @@ -// dllmain.cpp : Defines the entry point for the DLL application. -#include -#include -#define _USE_MATH_DEFINES -#include -//#define TORNADO_ENABLE -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - -#include -#include -#include -#include - -static DX::Move curmove; -static unsigned int tmpobjptr=0; -static char test[100]; -static DX::Move *mechchangedmove; -static char test2[100]; -static void * moveptrmech; -unsigned int updatemoveretptr=0x5d2d7c; -float maxrot=2.9f; -float minrot=-2.9f; -static unsigned int playerptr=0x0; -static float newTurn = 0.1f; -static float turnStrength = 1.0f; - -extern "C" -{ - static DX::AIMove aimoves[1024]; - static char command[256]=""; - static const char * dataBlock; - static char buf[256]=""; -//#define MECH_TURNING_SPEED 0.4 - - // Maximum radians per 32ms tick -void *readIntptr=(void *)0x43BF10; -void *writeIntptr=(void *)0x43BF60; -void *writeStringptr=(void *)0x43C6D0; -void *readStringptr=(void *)0x43C630; - -int streamReadInt(void * stream,int bitcount) -{ - int retvalue=0x0; - __asm { - mov ecx,stream - push bitcount - call readIntptr - mov retvalue,eax - } - return retvalue; -} - -void streamWriteInt(void * stream,int value,int bitcount) { - __asm { - mov ecx,stream - push bitcount - push value - call writeIntptr - } - return; -} - -void streamWriteString(void * stream,const char * stringvar,int maxlen) { - __asm { - mov ecx,stream - push maxlen - push stringvar - call writeStringptr - } - return; -} - -void streamReadString(void * stream,char *stringvar) { - __asm { - mov ecx,stream - push stringvar - call readStringptr - } - return; -} - -static char fieldnames[127][256]; -static char fieldvalues[127][256]; -static DX::Player *playervar; -static DX::SimObject *playerdatavar; -unsigned int gamebaseretptr=0x5E2A13; -unsigned int gboaparentptr=0x58c1e0; -static DX::GameBase *gb; -static DX::SimObject * gbdb; -static const char * gbfieldvalue; -void __declspec (naked) GameBaseOnAddHook() { - void * gamebaseptr; - __asm { - push ebp - mov ebp,esp - push ebx - push esi - mov esi,ecx - mov gamebaseptr,esi - call [gboaparentptr] - test al,al - jz gboaparentfailed - mov edx,[esi+0x248] - test edx,edx - jnz gboaworked -gboaparentfailed: - lea esp,[ebp-0x8] - xor al,al - pop esi - pop ebx - pop ebp - retn -gboaworked: - pushad - }; - gb = &DX::GameBase((unsigned int)gamebaseptr); - gbdb = &DX::SimObject(gb->dataBlock); - gbfieldvalue=gbdb->getFieldValue(DX::StringTableInsert("subClass",false)); - if (gbfieldvalue!=NULL) { -#ifdef TORNADO_ENABLE - if (stricmp(gbfieldvalue,"tornado")==0) { - - } -#endif - } - __asm { - popad - jmp [gamebaseretptr] - } - - } -void DBpackData(void *stream) { - void* thisptr; - __asm { - mov thisptr,ecx - }; - DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr); - char readcommand[256]=""; - sprintf_s<256>(readcommand,"return getWordCount(%d.extraNetFields);", dbobj.identifier); - - char str[256]=""; - strncpy_s<256>(str,Con::evaluate(readcommand,false,NULL,true), 256); - - Con::printf ("GWC returned %s\n",str); - int realcount=atoi(str); - int i=0; - int counter=0; - for (i; (i<126 && i(readcommand,"return getWord(%d.extraNetFields,%d);",dbobj.identifier,i); - strncpy_s<256>(fieldnames[i],Con::evaluate(readcommand,false,NULL,true), 256); - - Con::printf (fieldnames[i]); - _snprintf_s<256>(readcommand,256,"return(%d.%s);",dbobj.identifier,fieldnames[i]); - strncpy_s<256>(fieldvalues[i],Con::evaluate(readcommand,false,NULL,true), 256); - strcpy_s<256>(buf,dbobj.getFieldValue(DX::StringTableInsert(fieldnames[i],false))); - Con::printf ("fieldvalues[i]:%s GDF: %s\n",fieldvalues[i],buf); - - } - counter=i; - Con::printf("Sending %d extra fields",counter); - streamWriteInt(stream,counter,7); - for (int x=0; x < counter; x++ ) { - streamWriteString(stream,fieldnames[x],254); - streamWriteString(stream,fieldvalues[x],254); - } - -} -void DBunpackData(void *stream) { - void* thisptr; - __asm { - mov thisptr,ecx - }; - - char setcommand[256]=""; - DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr); - int counter=streamReadInt(stream,7); - char buf[256]=""; - Con::printf ("Receiving %d extra fields",counter); - for (int i=0; i < counter; i++) { - streamReadString(stream,buf); - strcpy_s<256>(fieldnames[i],buf); - streamReadString(stream,buf); - strcpy_s<256>(fieldvalues[i],buf); - } - for (int i=0; i < counter; i++ ){ - Con::printf (fieldnames[i]); - Con::printf (fieldvalues[i]); - dbobj.setDataField(DX::StringTableInsert(fieldnames[i],false),NULL,fieldvalues[i]); - //_snprintf (setcommand,255,"%d.%s=\"%s\";",dbobj.identifier,fieldnames[i],fieldvalues[i]); - //Con::evaluate(setcommand,false,NULL,true); - } -} - - -float MECH_TURNING_SPEED=0.4f; -static unsigned int playerptr2; - -__declspec(naked) void updateMoveHook() -{ - // this gets run from 0x5D2D6E - - __asm { - mov playerptr,ebx - mov eax,[ebp+0x8] - mov moveptrmech,eax - pusha - }; - - MECH_TURNING_SPEED=0.4f; - - if (playerptr!=0) { - playervar=&DX::Player(playerptr); - mechchangedmove=(DX::Move*) moveptrmech; - //_snprintf (command,255,"return(%d.getDataBlock());",playervar->identifier); - //strncpy(buf,Con::evaluate(command,false,NULL,true),255); - if (playervar->dataBlock!=NULL) { - - playerdatavar = &DX::SimObject(playervar->dataBlock); - //Con::printf("Datablock is %s\n",buf); - if (playerdatavar->base_pointer_value!=0) - { - strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechControlEnabled",false))); - Con::printf("mechControlEnabled: %s",buf); - - if ((mechchangedmove)->freelook && ((mechchangedmove)->y>0.0) && dAtob(buf)) - { - //sprintf (command,"return (%d.getDataBlock().mechTurnSpeed);",playervar->identifier); - strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechTurnSpeed",false))); - Con::printf("mechTurnSpeed: %s",buf); - MECH_TURNING_SPEED=atof(buf); - - // FIXME: The 3 here should reference the datablock's maximum turning angle -- we're essentially normalizing our rotation here. - float turnStrength = playervar->headRotationZ / 3; - // Use whatever is leftover in our forward movement - float forwardStrength = 1 - fabs(turnStrength); - // Calculate a new turn value that we use for both the main body and the head. - float newTurn = turnStrength * MECH_TURNING_SPEED; - float newHeadTurn = turnStrength * (MECH_TURNING_SPEED/20); - - (mechchangedmove)->y = forwardStrength; - (mechchangedmove)->x += turnStrength; - - // FIXME: Is the yaw value definitely in radians? - playervar->mRotZ += newTurn + (mechchangedmove)->yaw; - - // Now, we must translate the turning strength into an appropriate subtraction for our - // head rotation. - playervar->headRotationZ += -newTurn; - - (mechchangedmove)->pitch = 0; - (mechchangedmove)->yaw = 0; - (mechchangedmove)->roll = 0; - (mechchangedmove)->freelook = true; - } - } - } - } - __asm - { - popa - mov ebx,playerptr - mov eax,[ebp+8] - mov edx,[eax] - mov [ebx+0x894],edx - mov eax,[eax+4] - jmp [updatemoveretptr] - }; -} - static unsigned int updatemovehookptr = (unsigned int)updateMoveHook; - DX::AIMove * getAIMovePtr(unsigned int id) { - int moveindex=0; - bool foundindex=false; - for (int x=0; x<1024; x++) { - if (aimoves[x].id==id && aimoves[x].used==true) { - moveindex=x; - foundindex=true; - break; - } - if (aimoves[x].used==false) { - moveindex=x; - break; - } - } - if (foundindex==true) { - return &aimoves[moveindex]; - } else { - aimoves[moveindex].id=id; - aimoves[moveindex].used=true; - DX::generateNullMove(&(aimoves[moveindex].move)); - return &aimoves[moveindex]; - } - } - DX::Move tmpmove; - __declspec(dllexport) void __cdecl newAIMoveListGenerator(DX::Move** moves, unsigned int * moveCount) { - __asm { - mov tmpobjptr,ecx - } - - unsigned int * origobjptr; - origobjptr=(unsigned int *) tmpobjptr; - DX::AIMove * aimove; - DX::GameConnection * aiconn; - //Con::printf ("Possible offsets for ID starting at 0x4\n"); - if (origobjptr !=0 ) { - //unsigned int * idptr; - //unsigned int offset=0x4; - //for (offset=0x4; offset<0x100; offset+=0x4) { - - //idptr=(unsigned int *)((* (origobjptr))+offset); - //Con::printf ("Offset: %08X Addr: %08X Data: %d",offset, idptr, *idptr); - - //} - aiconn = &DX::GameConnection((unsigned int)origobjptr+0xA0); - aimove = getAIMovePtr(aiconn->identifier); - char movecallback[120]=""; - sprintf_s<120>(movecallback,"AIMoveCallback(%d);",aiconn->identifier); - Con::evaluate(movecallback,false,NULL,NULL); - //Con::printf ("BasePointer: %08X", aiconn.base_pointer_value); - //Con::printf ("Ecx Value: %08X", origobjptr); - //Con::printf("ID: %d\n",aiconn.identifier); - //Con::evaluate ("listPlayers();",true,NULL,NULL); - - //Con::printf("orig: %08X obj: %08X\n",origobjptr,0xBADABEEB); - - - - //Con::printf("Move processed for %08X\n",(aicon.identifier)); - } - //memcpy (&tmpmove,&(aimove->move),sizeof(DX::Move)); - //DX::generateNullMove(&(aimove->move)); - *moves = &(aimove->move); - *moveCount=1; - return; - } - - bool consetTrigger(Linker::SimObject *obj, S32 argc, const char *argv[]) { - unsigned int aiconid = atoi(argv[1]); - unsigned int index = atoi(argv[2]); - if (index < 6) { - DX::AIMove * aimove = getAIMovePtr(aiconid); - bool value = dAtob(argv[3]); - aimove->move.triggers[index]=value; - return true; - } - return false; - } - - bool consetMove(Linker::SimObject *obj, S32 argc, const char *argv[]) { - // setMove(%aicon, x, y, z, yaw, pitch, roll); - unsigned int aiconid = atoi(argv[1]); - DX::AIMove * aimove = getAIMovePtr(aiconid); - aimove->move.x=DX::clampFloat(std::stof(argv[2])); - aimove->move.y=DX::clampFloat(std::stof(argv[3])); - aimove->move.z=DX::clampFloat(std::stof(argv[4])); - aimove->move.yaw=DX::clampMove(std::stof(argv[5])); - aimove->move.pitch=DX::clampMove(std::stof(argv[6])); - aimove->move.roll=DX::clampMove(std::stof(argv[7])); - //Con::printf ("Set move variables for %d to x:%f y:%f z:%f yaw:%f pitch:%f roll:%f\n",aimove->id,aimove->move.x,aimove->move.y,aimove->move.z,aimove->move.yaw,aimove->move.pitch,aimove->move.roll); - return true; - } - - - bool conEnableNewAI(Linker::SimObject *obj, S32 argc, const char *argv[]) - { - (*((unsigned int *)0x75e360))=(unsigned int)newAIMoveListGenerator; - return true; - } - - static S32 gravid=0; - static float movespeed=0.0; - __declspec(dllexport) void ServerProcess(unsigned int deltaTime) - { - //memPatch("602D1E","9090"); - float pos[3]; - float rot[4]; - if (gravid!=0) { - if (movespeed != 0.0) { - float timeinseconds=(deltaTime/1000.0f); - void * objptr = Sim::findObject(gravid); - if ((unsigned int)(objptr)) { - DX::SceneObject newobj=DX::SceneObject((unsigned int)objptr); - newobj.getPosition(pos); - newobj.getRotation(rot); - pos[2]+=(movespeed*timeinseconds); - newobj.setPosition(pos); - } - } - - } - } - static unsigned int gboaptr =(unsigned int ) &GameBaseOnAddHook; - __declspec(dllexport) void ModInitialize(void) - { - // Init WSA - WSADATA wsadata; - WSAStartup(0x0202, &wsadata); - - Con::addMethodS(NULL,"dumpHex",&conDumpHex,"dumpHex(addr,size,spaces)",4,5); - Con::addMethodS(NULL,"dumpDec",&conDumpUInt,"dumpDec(addr)",2,3); - Con::addMethodS(NULL,"dumpFloat",&conDumpFloat,"dumpFloat(addr)",2,3); - Con::addMethodB("Player", "isjumping", &conPlayerGetJumpingState,"Returns whether or not the player is jumping", 2, 2); - Con::addMethodB("Player", "isjetting", &conPlayerGetJettingState,"Returns whether or not the player is jetting", 2, 2); - Con::addMethodB("GameConnection", "setheat", &conGameConnectionSetHeatLevel,"Sets the heat level", 3, 3); - Con::addMethodB("ShapeBase","setcloakvalue",&conShapeBaseSetCloakValue,"Sets the cloak value ex: setcloakvalue(1,0.5)",3,4); - Con::addMethodB("GrenadeProjectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5); - Con::addMethodB("GameBase","setProcessTicks",&conSetProcessTicks,"Sets the flag for processing ticks or not", 3, 3); - Con::addMethodB("Projectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5); - Con::addMethodB(NULL,"enableNewAI",&conEnableNewAI,"Enables the new Move Generation code for the AI", 1,4); - Con::addMethodB(NULL,"setAIMove",&consetMove,"setAIMove(%aicon, x, y, z, yaw, pitch, roll)", 2,10); - Con::addMethodB(NULL,"setAITrigger", &consetTrigger, "setAITrigger(%aicon,triggerid,value);",2,5); - Con::addMethodS("GrenadeProjectile", "getposition", &conGrenadeProjectileGetPosition,"Accurately gets the position of the GrenadeProjectile", 2, 2); - Con::addMethodS("GrenadeProjectile", "getvelocity", &conGrenadeProjectileGetVelocity,"Gets the velocity of the GrenadeProjectile", 2, 2); - Con::addMethodB("Projectile", "makeNerf", &conProjectileMakeNerf,"Makes the Projectile deal no damage", 2, 2); - - // TCPObject -#ifdef ENABLE_TCPOBJECT - Con::addMethodS("TCPObject", "connect", &conTCPObjectConnect, "Connects to a remote server", 3, 3); - Con::addMethodB("TCPObject", "send", &conTCPObjectSend, "Sends data to the remote server", 3, 3); - Con::addMethodB("TCPObject", "disconnect", &conTCPObjectDisconnect, "Disconnects from the remote server", 2, 2); - - // HTTPObject - Con::addMethodB("HTTPObject", "get", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); - Con::addMethodB("HTTPObject", "post", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); - Con::addMethodB("HTTPObject", "send", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); - Con::addMethodB("HTTPObject", "connect", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); - Con::addMethodB("HTTPObject", "listen", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); -#endif - // BinaryObject - Con::addMethodB("BinaryObject", "openforread", &conBinaryObjectOpenForRead, "Opens the input file for reading binary data", 3, 4); - Con::addMethodB("BinaryObject", "save", &conBinaryObjectSave, "Saves the binary object data to a file", 3, 3); - Con::addMethodS("BinaryObject", "readu32", &conBinaryObjectReadU32, "Reads an unsigned int from the buffer", 2, 2); - Con::addMethodS("BinaryObject", "readf32", &conBinaryObjectReadF32, "Reads a float from the buffer", 2, 2); - Con::addMethodS("BinaryObject", "readu8", &conBinaryObjectReadU8, "Reads a unsigned char from the buffer", 2, 2); - Con::addMethodB("BinaryObject", "setbufferpointer", &conBinaryObjectSetBufferPointer, "Sets the buffer pointer", 3, 3); - Con::addMethodS("BinaryObject", "getbufferlength", &conBinaryObjectGetBufferLength, "Returns the length of the buffer", 2, 2); - Con::addMethodS("BinaryObject", "getbufferpointer", &conBinaryObjectGetBufferPointer, "Returns the buffer pointer", 2, 2); - Con::addMethodB("BinaryObject", "close", &conBinaryObjectClose, "Closes the binary object", 2, 2); - Con::addMethodI("NetConnection","getGhostIndex", &conGetGhostIndex, "Gets a ghost index for an object id", 3, 3); - Con::addMethodB("NetConnection","forceUpdate", &conForceUpdate,"Forces an initial update for an object id", 3, 3); - Con::addMethodI("NetConnection","resolveGhostParent",&conResolveGhostParent,"Resolves a ghost index parent", 3, 3); - Con::addMethodS(NULL,"floatToHex",&conFloatToHex,"converts float to hex",2,3); - Con::addMethodI("NetConnection","resolveGhost",&conResolveGhost,"Resolves an object from a ghost ID for ServerConnection", 3, 3); - Con::addMethodB(NULL,"clientCmdSetGhostTicks",&conclientCmdSetGhostTicks,"Client Command for disabling tick processing on ghost index",2,10); - Con::addMethodB(NULL,"clientCmdsetProcessTicks",&conclientCmdSetProcessTicks,"Client Command for disabling tick processing on ghost object",2,10); - // General - Con::addMethodS(NULL, "sprintf", &conSprintf,"Formats a string. See the C sprintf.", 2, 20); - Con::addMethodB(NULL, "tsExtensionUpdate", &conTSExtensionUpdate,"Updates the TSExtension.", 1, 1); - // memPatch Disabler - Con::addMethodB(NULL, "disableMempatch", &disableMempatch,"Disables memPatch.", 1, 1); - // Regex - Con::addMethodB(NULL, "reSearch", &reSearch,"reSearch(pattern, target): Searches for a pattern within the target string.", 3, 3); - Con::addMethodB(NULL, "reMatch", &reMatch,"reMatch(pattern, target): Attempts to match the entire target string to a pattern.", 3, 3); - Con::addMethodB(NULL, "reIterBegin", &reIterBegin,"reIterBegin(pattern, target): Begins an iterator search for patterns in the target string.", 3, 3); - Con::addMethodB(NULL, "reIterEnd", &reIterEnd,"reIterEnd(): Returns true when the iterator search ends.", 1, 1); - Con::addMethodS(NULL,"reIterNext",&reIterNext,"reIterNext(): Returns the next matched pattern in the string.", 1, 1); - Con::addMethodS(NULL,"reReplace",&reReplace,"reReplace(pattern, target, replace): Replaces the pattern within the target string with another string.", 4, 4); - - // Add this Gvar to signify that TSExtension is active - static bool is_active = true; - - - Con::addVariable("$TSExtension::UberGravity", TypeF32, &movespeed); - Con::addVariable("$TSExtension::UberId",TypeS32, &gravid); - Con::addVariable("$TSExtension::isActive", TypeBool, &is_active); - char mechcode[8]="\xA1\xAA\xAA\xAA\xAA\xFF\xE0"; - char dbrwcode[8]="\xC7\x42\x18\x80\x01\x00\x00"; - char dbpack[8]= "\xB8\xAA\xAA\xAA\xAA\xFF\xE0"; - char dbunpack[8]="\xB8\xAA\xAA\xAA\xAA\xFF\xE0"; - char dbpatch3[8]="\xC7\x42\x18\x80\x01\x00\x00"; - char dbclient2[2]="\xEB"; - char dbclient[3]="\x90\x90"; - char gboaonadd[8]="FF\x25\xAA\xAA\xAA\xAA"; - //memPatch("42e05f", -#ifdef MECH_MOVE_CODE - *((unsigned int*)(mechcode+1))=(unsigned int)&updatemovehookptr; -#endif - *((unsigned int*)(dbpack+1))=(unsigned int)&DBpackData; - *((unsigned int*)(dbunpack+1))=(unsigned int)&DBunpackData; - *((unsigned int*)(gboaonadd+2))=(unsigned int)&gboaptr; -#ifdef NEW_DB_CODE - DX::memPatch(0x5D2D6E,(unsigned char *)mechcode,7); - DX::memPatch(0x438415,(unsigned char *)dbrwcode,7); - DX::memPatch(0x436DF0,(unsigned char *)dbpack,7); - DX::memPatch(0x436E00,(unsigned char *)dbunpack,7); - DX::memPatch(0x42e05f,(unsigned char *)dbclient,2); - DX::memPatch(0x66E1ED,(unsigned char *)dbclient2,1); - DX::memPatch(0x438415,(unsigned char *)dbpatch3,7); - DX::memPatch(0x5E29F0,(unsigned char *)gboaonadd,7); -#endif - } -} +// dllmain.cpp : Defines the entry point for the DLL application. +#include +#include +#define _USE_MATH_DEFINES +#include + +//#define TORNADO_ENABLE +//#define MECH_MOVE_CODE +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#include +#include +#include +#include + + + + + +extern "C" +{ + static DX::AIMove aimoves[1024]; + static char command[256]=""; + static const char * dataBlock; + static char buf[256]=""; +//#define MECH_TURNING_SPEED 0.4 + + // Maximum radians per 32ms tick +void *readIntptr=(void *)0x43BF10; +void *writeIntptr=(void *)0x43BF60; +void *writeStringptr=(void *)0x43C6D0; +void *readStringptr=(void *)0x43C630; + + + + +int streamReadInt(void * stream,int bitcount) +{ + int retvalue=0x0; + __asm { + mov ecx,stream + push bitcount + call readIntptr + mov retvalue,eax + } + return retvalue; +} + +void streamWriteInt(void * stream,int value,int bitcount) { + __asm { + mov ecx,stream + push bitcount + push value + call writeIntptr + } + return; +} + +void streamWriteString(void * stream,const char * stringvar,int maxlen) { + __asm { + mov ecx,stream + push maxlen + push stringvar + call writeStringptr + } + return; +} + +void streamReadString(void * stream,char *stringvar) { + __asm { + mov ecx,stream + push stringvar + call readStringptr + } + return; +} + +static char fieldnames[127][256]; +static char fieldvalues[127][256]; +static DX::Player *playervar; +static DX::SimObject *playerdatavar; +unsigned int gamebaseretptr=0x5E2A13; +unsigned int gboaparentptr=0x58c1e0; +static DX::GameBase *gb; +static DX::SimObject * gbdb; +static const char * gbfieldvalue; +void __declspec (naked) GameBaseOnAddHook() { + void * gamebaseptr; + __asm { + push ebp + mov ebp,esp + push ebx + push esi + mov esi,ecx + mov gamebaseptr,esi + call [gboaparentptr] + test al,al + jz gboaparentfailed + mov edx,[esi+0x248] + test edx,edx + jnz gboaworked +gboaparentfailed: + lea esp,[ebp-0x8] + xor al,al + pop esi + pop ebx + pop ebp + retn +gboaworked: + pushad + }; + gb = &DX::GameBase((unsigned int)gamebaseptr); + gbdb = &DX::SimObject(gb->dataBlock); + gbfieldvalue=gbdb->getFieldValue(DX::StringTableInsert("subClass",false)); + if (gbfieldvalue!=NULL) { +#ifdef TORNADO_ENABLE + if (stricmp(gbfieldvalue,"tornado")==0) { + + } +#endif + } + __asm { + popad + jmp [gamebaseretptr] + } + + } +void DBpackData(void *stream) { + void* thisptr; + __asm { + mov thisptr,ecx + }; + DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr); + char readcommand[256]=""; + sprintf_s<256>(readcommand,"return getWordCount(%d.extraNetFields);", dbobj.identifier); + + char str[256]=""; + strncpy_s<256>(str,Con::evaluate(readcommand,false,NULL,true), 256); + + Con::printf ("GWC returned %s\n",str); + int realcount=atoi(str); + int i=0; + int counter=0; + for (i; (i<126 && i(readcommand,"return getWord(%d.extraNetFields,%d);",dbobj.identifier,i); + strncpy_s<256>(fieldnames[i],Con::evaluate(readcommand,false,NULL,true), 256); + + Con::printf (fieldnames[i]); + _snprintf_s<256>(readcommand,256,"return(%d.%s);",dbobj.identifier,fieldnames[i]); + strncpy_s<256>(fieldvalues[i],Con::evaluate(readcommand,false,NULL,true), 256); + strcpy_s<256>(buf,dbobj.getFieldValue(DX::StringTableInsert(fieldnames[i],false))); + Con::printf ("fieldvalues[i]:%s GDF: %s\n",fieldvalues[i],buf); + + } + counter=i; + Con::printf("Sending %d extra fields",counter); + streamWriteInt(stream,counter,7); + for (int x=0; x < counter; x++ ) { + streamWriteString(stream,fieldnames[x],254); + streamWriteString(stream,fieldvalues[x],254); + } + +} +void DBunpackData(void *stream) { + void* thisptr; + __asm { + mov thisptr,ecx + }; + + char setcommand[256]=""; + DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr); + int counter=streamReadInt(stream,7); + char buf[256]=""; + Con::printf ("Receiving %d extra fields",counter); + for (int i=0; i < counter; i++) { + streamReadString(stream,buf); + strcpy_s<256>(fieldnames[i],buf); + streamReadString(stream,buf); + strcpy_s<256>(fieldvalues[i],buf); + } + for (int i=0; i < counter; i++ ){ + Con::printf (fieldnames[i]); + Con::printf (fieldvalues[i]); + dbobj.setDataField(DX::StringTableInsert(fieldnames[i],false),NULL,fieldvalues[i]); + //_snprintf (setcommand,255,"%d.%s=\"%s\";",dbobj.identifier,fieldnames[i],fieldvalues[i]); + //Con::evaluate(setcommand,false,NULL,true); + } +} + + + + + + + + static S32 gravid=0; + static float movespeed=0.0; + __declspec(dllexport) void ServerProcess(unsigned int deltaTime) + { + //memPatch("602D1E","9090"); + float pos[3]; + float rot[4]; + if (gravid!=0) { + if (movespeed != 0.0) { + float timeinseconds=(deltaTime/1000.0f); + void * objptr = Sim::findObject(gravid); + if ((unsigned int)(objptr)) { + DX::SceneObject newobj=DX::SceneObject((unsigned int)objptr); + newobj.getPosition(pos); + newobj.getRotation(rot); + pos[2]+=(movespeed*timeinseconds); + newobj.setPosition(pos); + } + } + + } + } + static unsigned int gboaptr =(unsigned int ) &GameBaseOnAddHook; + __declspec(dllexport) void ModInitialize(void) + { + // Init WSA + WSADATA wsadata; + WSAStartup(0x0202, &wsadata); + + Con::addMethodS(NULL,"dumpHex",&conDumpHex,"dumpHex(addr,size,spaces)",4,5); + Con::addMethodS(NULL,"dumpDec",&conDumpUInt,"dumpDec(addr)",2,3); + Con::addMethodS(NULL,"dumpFloat",&conDumpFloat,"dumpFloat(addr)",2,3); + Con::addMethodB("Player", "isjumping", &conPlayerGetJumpingState,"Returns whether or not the player is jumping", 2, 2); + Con::addMethodB("Player", "isjetting", &conPlayerGetJettingState,"Returns whether or not the player is jetting", 2, 2); + Con::addMethodB("GameConnection", "setheat", &conGameConnectionSetHeatLevel,"Sets the heat level", 3, 3); + Con::addMethodB("ShapeBase","setcloakvalue",&conShapeBaseSetCloakValue,"Sets the cloak value ex: setcloakvalue(1,0.5)",3,4); + Con::addMethodB("GrenadeProjectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5); + Con::addMethodB("GameBase","setProcessTicks",&conSetProcessTicks,"Sets the flag for processing ticks or not", 3, 3); + Con::addMethodB("Projectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5); + Con::addMethodB(NULL,"setAIMove",&consetMove,"setAIMove(%aicon, x, y, z, yaw, pitch, roll)", 2,10); + Con::addMethodB(NULL,"setAITrigger", &consetTrigger, "setAITrigger(%aicon,triggerid,value);",2,6); + Con::addMethodS("GrenadeProjectile", "getposition", &conGrenadeProjectileGetPosition,"Accurately gets the position of the GrenadeProjectile", 2, 2); + Con::addMethodS("GrenadeProjectile", "getvelocity", &conGrenadeProjectileGetVelocity,"Gets the velocity of the GrenadeProjectile", 2, 2); + Con::addMethodB("Projectile", "makeNerf", &conProjectileMakeNerf,"Makes the Projectile deal no damage", 2, 2); + + // TCPObject +#ifdef ENABLE_TCPOBJECT + Con::addMethodS("TCPObject", "connect", &conTCPObjectConnect, "Connects to a remote server", 3, 3); + Con::addMethodB("TCPObject", "send", &conTCPObjectSend, "Sends data to the remote server", 3, 3); + Con::addMethodB("TCPObject", "disconnect", &conTCPObjectDisconnect, "Disconnects from the remote server", 2, 2); + + // HTTPObject + Con::addMethodB("HTTPObject", "get", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); + Con::addMethodB("HTTPObject", "post", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); + Con::addMethodB("HTTPObject", "send", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); + Con::addMethodB("HTTPObject", "connect", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); + Con::addMethodB("HTTPObject", "listen", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6); +#endif + // BinaryObject + Con::addMethodB("BinaryObject", "openforread", &conBinaryObjectOpenForRead, "Opens the input file for reading binary data", 3, 4); + Con::addMethodB("BinaryObject", "save", &conBinaryObjectSave, "Saves the binary object data to a file", 3, 3); + Con::addMethodS("BinaryObject", "readu32", &conBinaryObjectReadU32, "Reads an unsigned int from the buffer", 2, 2); + Con::addMethodS("BinaryObject", "readf32", &conBinaryObjectReadF32, "Reads a float from the buffer", 2, 2); + Con::addMethodS("BinaryObject", "readu8", &conBinaryObjectReadU8, "Reads a unsigned char from the buffer", 2, 2); + Con::addMethodB("BinaryObject", "setbufferpointer", &conBinaryObjectSetBufferPointer, "Sets the buffer pointer", 3, 3); + Con::addMethodS("BinaryObject", "getbufferlength", &conBinaryObjectGetBufferLength, "Returns the length of the buffer", 2, 2); + Con::addMethodS("BinaryObject", "getbufferpointer", &conBinaryObjectGetBufferPointer, "Returns the buffer pointer", 2, 2); + Con::addMethodB("BinaryObject", "close", &conBinaryObjectClose, "Closes the binary object", 2, 2); + Con::addMethodI("NetConnection","getGhostIndex", &conGetGhostIndex, "Gets a ghost index for an object id", 3, 3); + Con::addMethodB("NetConnection","forceUpdate", &conForceUpdate,"Forces an initial update for an object id", 3, 3); + Con::addMethodI("NetConnection","resolveGhostParent",&conResolveGhostParent,"Resolves a ghost index parent", 3, 3); + Con::addMethodS(NULL,"floatToHex",&conFloatToHex,"converts float to hex",2,3); + Con::addMethodI("NetConnection","resolveGhost",&conResolveGhost,"Resolves an object from a ghost ID for ServerConnection", 3, 3); + Con::addMethodB(NULL,"clientCmdSetGhostTicks",&conclientCmdSetGhostTicks,"Client Command for disabling tick processing on ghost index",2,10); + Con::addMethodB(NULL,"clientCmdsetProcessTicks",&conclientCmdSetProcessTicks,"Client Command for disabling tick processing on ghost object",2,10); + // General + Con::addMethodS(NULL, "sprintf", &conSprintf,"Formats a string. See the C sprintf.", 2, 20); + Con::addMethodB(NULL, "tsExtensionUpdate", &conTSExtensionUpdate,"Updates the TSExtension.", 1, 1); + // memPatch Disabler + Con::addMethodB(NULL, "disableMempatch", &disableMempatch,"Disables memPatch.", 1, 1); + // Regex + Con::addMethodB(NULL, "reSearch", &reSearch,"reSearch(pattern, target): Searches for a pattern within the target string.", 3, 3); + Con::addMethodB(NULL, "reMatch", &reMatch,"reMatch(pattern, target): Attempts to match the entire target string to a pattern.", 3, 3); + Con::addMethodB(NULL, "reIterBegin", &reIterBegin,"reIterBegin(pattern, target): Begins an iterator search for patterns in the target string.", 3, 3); + Con::addMethodB(NULL, "reIterEnd", &reIterEnd,"reIterEnd(): Returns true when the iterator search ends.", 1, 1); + Con::addMethodS(NULL,"reIterNext",&reIterNext,"reIterNext(): Returns the next matched pattern in the string.", 1, 1); + Con::addMethodS(NULL,"reReplace",&reReplace,"reReplace(pattern, target, replace): Replaces the pattern within the target string with another string.", 4, 4); + + // Add this Gvar to signify that TSExtension is active + static bool is_active = true; + + + Con::addVariable("$TSExtension::UberGravity", TypeF32, &movespeed); + Con::addVariable("$TSExtension::UberId",TypeS32, &gravid); + Con::addVariable("$TSExtension::isActive", TypeBool, &is_active); + char mechcode[8]="\xA1\xAA\xAA\xAA\xAA\xFF\xE0"; + char dbrwcode[8]="\xC7\x42\x18\x80\x01\x00\x00"; + char dbpack[8]= "\xB8\xAA\xAA\xAA\xAA\xFF\xE0"; + char dbunpack[8]="\xB8\xAA\xAA\xAA\xAA\xFF\xE0"; + char dbpatch3[8]="\xC7\x42\x18\x80\x01\x00\x00"; + char dbclient2[2]="\xEB"; + char dbclient[3]="\x90\x90"; + char gboaonadd[8]="FF\x25\xAA\xAA\xAA\xAA"; + //memPatch("42e05f", +#ifdef MECH_MOVE_CODE + *((unsigned int*)(mechcode+1))=(unsigned int)&updatemovehookptr; +#endif + *((unsigned int*)(dbpack+1))=(unsigned int)&DBpackData; + *((unsigned int*)(dbunpack+1))=(unsigned int)&DBunpackData; + *((unsigned int*)(gboaonadd+2))=(unsigned int)&gboaptr; +#ifdef NEW_DB_CODE + DX::memPatch(0x5D2D6E,(unsigned char *)mechcode,7); + DX::memPatch(0x438415,(unsigned char *)dbrwcode,7); + DX::memPatch(0x436DF0,(unsigned char *)dbpack,7); + DX::memPatch(0x436E00,(unsigned char *)dbunpack,7); + DX::memPatch(0x42e05f,(unsigned char *)dbclient,2); + DX::memPatch(0x66E1ED,(unsigned char *)dbclient2,1); + DX::memPatch(0x438415,(unsigned char *)dbpatch3,7); + DX::memPatch(0x5E29F0,(unsigned char *)gboaonadd,7); +#endif + Py_SetProgramName("AIInterpreter"); + } +} diff --git a/Mod Sources/Watchdog/Watchdog.suo b/Mod Sources/Watchdog/Watchdog.suo deleted file mode 100644 index 2f4512067aedd88570d26a30e69623ab761dfc36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 39424 zcmeHQ349bqy6*_cA)p|KqLN6EJ0YhW0fb2ca!Dj1pk&b;lY-A)LK85%HcXcr{oxWxga`>qHzNxP6>i+7h zs_&?;zV7VZ)9JHyn|ge%=+Y>qg>v**TjkWC^HDe^sObzvIRytT07s7xDH-2mMI zX93OzoC8P#oD1j)hz7&}dIQb}^a8{JE&%ie^a1n(3;^^83=1{lIN>LHPheT$|+Ig z1K9@Cia{5ma7^A}$^qU=B}>IwrM1D0z9_^QC#fg!li$dXY=e_~D7Rbj2TAe*$AtV( zSs-Nq+ekS;{+IPA10K=J>_aI7B>%G>+av3f|0!E21IYiB6~Quq{Li}Nf98|{RSLO_vLE=FDgDAmfdk(UEJ zTDbzb7f`8{eaJaa{aSf0@~gFDa`SxccmeW-+VLNeF9KY4-^Qn>eLZT@4QtPhf3V~E zgK;XX^nE&KNF5TH0sVN4Ia7O1%vrfr8SaAWk}RLQ%3a~l_m_DqvhoYd^Gn==VshQS zDwIbiCd8|MgJROFJ^pH+dt`;X+V9Kv42sFBF7T8UPIS-9@s_(QMiwL_7pE2vDNal* zN=?X5&Tp+ElNei8PcAF;d8@p|{`lOos_J}Cw!gZl%p0#Zp~USwevsq!dZw3E6nU?% ziqFXR=jW7FR>fzPRaE2`c-(3sv&QePs46Qc^OX7L#b>dlRX9`V9ym!oaQk>)w%_Y> zlg`srd#a(yZ$-*0>W}CkG9}4chopNw9(N%}k0@KRi&VkWmg43N{xH$Dh&0JTtjqn^ z=AtWo?mw~edXj=*XsP_UbV{Q8s1O3DKOZm^-{thwTU9^gN{4TV?jaHXKx_QxR z(XZxD?Wf@8SxV@p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c|1W{$*MHSU%mVlRpIf*$Ogyrorq_d6@$WopKMUSzhV&bM$3^tO;GF$$-&x)N zjlXBc^6NG@#D-X4xJCp z(SFE=BfRDKpG9T_S{HyfOjx|g}Z z*n9nQvr7KL^E^~w0#Y<%hVMD4;k z@sw~^?rcEAMz|T-nrz9bfTwKj@e}<&@vM9Yp}Q|^Gr#|LGXB>5og_0^VbsfdZOQ&U z8Gjl2RZz4347Hz(I853e9nq^zBmPn!KPLA$t>Xupa(uqg?i^<^ztSoG=ThhwtHNI~ znT@}GCB+#K95vVmE!butTO(;fLqreDw#!+2I@)h!y*X)rLtFl4tCv{Na8o^vLF8|` z$R4GCce_Dr8a@u&Ob%G>RgkN?HF*kzJP>+~FbeCR7S(jx@j|i7A@;`@4s`}s( z^M7`ssQ>A+VWqd#+~NnPYYZfZ6MYyOzh*rOdY`O#hmSj?3Z%@5{a1OCkGQ>fBF6v! E0B;PY{{R30 diff --git a/ModLoader/Modloader.suo b/ModLoader/Modloader.suo deleted file mode 100644 index baa90d6d5ab1eb342deb100be652e1965693b2a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15872 zcmeHNZERE58NQ)p6zC`vN-3qSA+)7{J=?KE5*AAQ5lEYWNlXGPV>tFrFx>cN{s^#y zbz952uB>9J#E*TTwWDlmrFPwQa%`+uY4pYy$W$c&|*cI zg9!1#=;)}Cs3?ejNY~K_Tt!=}F?n|Za{w1l$f_2`Ec| z+kmCOGGIBd0=NUX6X4odiExz}zuOG2qanJXo7$o1_@xz_5>yfhlgcs7kab$FRFBC# z*F-T2b)4Mx{`cOfx(S)K))+ZM;HWEylvZ%>LoBEqEmp;ZcgvxHawlj)hDj2*c1d9+ zqNJ3=N}Cc#m{xYHk_~PSt9>y%%6RCe4`hf;yD)MGAxOpb`>1Q)U}f zj71bFR_Gq^r_8ZGR{2wBSMv`<`6M_elz-}iLOMX^qYjYqLh{ddY>&)C9Z(BUzfcEI z{_g=eUN(SZw+7&H_%v`Iz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sl>0UC7>nR?L&eE=w#CtWv|DF7M$Fs9+Kj-V6LKgHv<&Fzy7yj(O+g|I6 zo%;KKp8iQ#8m+l&SN3{p;Y|6DmD0E`y_no{;QYm}&0BxE` #include -typedef void (*ServerProcessPointer)(unsigned int); - void serverProcessReplacement(unsigned int timeDelta); \ No newline at end of file diff --git a/ModLoader/Modloader/source/modLoader.cpp b/ModLoader/Modloader/source/modLoader.cpp index 9a936b1..5d5ed29 100644 --- a/ModLoader/Modloader/source/modLoader.cpp +++ b/ModLoader/Modloader/source/modLoader.cpp @@ -4,16 +4,24 @@ #include "stdafx.h" #include +#include +#include -static std::tr1::unordered_set sServerProcessResponders; +//! A vector of mod callables. +static std::vector sModCallables; void serverProcessReplacement(unsigned int timeDelta) { unsigned int servertickaddr=0x602350; unsigned int serverthisptr=0x9E5EC0; - for (auto it = sServerProcessResponders.begin(); it != sServerProcessResponders.end(); it++) - (*it)(timeDelta); + // Call the server process hook for all eligible mods + for (auto it = sModCallables.begin(); it != sModCallables.end(); it++) + { + ModLoader::ModLoaderCallables* currentCallables = *it; + if (currentCallables->mServerProcessPointer != NULL) + currentCallables->mServerProcessPointer(timeDelta); + } __asm { @@ -23,48 +31,92 @@ void serverProcessReplacement(unsigned int timeDelta) } return; - } // Mod Loader Implementation +bool conUnloadLoadMod(Linker::SimObject *obj,S32 argc, const char* argv[]) +{ + const char* targetName = argv[1]; + + for (auto it = sModCallables.begin(); it != sModCallables.end(); it++) + { + ModLoader::ModLoaderCallables* currentMod = *it; + if (strcmp(currentMod->mGetManagementName(), targetName) == 0) + { + // Deinitialize the mod and remove it from the list. + if (currentMod->mDeinitializeModPointer != NULL) + currentMod->mDeinitializeModPointer(); + sModCallables.erase(it); + return true; + } + } + + // Something weird happened. + Con::errorf(0, "Failed to unload mod: '%s'.", targetName); + return false; +} + bool conLoadMod(Linker::SimObject *obj,S32 argc, const char* argv[]) { - typedef void (*LPMODINIT)(void); - HINSTANCE hDLL = NULL; - LPMODINIT lpInitMod = NULL; + HINSTANCE hDLL = NULL; - std::string raw = "mods\\"; - raw += argv[1]; - raw += ".dll"; + std::string raw = "mods\\"; + raw += argv[1]; + raw += ".dll"; - std::wstring modification(raw.begin(), raw.end()); + std::wstring modification(raw.begin(), raw.end()); - hDLL = LoadLibrary(modification.c_str()); - if (hDLL == NULL) + hDLL = LoadLibrary(modification.c_str()); + if (hDLL == NULL) + { + Con::errorf(0, "loadMod(): Failed to load DLL '%s'. Does it exist in GameData\\mods? (%u)", raw.c_str(), GetLastError()); + return false; // The DLL doesn't exist + } + + // Attempt to load supported loader information first + ModLoader::GetModLoaderVersionPointer getModLoaderVersion = (ModLoader::GetModLoaderVersionPointer)GetProcAddress(hDLL, "getModLoaderVersion"); + if (getModLoaderVersion == NULL) + { + Con::errorf(0, "loadMod(): Failed to locate entry point 'getModLoaderVersion' in mod DLL '%s'. Is it a good mod DLL? (%u)", raw.c_str(), GetLastError()); + return false; // Unable to load entry point + } + + // Check if there's a server process responder in this DLL + ModLoader::GetModCallablesPointer getModCallables = (ModLoader::GetModCallablesPointer)GetProcAddress(hDLL, "getModCallables"); + if (getModCallables == NULL) + { + Con::errorf(0, "loadMod(): Failed to locate entry point 'getModCallables' in mod DLL '%s'. Is it a good mod DLL? (%u)", raw.c_str(), GetLastError()); + return false; // Unable to load entry point + } + + unsigned int modLoaderVersion = getModLoaderVersion(); + ModLoader::ModLoaderCallables* callables = getModCallables(); + + // Management name function must be provided + if (callables->mGetManagementName == NULL) + { + Con::errorf(0, "loadMod(): Loaded mod did not provide a management name. This is required.", raw.c_str(), GetLastError()); + return false; // Unable to load entry point + } + const char* managementName = callables->mGetManagementName(); + + // Is the mod already loaded? + for (auto it = sModCallables.begin(); it != sModCallables.end(); it++) + { + ModLoader::ModLoaderCallables* currentMod = *it; + if (strcmp(currentMod->mGetManagementName(), managementName) == 0) { - Con::errorf(0, "loadMod(): Failed to load DLL '%s'. Does it exist in GameData\\mods? (%u)", raw.c_str(), GetLastError()); - return false; // The DLL doesn't exist + Con::errorf(0, "loadMod(): The mod is already loaded.", raw.c_str(), GetLastError()); + return false; } - - lpInitMod = (LPMODINIT)GetProcAddress(hDLL, "ModInitialize"); // Attempt to load our entry point + } - if (lpInitMod == NULL) - { - Con::errorf(0, "loadMod(): Failed to locate entry point 'ModInitialize' in mod DLL '%s'. Is it a good mod DLL? (%u)", raw.c_str(), GetLastError()); - return false; // Unable to load entry point - } + // FIXME: We should probably only run this once at init + Con::addMethodB(NULL, "unloadMod", &conUnloadLoadMod, "Unloads a C++ modification by name.", 2, 2); - lpInitMod(); - Con::errorf(0, "loadMod(): Loaded and executed entry point code for mod DLL '%s'", raw.c_str()); + if (callables->mInitializeModPointer != NULL) + callables->mInitializeModPointer(); - // Check if there's a server process responder in this DLL - ServerProcessPointer serverProcess = (ServerProcessPointer)GetProcAddress(hDLL, "ServerProcess"); // Attempt to load our entry point - - if (serverProcess != NULL) - { - sServerProcessResponders.insert(sServerProcessResponders.end(), serverProcess); - Con::errorf(0, "loadMod(): Added server process responder for mod"); - } - - return true; + sModCallables.push_back(callables); + return true; } \ No newline at end of file diff --git a/ModLoader/Modloader/source/t2dll.cpp b/ModLoader/Modloader/source/t2dll.cpp index 77c7e0a..c808033 100644 --- a/ModLoader/Modloader/source/t2dll.cpp +++ b/ModLoader/Modloader/source/t2dll.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -20,8 +21,22 @@ BOOL APIENTRY DllMain( HMODULE hModule, { return true; } -const unsigned char moduroutine[] = {0x8B, 0x3D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x8B, 0x14, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0x83, 0xFA, 0x00, 0x74, 0x30, 0x8B, 0x3D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x31, 0xD2, 0x89, 0xF8, 0x8B, 0x04, 0x85, 0x00, 0xA6, 0x88, 0x00, 0xF7, 0x34, 0xBD, 0xFC, 0xA5, 0x88, 0x00, 0xFF, 0x0D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x89, 0x14, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0, 0xFF, 0x0D, 0xEC, 0x82, 0x9E, 0x00, 0xC7, 0x04, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0}; -const unsigned char interpreterRoutine[] = {0x8B ,0x56 ,0x18 ,0x89 ,0x15 ,0x10 ,0xB7 ,0xA3 ,0x00 ,0x89 ,0x1D ,0x14 ,0xB7 ,0xA3 ,0x00 ,0x8B ,0x55 ,0x80 ,0x89 ,0xD0 ,0xBF ,0xD9 ,0xCE ,0x42 ,0x00 ,0x3D ,0x55 ,0x00 ,0x00 ,0x00 ,0xFF ,0xE7}; + +const unsigned char moduroutine[] = { + 0x8B, 0x3D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x8B, 0x14, 0x85, 0xFC, + 0xA5, 0x88, 0x00, 0x83, 0xFA, 0x00, 0x74, 0x30, 0x8B, 0x3D, 0xEC, 0x82, + 0x9E, 0x00, 0x89, 0xF8, 0x31, 0xD2, 0x89, 0xF8, 0x8B, 0x04, 0x85, 0x00, + 0xA6, 0x88, 0x00, 0xF7, 0x34, 0xBD, 0xFC, 0xA5, 0x88, 0x00, 0xFF, 0x0D, + 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x89, 0x14, 0x85, 0xFC, 0xA5, 0x88, + 0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0, 0xFF, 0x0D, 0xEC, 0x82, + 0x9E, 0x00, 0xC7, 0x04, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0}; + +const unsigned char interpreterRoutine[] = { + 0x8B, 0x56, 0x18, 0x89, 0x15, 0x10, 0xB7, 0xA3 ,0x00, 0x89, 0x1D, 0x14, + 0xB7, 0xA3, 0x00, 0x8B, 0x55, 0x80, 0x89, 0xD0 ,0xBF, 0xD9, 0xCE, 0x42, 0x00, + 0x3D, 0x55, 0x00, 0x00, 0x00, 0xFF, 0xE7}; + const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[]) { char test[256] = ""; @@ -30,6 +45,7 @@ const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[] sprintf(test2,"B8%08XFFD089EC5DC3",endian(spr)); return test2; } + const char* congetModuAddr(Linker::SimObject *obj, S32 argc, const char *argv[]) { char test[256] = ""; @@ -38,6 +54,7 @@ const char* congetModuAddr(Linker::SimObject *obj, S32 argc, const char *argv[]) sprintf(test2,"B8%08XFFE0",endian(spr)); return test2; } + const char* congetInterpreterAddr(Linker::SimObject *obj, S32 argc, const char *argv[]) { char test[256] = ""; @@ -63,6 +80,7 @@ class CImmDevice Con::addVariable("$cpuspeed",TypeS32,reinterpret_cast(0x8477F8)); //1 - S32, this is so i can set my cpu speed to 31337 or osmething =P Con::addVariable("$GameBase::showBoundingBox",TypeBool,reinterpret_cast(0x9ECF24)); DWORD oldprotect=0; + // Mod Loader Function Con::addMethodB(NULL, "loadMod", &conLoadMod, "Loads a C++ modification.",2,2); Con::addMethodS(NULL, "getServPAddr",&congetServPAddr,"Gets the memPatch data for ServerProcess",1,1); @@ -87,6 +105,9 @@ class CImmDevice else lpinitT2DLL(); // The function was loaded, call TribesNext and move on to postTN Startup + // Initialize all engine hooks + DX::initializeHooks(); + return 0; }