Function at 0x4040c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xe8
mov eax, dword [0x409094]
mov esi, dword [ebp + 8]
test eax, eax
je 0x404288
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call dword [0x409094]
movzx eax, al
bt eax, esi
jae 0x404370
mov ecx, dword [0x409084]
xor eax, eax
mov ebx, dword fs:[0x18]
cmp dword [ebx + 0x24], ecx
je 0x404184
test byte [0x405018], 8
jne 0x404220
lea ebx, [ebp - 0xd4]
mov edi, ebx
test byte [0x405028], 8
jne 0x4041d0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x24]
mov dword [esp + 4], str._04x:
mov dword [esp], edi
mov dword [esp + 8], eax
call sym._sprintf
mov edx, dword [ebp + 0x10]
test edx, edx
je 0x404153
cmp esi, 3
jbe 0x404190
mov dword [esp], 2
call dword [sym.imp.ucrtbase.dll___acrt_iob_func]
mov dword [esp], ebx
mov esi, eax
call dword [sym.imp.ucrtbase.dll_strlen]
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_fwrite]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
add eax, edi
mov edi, dword [ebp + 0x10]
mov dword [esp + 0x14], edi
mov ecx, dword [ebp + 0xc]
mov dword [esp + 8], str._s:_s:_s
lea edx, [ecx + 1]
mov dword [esp], eax
mov dword [esp + 0x10], edx
mov edx, dword [esi*4 + 0x407ad4]
mov dword [esp + 0xc], edx
mov edx, ebx
sub edx, eax
add edx, 0xc8
mov dword [esp + 4], edx
call sym._snprintf.constprop.0
jmp 0x404153
mov ecx, dword [0x409094]
test ecx, ecx
je 0x404310
mov dword [esp], 0x405028
call dword [0x409094]
test al, 8
je 0x40412a
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x20]
mov dword [esp], edi
mov dword [esp + 4], str._04x:
mov dword [esp + 8], eax
call sym._sprintf
add edi, eax
jmp 0x40412a
mov edi, dword [0x409094]
test edi, edi
je 0x4042d0
mov dword [esp], 0x405018
call dword [0x409094]
test al, 8
je 0x404115
call dword [sym.imp.kernel32.dll_GetTickCount]
lea ebx, [ebp - 0xd4]
mov dword [esp + 4], str._3u._03u:
mov ecx, eax
mov eax, 0x10624dd3
mov dword [esp], ebx
mul ecx
shr edx, 6
imul eax, edx, 0x3e8
mov dword [esp + 8], edx
sub ecx, eax
mov dword [esp + 0xc], ecx
call sym._sprintf
lea edi, [ebx + eax]
jmp 0x40411d
mov ebx, dword fs:[0x18]
mov edi, dword [ebx + 0x34]
mov dword [esp], str.ntdll.dll
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 4], str.__wine_dbg_get_channel_flags
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetProcAddress]
mov edx, sym._fallback__wine_dbg_get_channel_flags
sub esp, 8
test eax, eax
cmove eax, edx
xchg dword [0x409094], eax
mov dword [ebx + 0x34], edi
jmp 0x4040dc
mov edi, dword [ebx + 0x34]
mov dword [esp], str.ntdll.dll
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 4], str.__wine_dbg_get_channel_flags
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetProcAddress]
mov edx, sym._fallback__wine_dbg_get_channel_flags
sub esp, 8
test eax, eax
cmove eax, edx
xchg dword [0x409094], eax
mov dword [ebx + 0x34], edi
jmp 0x40422e
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x34]
mov dword [ebp - 0xdc], edx
mov dword [ebp - 0xd8], eax
mov dword [esp], str.ntdll.dll
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 4], str.__wine_dbg_get_channel_flags
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetProcAddress]
mov ecx, sym._fallback__wine_dbg_get_channel_flags
sub esp, 8
test eax, eax
cmove eax, ecx
xchg dword [0x409094], eax
mov eax, dword [ebp - 0xd8]
mov edx, dword [ebp - 0xdc]
mov dword [edx + 0x34], eax
jmp 0x4041de
mov eax, 0xffffffff
jmp 0x404184