Skip to content

Commit f221770

Browse files
committed
Add project files.
1 parent adc58ef commit f221770

File tree

9 files changed

+410
-0
lines changed

9 files changed

+410
-0
lines changed

MW3FovChanger.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27004.2010
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MW3FovChanger", "MW3FovChanger\MW3FovChanger.vcxproj", "{4F0C1524-279E-4957-9441-AC7050EE2981}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x64.ActiveCfg = Debug|x64
17+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x64.Build.0 = Debug|x64
18+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x86.ActiveCfg = Debug|Win32
19+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Debug|x86.Build.0 = Debug|Win32
20+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x64.ActiveCfg = Release|x64
21+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x64.Build.0 = Release|x64
22+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x86.ActiveCfg = Release|Win32
23+
{4F0C1524-279E-4957-9441-AC7050EE2981}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {D0B761A0-68FB-4A8D-9404-473C7BDAE604}
30+
EndGlobalSection
31+
EndGlobal

MW3FovChanger/FovChanger.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#include "FovChanger.h"
2+
#include "MemAccess.h"
3+
#include "processhook.h"
4+
#include <iostream>
5+
6+
FovChanger::FovChanger()
7+
{
8+
}
9+
10+
11+
FovChanger::~FovChanger()
12+
{
13+
}
14+
15+
void FovChanger::ChangeFOV_SP(const HANDLE hProc, float fov)
16+
{
17+
if (!hProc) return;
18+
19+
MessageBeep(MB_OK);
20+
21+
DWORD fovmemaddress;
22+
DWORD iw5spmodule;
23+
24+
iw5spmodule = processhook::GetModuleBaseAddress(hProc, "iw5sp.exe");
25+
26+
if (!iw5spmodule) return;
27+
28+
fovmemaddress = iw5spmodule + 0x185757C;
29+
30+
while (memext::write(hProc, (LPVOID)fovmemaddress, &fov, sizeof(float))) Sleep(100);
31+
}
32+
33+
void FovChanger::ChangeFOV_MP(const HANDLE hProc, float fov)
34+
{
35+
if (!hProc) return;
36+
37+
MessageBeep(MB_OK);
38+
39+
DWORD fovmemaddress;
40+
DWORD iw5mpmodule;
41+
42+
iw5mpmodule = processhook::GetModuleBaseAddress(hProc, "iw5mp.exe");
43+
44+
if (!iw5mpmodule) return;
45+
46+
fovmemaddress = iw5mpmodule + 0x55E8EC4;
47+
48+
while (memext::write(hProc, (LPVOID)fovmemaddress, &fov, sizeof(float))) Sleep(100);
49+
}

