[Guide]Speedhack and unity
Posted: Fri Feb 10, 2023 10:03 am
The most common reason for speedhack to have no effect is because of hardware limiters like vsync
Unity has a FPS lock that's based on the vsync of the display. If FPS lock is in use, vsync is in use, and thus speedhack won't work
one easy way to disable the fps lock is patch UnityEngine.QualitySettings.set_vSyncCount and change the given parameter to 0
example in a il2cpp game:
Code: Select all
[enable]
{$lua}
LaunchMonoDataCollector()
while monopipe and monoSymbolList.FullyLoaded==false do
checkSynchronize()
end
{$asm}
alloc(newmem,2048,UnityEngine.QualitySettings.set_vSyncCount)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov rcx,0
originalcode:
push rbx
sub rsp,20
exit:
jmp returnhere
UnityEngine.QualitySettings.set_vSyncCount:
jmp newmem
nop
returnhere:
[disable]
UnityEngine.QualitySettings.set_vSyncCount:
push rbx
sub rsp,20
after touching the graphical settings in the game, speedhack will be functioning like before