Files
2026-11-23 03:28:32 +02:00

90 lines
2.5 KiB
ArmAsm

/* One selected-client virtual-helper entry for both native graphics paths.
* WowB 70334 passes its resolved CreateDevice pointer in R8 to a selected
* helper vtable slot +8. A client-owned six-byte jump reaches this export.
*
* Preserve the helper's RCX, RDX, R9, stack arguments and return address.
* We replace only R8 with Bridge's genuine-device-first wrapper and tail-jump
* the helper that the original vtable slot held. This is intentionally a leaf
* routine: no prologue, call, temporary stack allocation or unwind state.
* The selected client uses image base 0x140000000 and the following pinned
* vtables/helpers; an unknown variant fails closed before graphics creation.
*/
.intel_syntax noprefix
.text
.p2align 4
.globl gw_startup_graphics_virtual_dispatch
gw_startup_graphics_virtual_dispatch:
mov r10, qword ptr [rcx]
/* D3D11 helper variants all use the same original body. */
movabs r11, 0x1450e3c20
cmp r10, r11
je .Ldx11
movabs r11, 0x1450e3ce0
cmp r10, r11
je .Ldx11
movabs r11, 0x1450e8ba8
cmp r10, r11
je .Ldx11
movabs r11, 0x1450e8c20
cmp r10, r11
je .Ldx11
/* D3D12 retains the selected vendor/feature helper body. */
movabs r11, 0x1450e9020
cmp r10, r11
je .Ldx12_72280
movabs r11, 0x1450e9080
cmp r10, r11
je .Ldx12_72470
movabs r11, 0x1450eb480
cmp r10, r11
je .Ldx12_72280
movabs r11, 0x1450eb5a8
cmp r10, r11
je .Ldx12_71930
/* A repointed slot from another client build must never fall through to
* the wrong graphics helper or initiate a non-Octo login. */
ud2
.Ldx11:
#ifdef GW_STARTUP_DISPATCH_TEST
lea r8, [rip + gw_test_bridge_d3d11]
jmp gw_test_dx11_original
#else
lea r8, [rip + gw_startup_D3D11CreateDevice]
movabs r11, 0x143e6d050
jmp r11
#endif
.Ldx12_72280:
#ifdef GW_STARTUP_DISPATCH_TEST
lea r8, [rip + gw_test_bridge_d3d12]
jmp gw_test_dx12_72280_original
#else
lea r8, [rip + gw_startup_D3D12CreateDevice]
movabs r11, 0x143e72280
jmp r11
#endif
.Ldx12_72470:
#ifdef GW_STARTUP_DISPATCH_TEST
lea r8, [rip + gw_test_bridge_d3d12]
jmp gw_test_dx12_72470_original
#else
lea r8, [rip + gw_startup_D3D12CreateDevice]
movabs r11, 0x143e72470
jmp r11
#endif
.Ldx12_71930:
#ifdef GW_STARTUP_DISPATCH_TEST
lea r8, [rip + gw_test_bridge_d3d12]
jmp gw_test_dx12_71930_original
#else
lea r8, [rip + gw_startup_D3D12CreateDevice]
movabs r11, 0x143e71930
jmp r11
#endif