Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mesinger committed May 20, 2018
1 parent adc58ef commit f221770
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 0 deletions.
31 changes: 31 additions & 0 deletions MW3FovChanger.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MW3FovChanger", "MW3FovChanger\MW3FovChanger.vcxproj", "{4F0C1524-279E-4957-9441-AC7050EE2981}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x64.ActiveCfg = Debug|x64
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x64.Build.0 = Debug|x64
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x86.ActiveCfg = Debug|Win32
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x86.Build.0 = Debug|Win32
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x64.ActiveCfg = Release|x64
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x64.Build.0 = Release|x64
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x86.ActiveCfg = Release|Win32
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D0B761A0-68FB-4A8D-9404-473C7BDAE604}
EndGlobalSection
EndGlobal
49 changes: 49 additions & 0 deletions MW3FovChanger/FovChanger.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "FovChanger.h"
#include "MemAccess.h"
#include "processhook.h"
#include <iostream>

FovChanger::FovChanger()
{
}


FovChanger::~FovChanger()
{
}

void FovChanger::ChangeFOV_SP(const HANDLE hProc, float fov)
{
if (!hProc) return;

MessageBeep(MB_OK);

DWORD fovmemaddress;
DWORD iw5spmodule;

iw5spmodule = processhook::GetModuleBaseAddress(hProc, "iw5sp.exe");

if (!iw5spmodule) return;

fovmemaddress = iw5spmodule + 0x185757C;

while (memext::write(hProc, (LPVOID)fovmemaddress, &fov, sizeof(float))) Sleep(100);
}

void FovChanger::ChangeFOV_MP(const HANDLE hProc, float fov)
{
if (!hProc) return;

MessageBeep(MB_OK);

DWORD fovmemaddress;
DWORD iw5mpmodule;

iw5mpmodule = processhook::GetModuleBaseAddress(hProc, "iw5mp.exe");

if (!iw5mpmodule) return;

fovmemaddress = iw5mpmodule + 0x55E8EC4;

while (memext::write(hProc, (LPVOID)fovmemaddress, &fov, sizeof(float))) Sleep(100);
}
16 changes: 16 additions & 0 deletions MW3FovChanger/FovChanger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <Windows.h>

class FovChanger
{
public:
FovChanger();
~FovChanger();

/*fov changing functions for singleplayer, this method blocks execution*/
void ChangeFOV_SP(const HANDLE hProc, float fov);
/*fov changing functions for multiplayer, this method blocks execution*/
void ChangeFOV_MP(const HANDLE hProc, float fov);
};

154 changes: 154 additions & 0 deletions MW3FovChanger/MW3FovChanger.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{4F0C1524-279E-4957-9441-AC7050EE2981}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MW3FovChanger</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<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|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="FovChanger.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="processhook.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="FovChanger.h" />
<ClInclude Include="MemAccess.h" />
<ClInclude Include="processhook.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
38 changes: 38 additions & 0 deletions MW3FovChanger/MW3FovChanger.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="process/mem">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="main">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="fovchanger">
<UniqueIdentifier>{9ac56c79-91ff-41eb-9649-d09ad7b51fff}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>main</Filter>
</ClCompile>
<ClCompile Include="processhook.cpp">
<Filter>process/mem</Filter>
</ClCompile>
<ClCompile Include="FovChanger.cpp">
<Filter>fovchanger</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="processhook.h">
<Filter>process/mem</Filter>
</ClInclude>
<ClInclude Include="MemAccess.h">
<Filter>process/mem</Filter>
</ClInclude>
<ClInclude Include="FovChanger.h">
<Filter>fovchanger</Filter>
</ClInclude>
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions MW3FovChanger/MemAccess.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include <Windows.h>

namespace memext {

/*Write access*/
template<typename T>
BOOL write(HANDLE hProc, LPVOID dest, T src, size_t size) {
return WriteProcessMemory(hProc, dest, src, size, nullptr);
}
}
47 changes: 47 additions & 0 deletions MW3FovChanger/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <Windows.h>
#include <iostream>
#include "processhook.h"
#include "FovChanger.h"

int main(int argc, char** argv) {

/*Connect to process*/
DWORD pid = 0;
HANDLE hProc = NULL;

FovChanger fovchanger;

/*Connect to either, MP or SP*/
while (!pid) {

//Singleplayer
pid = processhook::GetProcessId("Call of Duty®: Modern Warfare® 3");
if (pid) {

hProc = processhook::ConnectToProcess(pid);

if(hProc)
fovchanger.ChangeFOV_SP(hProc, 90.f);

break;
}

//Multiplayer
pid = processhook::GetProcessId("Call of Duty®: Modern Warfare® 3 Multiplayer");
if (pid) {

hProc = processhook::ConnectToProcess(pid);

if(hProc)
fovchanger.ChangeFOV_MP(hProc, 90.f);

break;
}

Sleep(100);
}

MessageBeep(MB_OKCANCEL);

return EXIT_SUCCESS;
}
Loading

0 comments on commit f221770

Please sign in to comment.