Function at 0x409040
Capabilities:
Encode data using xor
Print debug messages

Disassembly:
mov eax, dword fs:[0]
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x409620
push eax
mov dword fs:[0], esp
mov eax, dword [0x43b2a4]
sub esp, 0xd8
test eax, eax
push ebx
push esi
push edi
je 0x409074
mov eax, 1
jmp 0x409643
mov ecx, 0x4fcba0
xor esi, esi
call fcn.004185f0
lea eax, [ebp - 0xe4]
mov dword [0x43b2a4], esi
mov dword [ebp - 0xe4], 0x94
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov eax, dword [ebp - 0xd4]
cmp eax, 2
je 0x4090b1
mov eax, dword [0x43b214]
cmp eax, esi
je 0x4090b6
mov esi, 1
mov eax, dword [0x43b274]
mov dword [0x43b294], esi
test eax, eax
jne 0x409632
mov eax, dword [0x43b264]
mov ecx, dword [0x43b26c]
add eax, 8
mov edx, dword [0x43b268]
push eax
push 8
push 0x64
push 0x20
push ecx
push edx
push esi
mov ecx, 0x4fcba0
call fcn.00418440
test eax, eax
je 0x409632
push 0
mov ecx, 0x4fcba0
mov dword [0x43b2a0], 0
mov dword [0x43b2a4], 1
push 0
push str.Mods_BeatWave.mod
call fcn.00418710
push 1
mov ecx, 0x4fcba0
push 0
push str.Mods_Raiders.mod
call fcn.00418710
push 2
mov ecx, 0x4fcba0
push 0
push str.Mods_Seasons.mod
call fcn.00418710
push 3
mov ecx, 0x4fcba0
push 0
push str.Mods_OrbFlowr.mod
call fcn.00418710
mov dword [0x43b284], 4
lea ecx, [ebp - 0x28]
call fcn.00419860
push 0
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
push 0
push str.InGameMods_.mod
call fcn.00419a10
push 0
lea ecx, [ebp - 0x28]
push 0
push str.InGameMods_.xm
call fcn.00419a80
push 0
lea ecx, [ebp - 0x28]
push 0
push str.InGameMods_.s3m
call fcn.00419a80
mov dword [ebp - 0x10], 0
mov ecx, dword [ebp - 0x18]
mov dword [0x43b288], ecx
test ecx, ecx
jle 0x4092ba
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x28]
push eax
call fcn.00419f70
push eax
lea ecx, [ebp - 0x38]
push str.InGameMods_
call fcn.0040cf00
mov byte [ebp - 4], 1
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.0040d2d0
mov byte [ebp - 4], 2
add esp, 0xc
mov eax, dword [eax]
test eax, eax
jne 0x4091f7
mov eax, 0x432284
mov ecx, dword [ebp - 0x10]
add ecx, 4
push ecx
push 0
push eax
mov ecx, 0x4fcba0
call fcn.00418710
mov ecx, dword [ebp - 0x14]
cmp eax, 1
mov byte [ebp - 4], 1
mov eax, ecx
sbb eax, ecx
mov dword [ebp - 0x14], eax
neg eax
mov dword [ebp - 0x14], eax
call fcn.00409618
mov byte [ebp - 4], 0
call fcn.00409610
mov ecx, dword [ebp - 0x14]
test ecx, ecx
je 0x4092a8
push 0x43b7f0
mov eax, dword [ebp - 0x10]
push eax
lea ecx, [ebp - 0x28]
call fcn.00419f70
push eax
lea ecx, [ebp - 0x50]
push str.Error_loading_module
call fcn.0040cf00
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x48]
push eax
call fcn.0040d2d0
add esp, 0xc
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x40]
push eax
call fcn.0040d2d0
mov byte [ebp - 4], 5
add esp, 0xc
mov eax, dword [eax]
test eax, eax
jne 0x409286
mov eax, 0x432284
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov byte [ebp - 4], 4
call fcn.00409608
mov byte [ebp - 4], 3
call fcn.00409600
mov byte [ebp - 4], 0
call fcn.004095f8
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x10], eax
cmp eax, ecx
jl 0x4091bd
mov eax, dword [0x43b288]
test eax, eax
jg 0x4092ce
push str.No_InGame_Mods_Found__n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x43b27c]
xor esi, esi
add eax, dword [0x43b288]
mov dword [0x43b28c], eax
lea edx, [eax + 1]
test edx, edx
jle 0x4092ff
mov ecx, 0x4fae10
mov eax, dword [0x43b280]
cmp eax, esi
je 0x4092fa
mov dword [ecx], esi
add ecx, 4
inc esi
cmp edx, esi
jg 0x4092f1
mov dword [ebp - 0x14], 0x64
mov dword [ebp - 0x10], 0
mov eax, dword [0x43b28c]
test eax, eax
jle 0x4093f3
mov edi, dword [0x43b28c]
mov esi, dword [0x43b1a0]
imul esi, esi, 0x41c64e6d
add esi, 0x3039
mov dword [0x43b1a0], esi
call fcn.00424be0
mov ebx, eax
and esi, 0x7fff0000
shr esi, 0x10
call dword [sym.imp.WINMM.dll_timeGetTime]
imul ebx, ebx, 0x19660d
add ebx, 0x3c6ef35f
xor ebx, esi
xor ebx, eax
call fcn.00424be0
xor ebx, eax
sub edx, edx
mov eax, ebx
div edi
mov esi, edx
mov edi, dword [0x43b28c]
mov dword [ebp - 0x2c], edi
mov edi, dword [0x43b1a0]
imul edi, edi, 0x41c64e6d
add edi, 0x3039
mov dword [0x43b1a0], edi
call fcn.00424be0
mov ebx, eax
and edi, 0x7fff0000
shr edi, 0x10
call dword [sym.imp.WINMM.dll_timeGetTime]
imul ebx, ebx, 0x19660d
add ebx, 0x3c6ef35f
xor ebx, edi
xor ebx, eax
call fcn.00424be0
xor ebx, eax
sub edx, edx
mov eax, ebx
mov ebx, dword [0x43b28c]
div dword [ebp - 0x2c]
mov eax, dword [esi*4 + 0x4fae10]
mov ecx, dword [edx*4 + 0x4fae10]
mov dword [esi*4 + 0x4fae10], ecx
mov dword [edx*4 + 0x4fae10], eax
mov edx, dword [ebp - 0x10]
inc edx
mov dword [ebp - 0x10], edx
cmp ebx, edx
jg 0x40931a
mov eax, dword [ebp - 0x14]
dec eax
mov dword [ebp - 0x14], eax
jne 0x409306
push 0
mov ecx, 0x4fcba0
push str.Sounds_boing.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_effect.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_bang.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_ao_laser.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_bassdrum.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_byeball.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_wowpulse.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_saucer.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_orchestr.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_effect2.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_sweepdow.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_peow_.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_fanfare.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_padexplo.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_ricochet.wav
call fcn.004188b0
push 0
push str.Sounds_swordswi.wav
mov ecx, 0x4fcba0
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_gunfire.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_humm.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_glass.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_orchblas.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_tank.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_xplosht1.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_xploshor.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_HighVoltage8.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_Thunder8.wav
call fcn.004188b0
push 0
mov ecx, 0x4fcba0
push str.Sounds_FireLow8.wav
call fcn.004188b0
mov esi, dword [0x43b2a8]
test esi, esi
jl 0x4095e5
push esi
mov ecx, 0x4fcba0
call fcn.004187e0
test eax, eax
je 0x4095e5
push 0x3f
mov ecx, 0x4fcba0
call fcn.00418880
mov dword [0x43b2a8], esi
mov dword [ebp - 4], 0xffffffff
call fcn.0040962a
mov eax, 1
jmp 0x409643
mov eax, 1
mov dword [0x43b2a4], eax
mov dword [0x43b2a0], eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret