No vehicle damage.
So far this has worked against most things, but if I were to crash my aircraft, it still blows up. I'm still trying to work that one out. I'll update when/if I do.
Thanks SunBeam for the tips and your Debug code. That all helped immensely!
Code: Select all
{ Game : FarCry5.exe
Version:
Date : 2018-04-04
Author : draxhax
No Vehicle Damage - does not prevent aircraft crash - you must be in the vehicle
}
[ENABLE]
aobscanmodule(_EnterVehicle,FC_m64.dll,4C 89 57 08 4C 39 E0) // should be unique
registersymbol(_EnterVehicle)
aobscanmodule(_ExitVehicle,FC_m64.dll,48 89 47 08 4C 39 F1) // should be unique
registersymbol(_ExitVehicle)
aobscanmodule(_VehicleDamage,FC_m64.dll,0F 2E B1 48 01 00 00) // should be unique
registersymbol(_VehicleDamage)
alloc(VehicleDamage, 256, FC_m64.dll)
registersymbol(VehicleDamage)
label(VehicleDamageOrg)
registersymbol(VehicleDamageOrg)
label(EnterVehicle)
registersymbol(EnterVehicle)
label(EnterVehicleOrg)
registersymbol(EnterVehicleOrg)
label(ExitVehicle)
registersymbol(ExitVehicle)
label(ExitVehicleOrg)
registersymbol(ExitVehicleOrg)
label(PlayerVehicle)
registersymbol(PlayerVehicle)
VehicleDamage:
push rax
mov rax,[PlayerVehicle]
cmp rax,[rcx+08]
pop rax
jne VehicleDamageOrg
movsd xmm6,[rcx+144]
jmp VehicleDamageOrg
VehicleDamageOrg:
readmem(_VehicleDamage,7)
jmp _VehicleDamage+7
EnterVehicle:
push rbx
mov rbx,[rdi+2980]
cmp byte ptr [rbx+729],00
pop rbx
jne EnterVehicleOrg
mov [PlayerVehicle],r10
jmp EnterVehicleOrg
EnterVehicleOrg:
readmem(_EnterVehicle,7)
jmp _EnterVehicle+7
ExitVehicle:
push rbx
mov rbx,[rdi+2980]
cmp byte ptr [rbx+729],00
pop rbx
jne ExitVehicleOrg
mov [PlayerVehicle],rax
jmp ExitVehicleOrg
ExitVehicleOrg:
readmem(_ExitVehicle,7)
jmp _ExitVehicle+7
PlayerVehicle:
dq 0
_EnterVehicle:
jmp EnterVehicle
nop
nop
_ExitVehicle:
jmp ExitVehicle
nop
nop
_VehicleDamage:
jmp VehicleDamage
nop
nop
[DISABLE]
_EnterVehicle:
readmem(EnterVehicleOrg,7)
_ExitVehicle:
readmem(ExitVehicleOrg,7)
_VehicleDamage:
readmem(VehicleDamageOrg,7)
unregistersymbol(VehicleDamage)
unregistersymbol(VehicleDamageOrg)
unregistersymbol(EnterVehicle)
unregistersymbol(EnterVehicleOrg)
unregistersymbol(ExitVehicle)
unregistersymbol(ExitVehicleOrg)
unregistersymbol(PlayerVehicle)
dealloc(VehicleDamage)
unregistersymbol(_EnterVehicle)
unregistersymbol(_ExitVehicle)
unregistersymbol(_VehicleDamage)