Function at 0x404310
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0xd0
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov ecx, dword [0x407060]
test ecx, ecx
jne 0x404383
mov eax, dword fs:[0x18]
mov dword [ebp - 0xdc], eax
mov eax, dword [ebp - 0xdc]
mov ebx, dword [eax + 0x34]
push 0x405b3c
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x405b0c
push eax
call dword [sym.imp.kernel32.dll_GetProcAddress]
test eax, eax
mov ecx, sym._fallback__wine_dbg_get_channel_flags
cmovne ecx, eax
xchg dword [0x407060], ecx
mov eax, dword fs:[0x18]
mov dword [ebp - 0xdc], eax
mov eax, dword [ebp - 0xdc]
mov dword [eax + 0x34], ebx
mov ecx, dword [0x407060]
push esi
call ecx
add esp, 4
movzx eax, al
bt eax, edi
jae 0x40458e
mov ecx, dword [0x4070ec]
mov eax, dword fs:[0x18]
mov dword [ebp - 0xdc], eax
mov edx, dword [ebp - 0xdc]
xor eax, eax
cmp ecx, dword [edx + 0x24]
je 0x404593
lea ebx, [ebp - 0xdc]
test byte [0x407025], 8
je 0x40446d
mov ecx, dword [0x407060]
test ecx, ecx
jne 0x404426
mov eax, dword fs:[0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x14], eax
push 0x405b3c
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x405b0c
push eax
call dword [sym.imp.kernel32.dll_GetProcAddress]
test eax, eax
mov ecx, sym._fallback__wine_dbg_get_channel_flags
cmovne ecx, eax
xchg dword [0x407060], ecx
mov eax, dword fs:[0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
mov dword [eax + 0x34], ecx
mov ecx, dword [0x407060]
push 0x407025
call ecx
add esp, 4
test al, 8
je 0x40446d
call dword [sym.imp.kernel32.dll_GetTickCount]
mov ecx, eax
mov edx, 0x10624dd3
mul edx
shr edx, 6
imul eax, edx, 0x3e8
sub ecx, eax
lea eax, [ebp - 0xdc]
push ecx
push edx
push str._3u._03u:
push eax
call sym._sprintf
add esp, 0x10
lea ebx, [eax + ebp]
add ebx, 0xffffff24
test byte [0x407035], 8
je 0x404502
mov ecx, dword [0x407060]
test ecx, ecx
jne 0x4044d5
mov eax, dword fs:[0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x14], eax
push 0x405b3c
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x405b0c
push eax
call dword [sym.imp.kernel32.dll_GetProcAddress]
test eax, eax
mov ecx, sym._fallback__wine_dbg_get_channel_flags
cmovne ecx, eax
xchg dword [0x407060], ecx
mov eax, dword fs:[0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
mov dword [eax + 0x34], ecx
mov ecx, dword [0x407060]
push 0x407035
call ecx
add esp, 4
test al, 8
je 0x404502
mov eax, dword fs:[0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
push dword [eax + 0x20]
push str._04x:
push ebx
call sym._sprintf
add esp, 0xc
add ebx, eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
push dword [eax + 0x24]
push str._04x:
push ebx
call sym._sprintf
add esp, 0xc
cmp edi, 3
ja 0x404561
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x404561
add ebx, eax
inc esi
mov eax, dword [edi*4 + 0x405ad8]
lea edx, [ebp - 0xdc]
sub edx, ebx
add edx, 0xc8
sub esp, 0x18
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], eax
mov dword [esp], ebx
mov dword [esp + 4], edx
call sym._snprintf
add esp, 0x18
push 2
call dword [sym.imp.ucrtbase.dll___acrt_iob_func]
add esp, 4
mov esi, eax
lea edi, [ebp - 0xdc]
push edi
call dword [sym.imp.ucrtbase.dll_strlen]
add esp, 4
push esi
push eax
push 1
push edi
call dword [sym.imp.ucrtbase.dll_fwrite]
add esp, 0x10
jmp 0x404593
mov eax, 0xffffffff
add esp, 0xd0
pop esi
pop edi
pop ebx
pop ebp
ret