require(GlobalDependencys:GetDependency("StandardBase"):GetPackageName()) --GAME VARS fFOVScale_WEP = 0 --ControlVars bFixEnabled = true bAspectFix = true bWeaponFOVScale = true --PROCESS VARS Process_FriendlyName = Module:GetFriendlyName() Process_WindowName = "DOOMx64;DOOMx64vk" Process_ClassName = "Zion" Process_EXEName = "*" --INJECTION BEHAVIOUR InjectDelay = 1500 WriteInterval = 100 SearchInterval = 500 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() local OffsetX = 245 local OffsetY = 75 local OffsetFHX = 15 local OffsetFHY = 29 local OffsetItemX = 230 local OffsetItemY = 19 local ItemWidth = 180 local ItemHeight = 14 DefaultControls.AddHeader("Header_FixesEnableDisable","Individual Fixes",OffsetX,OffsetY,210,17) DefaultControls.AddFixToggle("CKAspectFix_Enable","Aspect Fix","CKAspectFix_Changed",OffsetX + OffsetFHX + (OffsetItemX*0),OffsetY + OffsetFHY + (OffsetItemY*0),ItemWidth,ItemHeight, true) DefaultControls.AddFixToggle("CKFOVFix_WEP_Enable","Weapon FOV Scale","CKFOVFix_WEP_Changed",OffsetX + OffsetFHX + (OffsetItemX*0),OffsetY+OffsetFHY + (OffsetItemY*1),ItemWidth,ItemHeight,true) OffsetX = 15 OffsetY = 75 OffsetFHX = 40 OffsetFHY = 30 OffsetItemX = 230 OffsetItemY = 58 ItemWidth = 125 ItemHeight = 30 DefaultControls.AddHeader("Header_FOV_FP","FOV adjustment (Additional)",OffsetX,OffsetY,210,17) DefaultControls.AddFOVSlider("FOVSliderWEPScale","FOVSliderWEPScale_Changed",OffsetX + OffsetFHX + (OffsetItemX*0),OffsetY+OffsetFHY+(OffsetItemY*0),ItemWidth,ItemHeight) end function Configure_SignatureScan() local tAddress = HackTool:AddAddress("AspectFix1") if HackTool:SignatureScan("F3 44 0F 5D ?? ?? ?? ?? ?? F3 0F 59 ?? ?? ?? ?? ?? F3 44 0F 5F ?? ?? ?? ?? ?? F3 0F ?? ?? F3",tAddress,0,0x0,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else print( tAddress:GetInfo(TYPE_ADDRESS) ) end local tAddress = HackTool:AddAddress("AspectFix2") if HackTool:SignatureScan("F3 0F 59 ?? ?? ?? ?? ?? F3 44 0F 5D ?? ?? ?? ?? ?? F3 44 0F 5F ?? ?? ?? ?? ?? 0F",tAddress,0,0x08,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else print( tAddress:GetInfo(TYPE_ADDRESS) ) end local tAddress = HackTool:AddAddress("WeaponFOVScale_HOR") if HackTool:SignatureScan("F3 0F 10 ?? ?? F3 0F 11 4C ?? ?? F3 0F 10 ?? ?? 75",tAddress,0,0x0,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else print( tAddress:GetInfo(TYPE_ADDRESS) ) end local tAddress = HackTool:AddAddress("WeaponFOVScale_VER") if HackTool:SignatureScan("F3 0F 10 ?? ?? F3 0F 11 4C ?? ?? F3 0F 10 ?? ?? 75",tAddress,0,0xB,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else print( tAddress:GetInfo(TYPE_ADDRESS) ) end local tAddress = HackTool:AddAddress("WeaponFOVScale2") if HackTool:SignatureScan("F3 0F 58 ?? F3 0F 58 ?? 41 0F 28 ?? F3 0F 59 ?? ?? F3 0F 58 ?? F3 44 0F 10 ?? ?? ?? ?? ?? F3",tAddress,0,0x15,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else print( tAddress:GetInfo(TYPE_ADDRESS) ) end local tAddress = HackTool:AddAddress("WeaponFOVScale3") if HackTool:SignatureScan("41 0F 28 ?? F3 44 0F 59 ?? F3 41 0F 59 ?? F3 41 0F 59 ?? F3 44 0F 58 ?? F3 0F 10 ?? ?? ?? ?? ?? F3",tAddress,0,0x18,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else print( tAddress:GetInfo(TYPE_ADDRESS) ) end local tAddress = HackTool:AddAddress("FOVPtr") if HackTool:SignatureScan("0F 2F ?? 73 ?? 0F 2E ?? ?? ?? ?? ?? 7A ?? 75 ?? F3 0F",tAddress,0,0x5,Process_EXEName) == 0 then return ErrorOccurred(string.format(SigScanError,tAddress:GetName())) else local RelativeAddress = tAddress:GetBaseAddress() + tAddress:GetAddress() + 3 + 4 local tAddress = HackTool:AddAddress("FOVPtr2",HackTool:GetBaseAddress(),(RelativeAddress + tAddress:ReadInt(3)) - tAddress:GetBaseAddress()) print( tAddress:GetInfo(TYPE_FLOAT) ) end return true end function Enable_Inject() local Variables = HackTool:AllocateMemory("Variables",0) Variables:PushFloat("DefaultWeaponFOVScaleX") Variables:PushFloat("DefaultWeaponFOVScaleY") Variables:PushFloat("NewWeaponFOVScaleX") Variables:PushFloat("NewWeaponFOVScaleY") Variables:PushFloat("AddWeaponFOVScale") Variables:PushFloat("HorizontalFOV") Variables:PushFloat("VerticalFOV") Variables:PushFloat("AspectRatio") Variables:Allocate() ResolutionChanged() local asm = [[ (codecave:jmp)WeaponFOVScale_HOR,WeaponFOVScale_HOR_cc: %originalcode% movss [(allocation)Variables->HorizontalFOV], $$1 $ctx=1 jmp %returnaddress% %end% (codecave:jmp)WeaponFOVScale_VER,WeaponFOVScale_VER_cc: %originalcode% movss [(allocation)Variables->VerticalFOV], $$1 $ctx=1 jmp %returnaddress% %end% (codecave:jmp)WeaponFOVScale2,WeaponFOVScale2_cc: movss $$1, [$$2] $ctx=1 movss [(allocation)Variables->DefaultWeaponFOVScaleY], $$1 $ctx=1 addss $$1, [(allocation)Variables->AddWeaponFOVScale] $ctx=1 movss [(allocation)Variables->NewWeaponFOVScaleY], $$1 $ctx=1 jmp %returnaddress% %end% (codecave:jmp)WeaponFOVScale3,WeaponFOVScale3_cc: movss $$1, [$$2] $ctx=1 movss [(allocation)Variables->DefaultWeaponFOVScaleX], $$1 $ctx=1 movss [(allocation)Variables->NewWeaponFOVScaleX], $$1 $ctx=1 jmp %returnaddress% %end% SkipAspectBelow: (float)1.78 (codecave)AspectFix1,AspectFix1_cc: jmp $ + $$len %end% (codecave)AspectFix2,AspectFix2_cc: jmp $ + $$len %end% ]] if HackTool:CompileAssembly(asm,"Fixes") == nil then return ErrorOccurred("Assembly compilation failed...") else Toggle_CodeCave("AspectFix1_cc",bAspectFix) Toggle_CodeCave("AspectFix2_cc",bAspectFix) Toggle_CodeCave("WeaponFOVScale_HOR_cc",bWeaponFOVScale) Toggle_CodeCave("WeaponFOVScale_VER_cc",bWeaponFOVScale) Toggle_CodeCave("WeaponFOVScale2_cc",bWeaponFOVScale) Toggle_CodeCave("WeaponFOVScale3_cc",bWeaponFOVScale) end end function Periodic() PluginViewport:AppendStatusMessage( "\r\n" ) local Variables = HackTool:GetAllocation("Variables") if Variables then if bWeaponFOVScale == true then PluginViewport:AppendStatusMessage( string.format(" (WeaponFOVScale) Scale (X/Y): %.2f / %.2f, FOV (H/V): %.2f / %.2f, New Scale (X/Y): %.2f / %.2f", Variables["DefaultWeaponFOVScaleX"]:ReadFloat(),Variables["DefaultWeaponFOVScaleY"]:ReadFloat(),Variables["HorizontalFOV"]:ReadFloat(),Variables["VerticalFOV"]:ReadFloat(),Variables["NewWeaponFOVScaleX"]:ReadFloat(),Variables["NewWeaponFOVScaleY"]:ReadFloat()) ) end Variables["AddWeaponFOVScale"]:WriteFloat(fFOVScale_WEP) end end function Disable_Inject() CleanUp() end function ResolutionChanged() local Variables = HackTool:GetAllocation("Variables") if Variables and Variables["AspectRatio"] then Variables["AspectRatio"]:WriteFloat(DisplayInfo:GetAspectRatio()) end end function FOVSliderWEPScale_Changed(Sender) fFOVScale_WEP = Round(Sender:GetScaledFloat(50),2) lblFOVSliderWEPScale.Caption:SetCaption( string.format("Weapon FOV Scale: %.2f",fFOVScale_WEP) ) ForceUpdate() end function CKFOVFix_WEP_Changed(Sender) bWeaponFOVScale = Toggle_CheckFix(Sender) Toggle_CodeCave("WeaponFOVScale_HOR_cc",bWeaponFOVScale) Toggle_CodeCave("WeaponFOVScale_VER_cc",bWeaponFOVScale) Toggle_CodeCave("WeaponFOVScale2_cc",bWeaponFOVScale) Toggle_CodeCave("WeaponFOVScale3_cc",bWeaponFOVScale) ForceUpdate() end function CKAspectFix_Changed(Sender) bAspectFix = Toggle_CheckFix(Sender) Toggle_CodeCave("AspectFix1_cc",bAspectFix) Toggle_CodeCave("AspectFix2_cc",bAspectFix) ForceUpdate() end function Init() Init_BaseControls() Init_Controls() end function DeInit() DisableFix() end function HK_IncreaseFOV() FOVSliderWEPScale:OffsetPosition(1) end function HK_DecreaseFOV() FOVSliderWEPScale:OffsetPosition(-1) end