Skip to content

Commit 3e076f0

Browse files
committed
first version
1 parent ca5f6c9 commit 3e076f0

File tree

6 files changed

+198
-0
lines changed

6 files changed

+198
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Engine.BuildInfo.MOHW_Win32_Retail_dll", "Engine.BuildInfo.MOHW_Win32_Retail_dll\Engine.BuildInfo.MOHW_Win32_Retail_dll.vcxproj", "{07EA7E7D-C20E-4066-9AD1-091614D1BCBC}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Win32 = Debug|Win32
9+
Release|Win32 = Release|Win32
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{07EA7E7D-C20E-4066-9AD1-091614D1BCBC}.Debug|Win32.ActiveCfg = Debug|Win32
13+
{07EA7E7D-C20E-4066-9AD1-091614D1BCBC}.Debug|Win32.Build.0 = Debug|Win32
14+
{07EA7E7D-C20E-4066-9AD1-091614D1BCBC}.Release|Win32.ActiveCfg = Release|Win32
15+
{07EA7E7D-C20E-4066-9AD1-091614D1BCBC}.Release|Win32.Build.0 = Release|Win32
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <windows.h>
2+
#include <stdio.h>
3+
HINSTANCE mHinst = 0, mHinstDLL = 0;
4+
UINT_PTR mProcs[1] = {0};
5+
6+
7+
static void InjectUIScaleLimit(void) {
8+
int value = 0xFF;
9+
//UI检测分辨率的地址
10+
WriteProcessMemory(GetCurrentProcess(), (LPVOID)0x00CBEA6D, (LPVOID)&value, 1, NULL);
11+
WriteProcessMemory(GetCurrentProcess(), (LPVOID)0x00CBEA6E, (LPVOID)&value, 1, NULL);
12+
WriteProcessMemory(GetCurrentProcess(), (LPVOID)0x00CBEA75, (LPVOID)&value, 1, NULL);
13+
WriteProcessMemory(GetCurrentProcess(), (LPVOID)0x00CBEA76, (LPVOID)&value, 1, NULL);
14+
}
15+
16+
LPCSTR mImportNames[] = {"getBuildInfo"};
17+
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) {
18+
mHinst = hinstDLL;
19+
if ( fdwReason == DLL_PROCESS_ATTACH ) {
20+
mHinstDLL = LoadLibrary( "ori_Engine.BuildInfo.MOHW_Win32_Retail_dll.dll" );
21+
if ( !mHinstDLL )
22+
return ( FALSE );
23+
for ( int i = 0; i < 1; i++ )
24+
mProcs[ i ] = (UINT_PTR)GetProcAddress( mHinstDLL, mImportNames[ i ] );
25+
} else if ( fdwReason == DLL_PROCESS_DETACH ) {
26+
FreeLibrary( mHinstDLL );
27+
}
28+
//这个DLL被加载的时候游戏.text已经被解密了可以修改内存了
29+
InjectUIScaleLimit();
30+
return ( TRUE );
31+
}
32+
33+
extern "C" __declspec(naked) void __stdcall getBuildInfo_wrapper(){__asm{jmp mProcs[0*4]}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LIBRARY Engine.BuildInfo.MOHW_Win32_Retail_dll.dll
2+
EXPORTS
3+
getBuildInfo=getBuildInfo_wrapper @1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.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+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{07EA7E7D-C20E-4066-9AD1-091614D1BCBC}</ProjectGuid>
15+
<Keyword>Win32Proj</Keyword>
16+
<RootNamespace>Engine.BuildInfo.MOHW_Win32_Retail_dll</RootNamespace>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20+
<ConfigurationType>DynamicLibrary</ConfigurationType>
21+
<UseDebugLibraries>true</UseDebugLibraries>
22+
<CharacterSet>NotSet</CharacterSet>
23+
<PlatformToolset>v145</PlatformToolset>
24+
</PropertyGroup>
25+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
26+
<ConfigurationType>DynamicLibrary</ConfigurationType>
27+
<UseDebugLibraries>false</UseDebugLibraries>
28+
<WholeProgramOptimization>true</WholeProgramOptimization>
29+
<CharacterSet>NotSet</CharacterSet>
30+
<PlatformToolset>v145</PlatformToolset>
31+
</PropertyGroup>
32+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33+
<ImportGroup Label="ExtensionSettings">
34+
</ImportGroup>
35+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
36+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37+
</ImportGroup>
38+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
39+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
40+
</ImportGroup>
41+
<PropertyGroup Label="UserMacros" />
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
43+
<LinkIncremental>true</LinkIncremental>
44+
<GenerateManifest>false</GenerateManifest>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
47+
<LinkIncremental>false</LinkIncremental>
48+
<GenerateManifest>false</GenerateManifest>
49+
</PropertyGroup>
50+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
51+
<ClCompile>
52+
<PrecompiledHeader>
53+
</PrecompiledHeader>
54+
<WarningLevel>Level3</WarningLevel>
55+
<Optimization>Disabled</Optimization>
56+
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGINE.BUILDINFO.MOHW_WIN32_RETAIL_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
57+
</ClCompile>
58+
<Link>
59+
<SubSystem>Windows</SubSystem>
60+
<GenerateDebugInformation>true</GenerateDebugInformation>
61+
<ModuleDefinitionFile>Engine.BuildInfo.MOHW_Win32_Retail_dll.def</ModuleDefinitionFile>
62+
</Link>
63+
</ItemDefinitionGroup>
64+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
65+
<ClCompile>
66+
<WarningLevel>Level3</WarningLevel>
67+
<PrecompiledHeader>
68+
</PrecompiledHeader>
69+
<Optimization>MaxSpeed</Optimization>
70+
<FunctionLevelLinking>true</FunctionLevelLinking>
71+
<IntrinsicFunctions>true</IntrinsicFunctions>
72+
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE.BUILDINFO.MOHW_WIN32_RETAIL_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
73+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
74+
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
75+
</ClCompile>
76+
<Link>
77+
<SubSystem>Windows</SubSystem>
78+
<GenerateDebugInformation>false</GenerateDebugInformation>
79+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
80+
<OptimizeReferences>true</OptimizeReferences>
81+
<ModuleDefinitionFile>Engine.BuildInfo.MOHW_Win32_Retail_dll.def</ModuleDefinitionFile>
82+
<RandomizedBaseAddress>false</RandomizedBaseAddress>
83+
</Link>
84+
</ItemDefinitionGroup>
85+
<ItemGroup>
86+
<ClCompile Include="Engine.BuildInfo.MOHW_Win32_Retail_dll.cpp" />
87+
</ItemGroup>
88+
<ItemGroup>
89+
<None Include="Engine.BuildInfo.MOHW_Win32_Retail_dll.def" />
90+
</ItemGroup>
91+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
92+
<ImportGroup Label="ExtensionTargets">
93+
</ImportGroup>
94+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="Engine.BuildInfo.MOHW_Win32_Retail_dll.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
<ItemGroup>
23+
<None Include="Engine.BuildInfo.MOHW_Win32_Retail_dll.def">
24+
<Filter>Source Files</Filter>
25+
</None>
26+
</ItemGroup>
27+
</Project>

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
11
# MOHW_fix
22

3+
### Similar to https://github.com/GlacierLab/bf3_fix
4+
5+
## What works
6+
- Most UI elements now scale in any resolution
7+
8+
## What doesn't work
9+
- Subtitles still in small font size
10+
11+
## What's not tested
12+
- Multiplayer anticheat (server not available any more)
13+
14+
## How to use
15+
- Download the latest release from the Releases section.
16+
- Rename `Engine.BuildInfo.MOHW_Win32_Retail_dll.dll` to `ori_Engine.BuildInfo.MOHW_Win32_Retail_dll.dll`
17+
- Place the downloaded `Engine.BuildInfo.MOHW_Win32_Retail_dll.dll` in the same folder as the renamed original file.
18+
- Launch the game as usual.
19+
20+
## License
21+
GPLv2 or [Qinlili Universal License](https://github.com/qinlili23333/QinliliUniversalLicense)
22+
23+
<a href="https://www.buymeacoffee.com/qinlili" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

0 commit comments

Comments
 (0)