Function at 0x409a40
Capabilities:
Enumerate files on windows
Get file size
Print debug messages
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x598a66
mov eax, dword fs:[0]
push eax
sub esp, 0x2a0
mov eax, dword [0x6102d4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2ac], edx
mov edi, ecx
mov dword [ebp - 0x2a0], edi
push 0x104
lea eax, [ebp - 0x114]
push 0
push eax
call fcn.0056f980
push edi
lea eax, [ebp - 0x114]
xorps xmm0, xmm0
push 0x104
push eax
movq qword [ebp - 0x2a8], xmm0
call fcn.0057c870
push str..
lea eax, [ebp - 0x114]
push 0x104
push eax
call fcn.0057ffcb
add esp, 0x24
lea eax, [ebp - 0x288]
push eax
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [ebp - 0x294], eax
cmp eax, 0xffffffff
je 0x409f11
mov eax, dword [ebp - 0x2a4]
mov ecx, dword [ebp - 0x2a8]
mov ebx, dword [ebp - 0x294]
mov dword [ebp - 0x29c], eax
mov dword [ebp - 0x298], ecx
nop word [eax + eax]
test byte [ebp - 0x288], 0x10
jne 0x409ef4
lea eax, [ebp - 0x25c]
mov dword [ebp - 0x134], 0xf
push eax
lea ecx, [ebp - 0x148]
mov dword [ebp - 0x138], 0
mov byte [ebp - 0x148], 0
call fcn.0040a8c0
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x12c]
push edi
mov dword [ebp - 0x118], 0xf
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
call fcn.0040a8c0
mov byte [ebp - 4], 1
lea eax, [ebp - 0x12c]
mov edx, dword [ebp - 0x118]
cmp edx, 0x10
mov ebx, dword [ebp - 0x12c]
mov edi, dword [ebp - 0x11c]
cmovae eax, ebx
cmp eax, 0x6032f8
ja 0x409bdf
cmp edx, 0x10
lea eax, [ebp - 0x12c]
cmovae eax, ebx
add eax, edi
cmp eax, 0x6032f8
jbe 0x409bdf
cmp edx, 0x10
lea ecx, [ebp - 0x12c]
push 1
cmovae ecx, ebx
mov eax, 0x6032f8
sub eax, ecx
push eax
lea eax, [ebp - 0x12c]
push eax
mov ecx, eax
call fcn.0040aaf0
jmp 0x409c6c
mov eax, edi
not eax
cmp eax, 1
jbe 0x409f2d
lea esi, [edi + 1]
cmp esi, 0xfffffffe
ja 0x409f2d
cmp edx, esi
jae 0x409c0b
push edi
push esi
lea ecx, [ebp - 0x12c]
call fcn.0040aff0
jmp 0x409c24
test esi, esi
jne 0x409c3a
cmp edx, 0x10
mov dword [ebp - 0x11c], esi
lea eax, [ebp - 0x12c]
cmovae eax, ebx
mov byte [eax], 0
mov ebx, dword [ebp - 0x12c]
mov edi, dword [ebp - 0x11c]
mov edx, dword [ebp - 0x118]
test esi, esi
je 0x409c6c
mov al, byte [0x6032f8]
lea ecx, [ebp - 0x12c]
cmp edx, 0x10
cmovae ecx, ebx
mov byte [ecx + edi], al
lea eax, [ebp - 0x12c]
cmp dword [ebp - 0x118], 0x10
mov dword [ebp - 0x11c], esi
cmovae eax, dword [ebp - 0x12c]
mov byte [eax + esi], 0
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x148]
push eax
lea ecx, [ebp - 0x12c]
call fcn.0040aaf0
mov ebx, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push str.file
call ebx
cmp dword [ebp - 0x118], 0x10
lea eax, [ebp - 0x12c]
cmovae eax, dword [ebp - 0x12c]
push eax
call ebx
cmp dword [ebp - 0x118], 0x10
lea eax, [ebp - 0x12c]
push 0
cmovae eax, dword [ebp - 0x12c]
push 0x2000080
push 3
push 0
push 0
push accept
push eax
mov byte [ebp - 0x289], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x2a4], edi
cmp edi, 0xffffffff
jne 0x409cf2
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x409e3a
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0x500000
ja 0x409dc0
lea eax, [ebx + 1]
push eax
call fcn.0045ec70
mov esi, eax
add esp, 4
mov dword [ebp - 0x290], esi
test esi, esi
je 0x409dc0
lea eax, [ebx + 1]
mov dword [ebp - 0x130], 0
push eax
push 0
push esi
call fcn.0056f980
add esp, 0xc
lea eax, [ebp - 0x130]
push 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
xor edi, edi
mov byte [ebp - 0x289], 0
test ebx, ebx
jle 0x409da1
nop dword [eax]
lea edx, [edi + esi]
mov eax, str.GameBxModuleException
mov esi, 0x11
nop dword [eax]
mov ecx, dword [edx]
cmp ecx, dword [eax]
jne 0x409d87
add edx, 4
add eax, 4
sub esi, 4
jae 0x409d70
mov cl, byte [edx]
cmp cl, byte [eax]
je 0x409d94
mov esi, dword [ebp - 0x290]
inc edi
cmp edi, ebx
jge 0x409da1
jmp 0x409d60
mov esi, dword [ebp - 0x290]
mov byte [ebp - 0x289], 1
lea eax, [ebx + 1]
push eax
push 0
push esi
call fcn.0056f980
push esi
mov byte [esi + ebx], 0
call fcn.0045ec79
mov edi, dword [ebp - 0x2a4]
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x289], 0
je 0x409e3a
mov eax, dword [ebp - 0x270]
mov ecx, dword [ebp - 0x274]
cmp eax, dword [ebp - 0x29c]
ja 0x409dee
jne 0x409e3a
cmp ecx, dword [ebp - 0x298]
jbe 0x409e3a
mov ebx, dword [ebp - 0x2ac]
mov dword [ebp - 0x29c], eax
lea eax, [ebp - 0x12c]
mov dword [ebp - 0x298], ecx
cmp ebx, eax
je 0x409e16
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
call fcn.0040a9d0
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push str.change_file
call esi
cmp dword [ebp - 0x118], 0x10
lea eax, [ebp - 0x12c]
cmovae eax, dword [ebp - 0x12c]
push eax
call esi
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x118]
cmp eax, 0x10
jb 0x409e8a
mov edx, dword [ebp - 0x12c]
inc eax
mov ecx, edx
cmp eax, 0x1000
jb 0x409e81
test cl, 0x1f
jne 0x409f32
mov edx, dword [edx - 4]
cmp edx, ecx
jae 0x409f32
sub ecx, edx
cmp ecx, 4
jb 0x409f32
cmp ecx, 0x23
ja 0x409f32
push edx
call fcn.0045fc75
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x134]
mov dword [ebp - 0x118], 0xf
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
cmp eax, 0x10
jb 0x409ee8
mov edx, dword [ebp - 0x148]
inc eax
mov ecx, edx
cmp eax, 0x1000
jb 0x409edf
test cl, 0x1f
jne 0x409f32
mov edx, dword [edx - 4]
cmp edx, ecx
jae 0x409f32
sub ecx, edx
cmp ecx, 4
jb 0x409f32
cmp ecx, 0x23
ja 0x409f32
push edx
call fcn.0045fc75
add esp, 4
mov edi, dword [ebp - 0x2a0]
mov ebx, dword [ebp - 0x294]
lea eax, [ebp - 0x288]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x409b10
push ebx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0045ef18
mov esp, ebp
pop ebp
ret
call fcn.0040acf0
call fcn.00572b79
int3