Useful edits to EDF 5 game executable - KCreator/Earth-Defence-Force-Documentation GitHub Wiki

Contents:

Expanding Chat limits

Refer to this guide. Wiki page will be edited at a later time

Bugfix to mission list error

Souzooka: OK, if I isolated the right bug and it's the only thing wrong with invalid mission IDs, then this should be a potential fix

Replace 37 bytes at EDF5.exe+65260 (0x64660) with 44 8B 52 F8 44 39 D1 72 04 48 31 C0 C3 67 48 8D 0C 49 48 8D 04 8A 48 63 48 08 48 01 C1 48 63 41 08 48 01 C8 C3

enable_ssao:
; load SGO string table length
mov r10d, [rdx-8]
cmp ecx, r10d
jb L
; return NULL if index out of range
xor rax, rax
ret
L:
; load string ourselves and return (logic from orig fn)
lea rcx, [ecx+ecx2]
lea rax, [rdx+rcx
4]
movsxd rcx, dword ptr [rax+8]
add rcx, rax
movsxd rax, dword ptr [rcx+8]
add rax, rcx
ret

Replace 22 bytes at EDF5.exe+556297 (0x555697) with 41 8B CC E8 C1 EF B0 FF 48 85 C0 0F 84 CE 00 00 00 90 90 4C 8B C0

mov ecx, r12d
call ssao_enable
test rax, rax
jz EDF5.exe+556376 ; Skip calling function which renders name
nop
nop
mov r8, rax

this bricks enable_ssao, the debug console command, you know if you ever even got that working You could potentially replace any function though, just move where the first block of code is located and change the function call, E8 C1 EF B0 FF, in the second block