Skip to content

Commit

Permalink
update for 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
34736384 committed Dec 19, 2023
1 parent 2349410 commit c6f3248
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion unlockfps_clr/AboutForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace unlockfpsclr {
this->labelTitle->Padding = System::Windows::Forms::Padding(0, 5, 0, 0);
this->labelTitle->Size = System::Drawing::Size(300, 36);
this->labelTitle->TabIndex = 0;
this->labelTitle->Text = L"Genshin FPS Unlocker\r\nv2.1.4\r\n";
this->labelTitle->Text = L"Genshin FPS Unlocker\r\nv2.2.0\r\n";
this->labelTitle->TextAlign = System::Drawing::ContentAlignment::TopCenter;
//
// linkLabelDescription
Expand Down
30 changes: 22 additions & 8 deletions unlockfps_clr/Unmanaged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ bool Unmanaged::SetupData()
PIMAGE_DOS_HEADER dos = (PIMAGE_DOS_HEADER)up;
PIMAGE_NT_HEADERS nt = (PIMAGE_NT_HEADERS)((uintptr_t)up + dos->e_lfanew);

if (nt->FileHeader.TimeDateStamp < 0x645B245A) // <3.7
if (nt->FileHeader.TimeDateStamp < 0x645B245A) // < 3.7
{
/*
7F 0F jg 0x11
Expand All @@ -230,13 +230,27 @@ bool Unmanaged::SetupData()
}
else
{
uintptr_t address = PatternScan(ua, "E8 ? ? ? ? 85 C0 7E 07 E8 ? ? ? ? EB 05");
if (!address)
return MessageBoxA(nullptr, "outdated fps pattern", "Error", MB_OK | MB_ICONERROR) == -1 && VirtualFree(up, 0, MEM_RELEASE) == -1;

uintptr_t rip = address;
rip += *(int32_t*)(rip + 1) + 5;
rip += *(int32_t*)(rip + 3) + 7;
uintptr_t rip = 0;
if (nt->FileHeader.TimeDateStamp < 0x656FFAF7) // < 4.3
{
uintptr_t address = PatternScan(ua, "E8 ? ? ? ? 85 C0 7E 07 E8 ? ? ? ? EB 05");
if (!address)
return MessageBoxA(nullptr, "outdated fps pattern", "Error", MB_OK | MB_ICONERROR) == -1 && VirtualFree(up, 0, MEM_RELEASE) == -1;

rip = address;
rip += *(int32_t*)(rip + 1) + 5;
rip += *(int32_t*)(rip + 3) + 7;
}
else
{
uintptr_t address = PatternScan(ua, "B9 3C 00 00 00 FF 15");
if (!address)
return MessageBoxA(nullptr, "outdated fps pattern", "Error", MB_OK | MB_ICONERROR) == -1 && VirtualFree(up, 0, MEM_RELEASE) == -1;

rip = address;
rip += 5;
rip += *(int32_t*)(rip + 2) + 6;
}

uintptr_t ptr = 0;
uintptr_t data = rip - (uintptr_t)ua + (uintptr_t)UserAssembly.modBaseAddr;
Expand Down
1 change: 1 addition & 0 deletions unlockfps_clr/unlockfps_clr.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<AdditionalDependencies />
<SubSystem>Windows</SubSystem>
<EntryPointSymbol>main</EntryPointSymbol>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down

0 comments on commit c6f3248

Please sign in to comment.