acecel wrote: ↑Fri Feb 09, 2024 4:54 am
...
Here's the code from the Steam release, you can see my injection point below.
Yours is clearly different - might be worth a shot - see what happens before cmp eax,00000100.
The only thing that happens in this code is that we check for 0 (player faction) and then save the pointer to that faction so we can use it in other code. In the Steam build rax contains the faction here: movsxd rax,dword ptr [rax+78], before this instruction is executed.
I'd do a break&trace and see which register contains the correct faction and then adopt the code accordingly.
As long as you store the player faction to pTacFactionPlayer, things will work.
Does that help?
Code: Select all
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI: 55 - push rbp
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+1: 48 8B EC - mov rbp,rsp
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+4: 48 83 EC 30 - sub rsp,30
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+8: 48 89 75 F8 - mov [rbp-08],rsi
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+c: 48 8B F1 - mov rsi,rcx
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+f: 48 8B 46 28 - mov rax,[rsi+28]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+13: 48 8B C8 - mov rcx,rax
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+16: 83 39 00 - cmp dword ptr [rcx],00
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+19: 48 8B 80 B0 00 00 00 - mov rax,[rax+000000B0]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+20: 48 8B C8 - mov rcx,rax
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+23: 83 38 00 - cmp dword ptr [rax],00
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+26: 49 BB D0 39 AB 40 22 02 00 00 - mov r11,PhoenixPoint.Tactical.Levels.TacticalLevelController:get_CurrentFaction
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+30: 41 FF D3 - call r11
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+33: 48 8B C8 - mov rcx,rax
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+36: 83 39 00 - cmp dword ptr [rcx],00
// ---------- INJECTING HERE ----------
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+39: 48 63 40 78 - movsxd rax,dword ptr [rax+78]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+3d: 83 F8 01 - cmp eax,01
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+40: 40 0F 94 C0 - sete al
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+44: 48 0F B6 C0 - movzx rax,al
// ---------- DONE INJECTING ----------
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+48: 48 0F B6 C0 - movzx rax,al
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+4c: 40 88 45 F0 - mov [rbp-10],al
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+50: 48 63 46 68 - movsxd rax,dword ptr [rsi+68]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+54: 3D 00 01 00 00 - cmp eax,00000100
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+59: 75 10 - jne PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+6b
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+5b: 0F B6 45 F0 - movzx eax,byte ptr [rbp-10]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+5f: 85 C0 - test eax,eax
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+61: 40 0F 94 C0 - sete al
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+65: 48 0F B6 C0 - movzx rax,al
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+69: EB 02 - jmp PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+6d
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+6b: 33 C0 - xor eax,eax
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+6d: 48 8B 75 F8 - mov rsi,[rbp-08]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+71: 48 8D 65 00 - lea rsp,[rbp+00]
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+75: 5D - pop rbp
PhoenixPoint.Tactical.Entities.TacticalActorViewBase:ShouldRenderUI+76: C3 - ret