Skip to content

Commit

Permalink
Detection for VR exes.
Browse files Browse the repository at this point in the history
Users on Nexus said this is working with Skyrim VR. However bear in mind that I do not own any VR games so these are unsupported.
  • Loading branch information
Sumwunn committed Apr 4, 2018
1 parent b01d2a9 commit 21347d4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions AchievementsModsEnabler/AchievementsModsEnabler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ extern "C" __declspec(dllexport) int Setup(int ScriptExtenderType)
unsigned char BytesToFind01_02[] = { 0xC3, 0xC6, 0x44, 0x24, 0x38, 0x00, 0x48, 0x8D, 0x44, 0x24, 0x38, 0x48, 0x89, 0x5C, 0x24, 0x20 };
// This is what we patch it with (check notes.txt).
unsigned char BytesPatch01[] = { 0xB0, 0x00, 0xC3 };
// VR.
LPCTSTR ExpectedProcess01_VR = L"Fallout4VR.exe";

// We need to go back X bytes so we land at the right address.
int AddressModifierSub01_01 = 0x29; // Fallout 4 pre-Creators Club update (pre-v1.10).
Expand All @@ -62,6 +64,8 @@ extern "C" __declspec(dllexport) int Setup(int ScriptExtenderType)
unsigned char BytesToFind02_03[] = { 0xC3, 0xC6, 0x44, 0x24, 0x38, 0x00, 0x48, 0x8D, 0x44, 0x24, 0x38, 0x48, 0x89, 0x5C, 0x24, 0x20 };
// This is what we patch it with (check notes.txt).
unsigned char BytesPatch02[] = { 0xB0, 0x00, 0xC3 };
// VR.
LPCTSTR ExpectedProcess02_VR = L"SkyrimVR.exe";

// We need to go back X bytes so we land at the right address.
int AddressModifierSub02_01 = 0x35; // Skyrim SE v1.1.
Expand Down Expand Up @@ -136,6 +140,10 @@ extern "C" __declspec(dllexport) int Setup(int ScriptExtenderType)
else
{
hModule = GetModuleHandle(ExpectedProcess01);
if (hModule == NULL)
{
hModule = GetModuleHandle(ExpectedProcess01_VR);
}
}
if (hModule != NULL)
{
Expand Down Expand Up @@ -175,6 +183,10 @@ extern "C" __declspec(dllexport) int Setup(int ScriptExtenderType)
else
{
hModule = GetModuleHandle(ExpectedProcess02);
if (hModule == NULL)
{
hModule = GetModuleHandle(ExpectedProcess02_VR);
}
}
if (hModule != NULL)
{
Expand Down
Binary file modified AchievementsModsEnabler/AchievementsModsEnabler.rc
Binary file not shown.
4 changes: 2 additions & 2 deletions AchievementsModsEnabler/AchievementsModsEnabler.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ProjectGuid>{C14903C1-2C86-4764-8D5A-B76B986DA50B}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>AchievementsModsEnabler</RootNamespace>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -201,4 +201,4 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\uasm.targets" />
</ImportGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<HJWASM Include="Misc.asm">
<Filter>Source Files\ASM</Filter>
</HJWASM>
<UASM Include="Misc.asm">
<Filter>Source Files</Filter>
</UASM>
</ItemGroup>
</Project>

0 comments on commit 21347d4

Please sign in to comment.