This repository has been archived by the owner on Oct 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7543e21
commit a483a84
Showing
21 changed files
with
8,180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.22823.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnhancedFiveMTrainer", "EnhancedFiveMTrainer\EnhancedFiveMTrainer.vcxproj", "{8D82F34A-1D64-465B-84B1-37F89AD3D20B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|Mixed Platforms = Debug|Mixed Platforms | ||
Debug|Win32 = Debug|Win32 | ||
Debug|x64 = Debug|x64 | ||
Release|Any CPU = Release|Any CPU | ||
Release|Mixed Platforms = Release|Mixed Platforms | ||
Release|Win32 = Release|Win32 | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Debug|Any CPU.ActiveCfg = Debug|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Debug|Mixed Platforms.ActiveCfg = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Debug|Mixed Platforms.Build.0 = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Debug|Win32.ActiveCfg = Debug|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Debug|x64.ActiveCfg = Debug|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Debug|x64.Build.0 = Debug|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Release|Any CPU.ActiveCfg = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Release|Mixed Platforms.ActiveCfg = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Release|Mixed Platforms.Build.0 = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Release|Win32.ActiveCfg = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Release|x64.ActiveCfg = Release|x64 | ||
{8D82F34A-1D64-465B-84B1-37F89AD3D20B}.Release|x64.Build.0 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<ClCompile Include="config_io.cpp" /> | ||
<ClCompile Include="debuglog.cpp" /> | ||
<ClCompile Include="io.cpp" /> | ||
<ClCompile Include="keyboard.cpp" /> | ||
<ClCompile Include="main.cpp" /> | ||
<ClCompile Include="menu_functions.cpp" /> | ||
<ClCompile Include="script.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="config_io.h" /> | ||
<ClInclude Include="debuglog.h" /> | ||
<ClInclude Include="inc\main.h" /> | ||
<ClInclude Include="inc\nativeCaller.h" /> | ||
<ClInclude Include="inc\types.h" /> | ||
<ClInclude Include="io.h" /> | ||
<ClInclude Include="keyboard.h" /> | ||
<ClInclude Include="menu_functions.h" /> | ||
<ClInclude Include="script.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Xml Include="fmt-config.xml" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="config_io.cpp" /> | ||
<ClCompile Include="io.cpp" /> | ||
<ClCompile Include="keyboard.cpp" /> | ||
<ClCompile Include="main.cpp" /> | ||
<ClCompile Include="menu_functions.cpp" /> | ||
<ClCompile Include="script.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="config_io.h" /> | ||
<ClInclude Include="inc\main.h" /> | ||
<ClInclude Include="inc\nativeCaller.h" /> | ||
<ClInclude Include="inc\types.h" /> | ||
<ClInclude Include="io.h" /> | ||
<ClInclude Include="keyboard.h" /> | ||
<ClInclude Include="menu_functions.h" /> | ||
<ClInclude Include="script.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Xml Include="fmt-config.xml"> | ||
<DeploymentContent>true</DeploymentContent> | ||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> | ||
</Xml> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{8D82F34A-1D64-465B-84B1-37F89AD3D20B}</ProjectGuid> | ||
<Keyword>Win32Proj</Keyword> | ||
<RootNamespace>EnhancedFiveMTrainer</RootNamespace> | ||
<ProjectName>EnhancedFiveMTrainer</ProjectName> | ||
<TargetPlatformVersion>8.1</TargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v120</PlatformToolset> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v140</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
<TargetExt>.asi</TargetExt> | ||
<OutDir>bin\$(Configuration)\</OutDir> | ||
<IntDir>tmp\$(Configuration)\</IntDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
<TargetExt>.asi</TargetExt> | ||
<OutDir>bin\$(Configuration)\</OutDir> | ||
<IntDir>tmp\$(Configuration)\</IntDir> | ||
<LibraryPath>$(LibraryPath)</LibraryPath> | ||
<IncludePath>C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include;$(IncludePath)</IncludePath> | ||
<TargetName>EnhancedFiveMTrainer</TargetName> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<ClCompile> | ||
<PrecompiledHeader>NotUsing</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NativeTrainer_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
<FloatingPointModel>Fast</FloatingPointModel> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>false</GenerateDebugInformation> | ||
<AdditionalOptions>lib\ScriptHookV.lib %(AdditionalOptions)</AdditionalOptions> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<PrecompiledHeader> | ||
</PrecompiledHeader> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NativeTrainer_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
<FloatingPointModel>Fast</FloatingPointModel> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>false</GenerateDebugInformation> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<AdditionalDependencies>lib\ScriptHookV.lib;msxml6.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/* | ||
Part of the Enhanced Native Trainer project. | ||
https://github.com/gtav-ent/GTAV-EnhancedNativeTrainer | ||
(C) Rob Pridham and fellow contributors 2015 | ||
*/ | ||
|
||
#include "config_io.h" | ||
#include "keyboard.h" | ||
#include "script.h" | ||
#include <sstream> | ||
|
||
// A global Windows "basic string". Actual memory is allocated by the | ||
// COM methods used by MSXML which take &bstr. We must use SysFreeString() | ||
// to free this memory before subsequent uses, to prevent a leak. | ||
BSTR bstr; | ||
|
||
TrainerConfig *config = NULL; | ||
|
||
/**Read the XML config file. Currently contains keyboard choices.*/ | ||
void read_config_file() | ||
{ | ||
TrainerConfig *result = new TrainerConfig(); | ||
|
||
CoInitialize(NULL); | ||
|
||
//read XML | ||
MSXML2::IXMLDOMDocumentPtr spXMLDoc; | ||
spXMLDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60)); | ||
if (!spXMLDoc->load("fmt-config.xml")) | ||
{ | ||
config = result; //the default config | ||
} | ||
|
||
IXMLDOMNodeListPtr nodes = spXMLDoc->selectNodes(L"//fmt-config/keys/key"); | ||
|
||
long length; | ||
nodes->get_length(&length); | ||
for (int i = 0; i < length; i++) | ||
{ | ||
IXMLDOMNode *node; | ||
nodes->get_item(i, &node); | ||
IXMLDOMNamedNodeMap *attribs; | ||
node->get_attributes(&attribs); | ||
|
||
long length_attribs; | ||
attribs->get_length(&length_attribs); | ||
|
||
char *attrib_key_func = NULL; | ||
char *attrib_key_value = NULL; | ||
|
||
for (long j = 0; j < length_attribs; j++) | ||
{ | ||
IXMLDOMNode *attribNode; | ||
attribs->get_item(j, &attribNode); | ||
attribNode->get_nodeName(&bstr); | ||
if (wcscmp(bstr, L"function") == 0) | ||
{ | ||
VARIANT var; | ||
VariantInit(&var); | ||
attribNode->get_nodeValue(&var); | ||
attrib_key_func = _com_util::ConvertBSTRToString(V_BSTR(&var)); | ||
} | ||
else if (wcscmp(bstr, L"value") == 0) | ||
{ | ||
VARIANT var; | ||
VariantInit(&var); | ||
attribNode->get_nodeValue(&var); | ||
attrib_key_value = _com_util::ConvertBSTRToString(V_BSTR(&var)); | ||
} | ||
SysFreeString(bstr); | ||
attribNode->Release(); | ||
} | ||
|
||
if (attrib_key_func != NULL && attrib_key_value != NULL) | ||
{ | ||
result->get_key_config()->set_key(attrib_key_func, attrib_key_value); | ||
} | ||
|
||
delete attrib_key_func; | ||
delete attrib_key_value; | ||
|
||
attribs->Release(); | ||
node->Release(); | ||
} | ||
|
||
//nodes->Release(); //don't do this, it crashes on exit | ||
spXMLDoc.Release(); | ||
CoUninitialize(); | ||
|
||
config = result; | ||
} | ||
|
||
void KeyInputConfig::set_key(char* function, char* keyName) | ||
{ | ||
int vkID = keyNameToVal(keyName); | ||
if (vkID == -1) | ||
{ | ||
return; | ||
} | ||
|
||
if (strcmp(function, "menu_up") == 0) | ||
{ | ||
key_menu_up = vkID; | ||
} | ||
else if (strcmp(function, "menu_down") == 0) | ||
{ | ||
key_menu_down = vkID; | ||
} | ||
else if (strcmp(function, "menu_left") == 0) | ||
{ | ||
key_menu_left = vkID; | ||
} | ||
else if (strcmp(function, "menu_right") == 0) | ||
{ | ||
key_menu_right = vkID; | ||
} | ||
else if (strcmp(function, "menu_select") == 0) | ||
{ | ||
key_menu_confirm = vkID; | ||
} | ||
else if (strcmp(function,"menu_back") == 0) | ||
{ | ||
key_menu_back = vkID; | ||
} | ||
else if (strcmp(function, "toggle_trainer_menu") == 0) | ||
{ | ||
toggle_trainer_menu = vkID; | ||
} | ||
}; | ||
|
||
TrainerConfig::TrainerConfig() | ||
{ | ||
this->keyConfig = new KeyInputConfig(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
Part of the Enhanced Native Trainer project. | ||
https://github.com/gtav-ent/GTAV-EnhancedNativeTrainer | ||
(C) Rob Pridham and fellow contributors 2015 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <tchar.h> | ||
#include <windows.h> | ||
|
||
#pragma warning(disable : 4192) //ignore automatically excluding while importing type library warnings | ||
|
||
#import <msxml6.dll> //read the GitHub project readme regarding what you need to make this work | ||
|
||
#include "keyboard.h" | ||
|
||
/**A class to hold the current key bindings.*/ | ||
class KeyInputConfig | ||
{ | ||
public: | ||
//these are the defaults which may be overridden by the XML config | ||
|
||
int toggle_trainer_menu = VK_F3; | ||
|
||
int key_menu_up = VK_NUMPAD8; | ||
int key_menu_down = VK_NUMPAD2; | ||
int key_menu_left = VK_NUMPAD4; | ||
int key_menu_right = VK_NUMPAD6; | ||
int key_menu_confirm = VK_NUMPAD5; | ||
int key_menu_back = VK_NUMPAD0; | ||
|
||
/**Change the key binding using a function string and key string.*/ | ||
void set_key(char* function, char* keyName); | ||
}; | ||
|
||
/**A class to hold all the user settings.*/ | ||
class TrainerConfig | ||
{ | ||
public: | ||
TrainerConfig(); | ||
KeyInputConfig* get_key_config() { return keyConfig; } | ||
|
||
private: | ||
KeyInputConfig* keyConfig; | ||
}; | ||
|
||
/**The current user config.*/ | ||
extern TrainerConfig* config; | ||
|
||
/**Read the user config in from an XML file.*/ | ||
void read_config_file(); | ||
|
||
/**Get the current config object.*/ | ||
inline TrainerConfig* get_config() { return config; } | ||
|
Oops, something went wrong.