218 lines
6.9 KiB
Lua
218 lines
6.9 KiB
Lua
require(GlobalDependencys:GetDependency("StandardBase"):GetPackageName())
|
|
|
|
--ControlVars
|
|
bFixEnabled = true
|
|
bAspect = true
|
|
bFOV = true
|
|
|
|
--GAME VARS
|
|
fDefaultFOV = 0
|
|
fAspectRatio = 0
|
|
fAdditionalFOV = 0
|
|
|
|
--PROCESS VARS
|
|
Process_FriendlyName = Module:GetFriendlyName()
|
|
Process_WindowName = "House of Ashes "
|
|
Process_ClassName = "UnrealWindow"
|
|
Process_EXEName = "*"
|
|
|
|
--INJECTION BEHAVIOUR
|
|
InjectDelay = 500
|
|
WriteInterval = 500
|
|
SearchInterval = 1000
|
|
SuspendThread = true
|
|
|
|
--Name Manual/Auto/Hybrid Steam/Origin/Any IncludeFile:Configure;Enable;Periodic;Disable;
|
|
SupportedVersions = {
|
|
{"Automatically Detect", "Hybrid", "Any", "Configure_SignatureScan;Enable_Inject;Periodic;Disable_Inject;"},
|
|
}
|
|
|
|
function Init_Controls()
|
|
|
|
DefaultControls.AddHeader("Header_FixesEnableDisable","Individual Fixes",245,70,210,17)
|
|
DefaultControls.AddHeader("Header_FOV","FOV fine adjustment",15,70,210,17)
|
|
DefaultControls.AddFixedFOVSlider("FOVSlider","FOVSlider_Changed",55,100,125,35,0,70,0,1)
|
|
FOVSlider:SetTickFrequency(5)
|
|
FOVSlider:SetLabel1Text("+0")
|
|
FOVSlider:SetLabel2Text("+70")
|
|
DefaultControls.AddFixToggle("CKFOVFix_Enable","FOV fix","CKFOVFix_Changed",255,101,180,14)
|
|
DefaultControls.AddFixToggle("CKARatioFix_Enable","Aspect Ratio fix","CKARatioFix_Changed",255,121,180,14)
|
|
|
|
end
|
|
|
|
function Configure_SignatureScan()
|
|
|
|
local tAddress = HackTool:AddAddress("FOV")
|
|
|
|
--if HackTool:SignatureScan("E8 ?? ?? ?? ?? F3 0F 59 ?? ?? ?? ?? ?? EB ?? 0F ?? ?? F3 0F ?? ?? ?? ?? ?? ?? 0F",tAddress,PAGE_EXECUTE_READ,0x05,Process_EXEName) == 0 then
|
|
if HackTool:SignatureScan("F3 0F ?? ?? ?? ?? ?? ?? 0F 2F ?? ?? ?? ?? ?? 77 ?? 48 8B ?? ?? ?? ?? ?? F3 0F ?? ?? ?? F3 0F ?? ?? ?? ?? ?? ??",tAddress,PAGE_EXECUTE_READ,0x05,Process_EXEName) == 0 then
|
|
|
|
return ErrorOccurred(string.format(SigScanError,tAddress:GetName()))
|
|
else
|
|
print( tAddress:GetInfo(TYPE_ADDRESS) )
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB4F - F3 0F5E C1 - divss xmm0,xmm1
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB53 - E8 0DF06701 - call HouseOfAshes-Win64-Shipping.exe+4CECB65
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB58 - F3 0F59 05 881F7002 - mulss xmm0,[HouseOfAshes-Win64-Shipping.exe+5D6FAE8]
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB60 - EB 03 - jmp HouseOfAshes-Win64-Shipping.exe+366DB65
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB62 - 0F57 C0 - xorps xmm0,xmm0
|
|
end
|
|
|
|
local tAddress = HackTool:AddAddress("AspectFix1")
|
|
|
|
if HackTool:SignatureScan("76 ?? F3 0F ?? ?? ?? ?? ?? ?? F3 0F ?? ?? F3 0F 11 ?? ?? ?? ?? ?? F3 0F 11 ?? ?? ?? ?? ?? 0F",tAddress,PAGE_EXECUTE_READ,0x0E,Process_EXEName) == 0 then
|
|
return ErrorOccurred(string.format(SigScanError,tAddress:GetName()))
|
|
else
|
|
print( tAddress:GetInfo(TYPE_ADDRESS) )
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB7A - F3 0F10 83 3C080000 - movss xmm0,[rbx+0000083C]
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB82 - F3 0F5E C1 - divss xmm0,xmm1
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB86 - F3 0F11 83 44080000 - movss [rbx+00000844],xmm0
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB8E - F3 0F11 83 18020000 - movss [rbx+00000218],xmm0
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB96 - 0F28 74 24 20 - movaps xmm6,[rsp+20]
|
|
end
|
|
|
|
local tAddress = HackTool:AddAddress("AspectFix2")
|
|
|
|
if HackTool:SignatureScan("76 ?? F3 0F ?? ?? ?? ?? ?? ?? F3 0F ?? ?? F3 0F ?? ?? E8 ?? ?? ?? ?? F3 0F",tAddress,PAGE_EXECUTE_READ,0x02,Process_EXEName) == 0 then
|
|
return ErrorOccurred(string.format(SigScanError,tAddress:GetName()))
|
|
else
|
|
print( tAddress:GetInfo(TYPE_ADDRESS) )
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB39 - F3 0F11 83 64080000 - movss [rbx+00000864],xmm0
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB41 - 76 1F - jna HouseOfAshes-Win64-Shipping.exe+366DB62
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB43 - F3 0F10 83 3C080000 - movss xmm0,[rbx+0000083C]
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB4B - F3 0F58 C9 - addss xmm1,xmm1
|
|
--HouseOfAshes-Win64-Shipping.exe+366DB4F - F3 0F5E C1 - divss xmm0,xmm1
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
function Periodic()
|
|
|
|
local Variables = HackTool:GetAllocation("Variables")
|
|
|
|
if Variables and Variables["FOVIn"] and Variables["AdditionalFOV"] and bFOV then
|
|
fFOVIn = Variables["FOVIn"]:ReadFloat()
|
|
fFOVOut = Variables["FOVOut"]:ReadFloat()
|
|
PluginViewport:AppendStatusMessage( string.format("\r\n===== Fix informations =====\r\nFOV In: %0.f, FOV Out : %.0f", fFOVIn, fFOVOut))
|
|
end
|
|
|
|
end
|
|
|
|
function Enable_Inject()
|
|
|
|
local Variables = HackTool:AllocateMemory("Variables",0)
|
|
Variables:PushFloat("AspectRatio")
|
|
Variables:PushFloat("FOVIn")
|
|
Variables:PushFloat("FOVOut")
|
|
Variables:PushFloat("AdditionalFOV")
|
|
Variables:Allocate()
|
|
Variables["FOVIn"]:WriteFloat(fDefaultFOV)
|
|
Variables["AdditionalFOV"]:WriteFloat(fAdditionalFOV)
|
|
|
|
ResolutionChanged()
|
|
|
|
asm = [[
|
|
|
|
(codecave:jmp)FOV,FOV_cc:
|
|
%originalcode%
|
|
cmp r15,0 ; will not affect main menu
|
|
je exit
|
|
|
|
movss [(allocation)Variables->FOVIn],$$1 $ctx=1
|
|
addss $$1,[(allocation)Variables->AdditionalFOV] $ctx=1
|
|
movss [(allocation)Variables->FOVOut],$$1 $ctx=1
|
|
|
|
exit:
|
|
jmp %returnaddress%
|
|
%end%
|
|
|
|
(codecave:jmp)AspectFix1,AspectFix1_cc:
|
|
movss $$2,[(allocation)Variables->AspectRatio] $ctx=1
|
|
%originalcode%
|
|
jmp %returnaddress%
|
|
%end%
|
|
|
|
; following code will compensate widers aspect ratios for FOV
|
|
(codecave:jmp)AspectFix2,AspectFix2_cc:
|
|
movss xmm15,[$$2+4] $ctx=1
|
|
mulss xmm15,[(allocation)Variables->AspectRatio]
|
|
movss $$1,xmm15 $ctx=1
|
|
jmp %returnaddress%
|
|
%end%
|
|
|
|
]]
|
|
|
|
if HackTool:CompileAssembly(asm,"Fixes") == nil then
|
|
return ErrorOccurred("Assembly compilation failed...")
|
|
else
|
|
Toggle_CodeCave("AspectFix1_cc",bAspect)
|
|
Toggle_CodeCave("AspectFix2_cc",bAspect)
|
|
Toggle_CodeCave("FOV_cc",bFOV)
|
|
end
|
|
|
|
Write_FOV()
|
|
|
|
end
|
|
|
|
function CKFOVFix_Changed(Sender)
|
|
|
|
bFOV = Toggle_CheckFix(Sender)
|
|
Toggle_CodeCave("FOV_cc",bFOV)
|
|
ForceUpdate()
|
|
|
|
end
|
|
|
|
function CKARatioFix_Changed(Sender)
|
|
|
|
bAspect = Toggle_CheckFix(Sender)
|
|
Toggle_CodeCave("AspectFix1_cc",bAspect)
|
|
Toggle_CodeCave("AspectFix2_cc",bAspect)
|
|
ForceUpdate()
|
|
|
|
end
|
|
|
|
function FOVSlider_Changed(Sender)
|
|
|
|
fAdditionalFOV = Sender:GetPosition()
|
|
lblFOVSlider.Caption:SetCaption( string.format("%.0f",fAdditionalFOV) )
|
|
|
|
if bFOV then
|
|
Write_FOV()
|
|
end
|
|
|
|
ForceUpdate()
|
|
|
|
end
|
|
|
|
function Write_FOV()
|
|
|
|
local Variables = HackTool:GetAllocation("Variables")
|
|
if Variables and Variables["AdditionalFOV"] then
|
|
Variables["AdditionalFOV"]:WriteFloat(fAdditionalFOV)
|
|
end
|
|
|
|
end
|
|
|
|
function ResolutionChanged()
|
|
|
|
local fAspectRatio = DisplayInfo:GetAspectRatio()
|
|
|
|
local Variables = HackTool:GetAllocation("Variables")
|
|
if Variables then
|
|
Variables["AspectRatio"]:WriteFloat(fAspectRatio)
|
|
end
|
|
|
|
end
|
|
|
|
function Disable_Inject()
|
|
CleanUp()
|
|
end
|
|
|
|
function Init()
|
|
Init_BaseControls()
|
|
Init_Controls()
|
|
end
|
|
|
|
function DeInit()
|
|
DisableFix()
|
|
end |