MW3FovChanger/FovChanger.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
#include <Windows.h>
4+
5+
class FovChanger
6+
{
7+
public:
8+
FovChanger();
9+
~FovChanger();
10+
11+
/*fov changing functions for singleplayer, this method blocks execution*/
12+
void ChangeFOV_SP(const HANDLE hProc, float fov);
13+
/*fov changing functions for multiplayer, this method blocks execution*/
14+
void ChangeFOV_MP(const HANDLE hProc, float fov);
15+
};
16+
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>15.0</VCProjectVersion>
23+
<ProjectGuid>{4F0C1524-279E-4957-9441-AC7050EE2981}</ProjectGuid>
24+
<Keyword>Win32Proj</Keyword>
25+
<RootNamespace>MW3FovChanger</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v141</PlatformToolset>
33+
<CharacterSet>MultiByte</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v141</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v141</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v141</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<LinkIncremental>true</LinkIncremental>
75+
</PropertyGroup>
76+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
77+
<LinkIncremental>true</LinkIncremental>
78+
</PropertyGroup>
79+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
80+
<LinkIncremental>false</LinkIncremental>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83+
<LinkIncremental>false</LinkIncremental>
84+
</PropertyGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
86+
<ClCompile>
87+
<WarningLevel>Level3</WarningLevel>
88+
<Optimization>Disabled</Optimization>
89+
<SDLCheck>true</SDLCheck>
90+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
91+
</ClCompile>
92+
<Link>
93+
<GenerateDebugInformation>true</GenerateDebugInformation>
94+
<SubSystem>Console</SubSystem>
95+
</Link>
96+
</ItemDefinitionGroup>
97+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
98+
<ClCompile>
99+
<WarningLevel>Level3</WarningLevel>
100+
<Optimization>Disabled</Optimization>
101+
<SDLCheck>true</SDLCheck>
102+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103+
</ClCompile>
104+
<Link>
105+
<GenerateDebugInformation>true</GenerateDebugInformation>
106+
<SubSystem>Console</SubSystem>
107+
</Link>
108+
</ItemDefinitionGroup>
109+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
110+
<ClCompile>
111+
<WarningLevel>Level3</WarningLevel>
112+
<Optimization>MaxSpeed</Optimization>
113+
<FunctionLevelLinking>true</FunctionLevelLinking>
114+
<IntrinsicFunctions>true</IntrinsicFunctions>
115+
<SDLCheck>true</SDLCheck>
116+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117+
</ClCompile>
118+
<Link>
119+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
120+
<OptimizeReferences>true</OptimizeReferences>
121+
<GenerateDebugInformation>true</GenerateDebugInformation>
122+
<SubSystem>Console</SubSystem>
123+
</Link>
124+
</ItemDefinitionGroup>
125+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
126+
<ClCompile>
127+
<WarningLevel>Level3</WarningLevel>
128+
<Optimization>MaxSpeed</Optimization>
129+
<FunctionLevelLinking>true</FunctionLevelLinking>
130+
<IntrinsicFunctions>true</IntrinsicFunctions>
131+
<SDLCheck>true</SDLCheck>
132+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
133+
</ClCompile>
134+
<Link>
135+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
136+
<OptimizeReferences>true</OptimizeReferences>
137+
<GenerateDebugInformation>true</GenerateDebugInformation>
138+
<SubSystem>Console</SubSystem>
139+
</Link>
140+
</ItemDefinitionGroup>
141+
<ItemGroup>
142+
<ClCompile Include="FovChanger.cpp" />
143+
<ClCompile Include="main.cpp" />
144+
<ClCompile Include="processhook.cpp" />
145+
</ItemGroup>
146+
<ItemGroup>
147+
<ClInclude Include="FovChanger.h" />
148+
<ClInclude Include="MemAccess.h" />
149+
<ClInclude Include="processhook.h" />
150+
</ItemGroup>
151+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
152+
<ImportGroup Label="ExtensionTargets">
153+
</ImportGroup>
154+
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="process/mem">
5+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
6+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
7+
</Filter>
8+
<Filter Include="main">
9+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
10+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
11+
</Filter>
12+
<Filter Include="fovchanger">
13+
<UniqueIdentifier>{9ac56c79-91ff-41eb-9649-d09ad7b51fff}</UniqueIdentifier>
14+
</Filter>
15+
</ItemGroup>
16+
<ItemGroup>
17+
<ClCompile Include="main.cpp">
18+
<Filter>main</Filter>
19+
</ClCompile>
20+
<ClCompile Include="processhook.cpp">
21+
<Filter>process/mem</Filter>
22+
</ClCompile>
23+
<ClCompile Include="FovChanger.cpp">
24+
<Filter>fovchanger</Filter>
25+
</ClCompile>
26+
</ItemGroup>
27+
<ItemGroup>
28+
<ClInclude Include="processhook.h">
29+
<Filter>process/mem</Filter>
30+
</ClInclude>
31+
<ClInclude Include="MemAccess.h">
32+
<Filter>process/mem</Filter>
33+
</ClInclude>
34+
<ClInclude Include="FovChanger.h">
35+
<Filter>fovchanger</Filter>
36+
</ClInclude>
37+
</ItemGroup>
38+
</Project>

MW3FovChanger/MemAccess.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
#include <Windows.h>
4+
5+
namespace memext {
6+
7+
/*Write access*/
8+
template<typename T>
9+
BOOL write(HANDLE hProc, LPVOID dest, T src, size_t size) {
10+
return WriteProcessMemory(hProc, dest, src, size, nullptr);
11+
}
12+
}

MW3FovChanger/main.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <Windows.h>
2+
#include <iostream>
3+
#include "processhook.h"
4+
#include "FovChanger.h"
5+
6+
int main(int argc, char** argv) {
7+
8+
/*Connect to process*/
9+
DWORD pid = 0;
10+
HANDLE hProc = NULL;
11+
12+
FovChanger fovchanger;
13+
14+
/*Connect to either, MP or SP*/
15+
while (!pid) {
16+
17+
//Singleplayer
18+
pid = processhook::GetProcessId("Call of Duty®: Modern Warfare® 3");
19+
if (pid) {
20+
21+
hProc = processhook::ConnectToProcess(pid);
22+
23+
if(hProc)
24+
fovchanger.ChangeFOV_SP(hProc, 90.f);
25+
26+
break;
27+
}
28+
29+
//Multiplayer
30+
pid = processhook::GetProcessId("Call of Duty®: Modern Warfare® 3 Multiplayer");
31+
if (pid) {
32+
33+
hProc = processhook::ConnectToProcess(pid);
34+
35+
if(hProc)
36+
fovchanger.ChangeFOV_MP(hProc, 90.f);
37+
38+
break;
39+
}
40+
41+
Sleep(100);
42+
}
43+
44+
MessageBeep(MB_OKCANCEL);
45+
46+
return EXIT_SUCCESS;
47+
}

0 commit comments

Comments
 (0)