Function at 0x402850
Capabilities:
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x108
mov eax, dword [ecx]
mov ebx, dword [ecx + 4]
mov dword [ebp - 0xec], eax
mov eax, dword [ecx + 8]
mov dword [esp], ebx
mov dword [ebp - 0xf0], eax
call sym.___wine_dbg_get_channel_flags
movzx ecx, byte [ebp - 0xec]
movzx eax, al
sar eax, cl
test al, 1
je 0x402b68
mov esi, dword [0x4080c4]
mov eax, dword fs:[0x18]
cmp dword [eax + 0x24], esi
je 0x402b38
test byte [0x404028], 8
jne 0x402a48
test byte [0x404038], 8
jne 0x4029c0
lea edi, [ebp - 0xe0]
mov esi, edi
test byte [0x404048], 8
jne 0x402a08
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x24]
mov ecx, str._04x:
mov dword [esp + 4], ecx
mov dword [esp], esi
mov dword [esp + 8], eax
call sym._sprintf
mov ecx, dword [ebp - 0xf0]
test ecx, ecx
je 0x40290e
mov edx, dword [ebp - 0xec]
cmp edx, 3
jbe 0x402980
mov dword [esp], 2
mov ebx, edi
call dword [sym.imp.ucrtbase.dll___acrt_iob_func]
mov edx, dword [ebx]
add ebx, 4
lea ecx, [edx - 0x1010101]
not edx
and ecx, edx
and ecx, 0x80808080
je 0x40291d
mov dword [esp + 0xc], eax
mov esi, ecx
mov eax, 1
mov dword [esp + 4], eax
shr esi, 0x10
test ecx, 0x8080
mov dword [esp], edi
cmove ecx, esi
lea esi, [ebx + 2]
mov dl, cl
cmove ebx, esi
add dl, cl
sbb ebx, 3
sub ebx, edi
mov dword [esp + 8], ebx
call dword [sym.imp.ucrtbase.dll_fwrite]
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp + 0x14], ecx
mov ecx, dword [edx*4 + 0x406ac8]
add eax, esi
mov dword [esp], eax
inc ebx
mov edx, str._s:_s:_s
mov dword [esp + 0x10], ebx
mov dword [esp + 8], edx
mov dword [esp + 0xc], ecx
mov ecx, edi
sub ecx, eax
add ecx, 0xc8
mov dword [esp + 4], ecx
call sym._snprintf.constprop.0
jmp 0x40290e
mov dword [esp], 0x404038
call sym.___wine_dbg_get_channel_flags
and al, 8
je 0x4028c6
call dword [sym.imp.kernel32.dll_GetTickCount]
mov edx, 0x10624dd3
mov ecx, eax
mul edx
shr edx, 6
mov dword [esp + 8], edx
imul eax, edx, 0x3e8
sub ecx, eax
mov eax, str._3u._03u:
mov dword [esp + 0xc], ecx
mov dword [esp + 4], eax
jmp 0x402b1d
mov dword [esp], 0x404048
call sym.___wine_dbg_get_channel_flags
and al, 8
je 0x4028db
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x20]
mov dword [esp], esi
mov dword [esp + 8], eax
mov eax, str._04x:
mov dword [esp + 4], eax
call sym._sprintf
add esi, eax
jmp 0x4028db
mov dword [esp], 0x404028
call sym.___wine_dbg_get_channel_flags
and al, 8
je 0x4028b9
mov eax, dword [0x408024]
or eax, dword [0x408020]
je 0x402b50
lea eax, [ebp - 0xe8]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_QueryPerformanceCounter]
mov eax, 0xf4240
mov esi, dword [0x408020]
imul ecx, dword [ebp - 0xe4], 0xf4240
mul dword [ebp - 0xe8]
mov edi, dword [0x408024]
sub esp, 4
add edx, ecx
mov dword [esp + 8], esi
xor esi, esi
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov dword [esp + 4], edx
call sym.___divdi3
mov ecx, 0xf4240
mov dword [esp + 8], ecx
mov dword [esp + 0xc], esi
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [ebp - 0xf8], eax
mov dword [ebp - 0xf4], edx
call sym.___moddi3
mov edx, dword [ebp - 0xf4]
mov dword [esp + 4], edx
mov dword [esp + 0xc], eax
mov eax, 0xf4240
mov dword [esp + 8], eax
xor eax, eax
mov edi, dword [esp + 0xc]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0xf8]
mov dword [esp], eax
call sym.___divdi3
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov eax, str._3u._06u:
mov dword [esp + 4], eax
lea edi, [ebp - 0xe0]
mov dword [esp], edi
call sym._sprintf
add eax, edi
mov esi, eax
jmp 0x4028ce
lea esp, [ebp - 0x10]
xor eax, eax
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp], 0x408020
call dword [sym.imp.kernel32.dll_QueryPerformanceFrequency]
sub esp, 4
jmp 0x402a6d
mov eax, 0xffffffff
jmp 0x40296b