Function at 0x401860
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x130
mov eax, dword [0x422f90]
xor eax, esp
mov dword [esp + 0x12c], eax
cmp dword [0x4243a0], 0
push esi
mov esi, ecx
jne 0x4018a1
push str.1.txt
call fcn.0040ac4f
push 0x41d3ac
push str.1.txt
call fcn.0040ac12
add esp, 0xc
mov dword [0x4243a0], eax
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 4], eax
xor eax, eax
mov ecx, esi
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
call fcn.004016f0
push ebx
push ebp
push edi
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esi + 0x11a00]
cmp dword [eax], 0
je 0x401900
mov ecx, dword [esi + 0x119fc]
mov edx, dword [esi + 0x119f8]
mov eax, dword [ecx]
cmp eax, dword [edx]
je 0x401b79
mov ecx, dword [esi + 0x119fc]
mov edx, dword [esi + 0x119f8]
mov eax, dword [ecx]
cmp eax, dword [edx]
je 0x4018d7
mov ecx, dword [esi + 0x119fc]
mov ebx, 1
mov dword [esi + 0x19d0], ebx
mov ecx, dword [ecx]
mov eax, ecx
cdq
idiv dword [esi + 0x154c]
mov edi, dword [esi + edx*4 + 0x1528]
mov dword [esp + 0x18], edx
mov edx, dword [esi + 0x11a04]
movzx eax, word [edx + ecx*2]
mov ecx, dword [0x424430]
push edi
push eax
call fcn.00407c90
mov ecx, dword [esi + 0x119fc]
mov edx, dword [ecx]
mov eax, dword [esi + 0x11a04]
movzx eax, word [eax + edx*2]
cmp ax, 0x3e8
jle 0x40196e
mov dword [0x4243a8], ebx
movsx ecx, ax
push ecx
lea edx, [esp + edi + 0x40]
lea eax, [edx + edi*4]
push 0x41d3a8
push eax
call fcn.0040a975
add esp, 0xc
cmp edi, 2
jne 0x4019bb
mov edx, dword [0x4243a4]
mov eax, dword [0x4243a0]
lea ecx, [esp + 0x3c]
push ecx
push edx
push str._u__s_n
push eax
call fcn.0040a9ff
add esp, 0x10
add dword [0x4243a4], ebx
mov dword [0x4243a8], 0
mov ebx, dword [esi + 0x119fc]
mov ebp, dword [ebx]
mov ecx, dword [esi + 0x11a04]
movsx ecx, word [ecx + ebp*2]
shl ecx, 0xd
mov eax, 0x10624dd3
imul ecx
sar edx, 9
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
lea eax, [ebp + 1]
cdq
idiv dword [esi + 0x119f4]
mov dword [ebx], edx
mov edx, dword [esi + 0x1524]
cmp byte [edi + edx], 0x2b
jne 0x401b5e
mov eax, dword [esp + 0x18]
lea eax, [esp + eax*4 + 0x1c]
mov edi, 1
add dword [eax], edi
mov edx, dword [eax]
cmp edx, dword [esi + 0x1570]
jb 0x401b5e
xor ebp, ebp
lea ecx, [ecx*4 + 0x7fff]
cmp ecx, 0xffff
mov dword [eax], ebp
jle 0x401a32
mov ecx, 0xffff
mov eax, dword [esi + 0x119e4]
shl eax, 7
add eax, dword [esi + 0x119e0]
mov word [esi + eax*2 + 0x19e8], cx
add dword [esi + 0x119e0], edi
cmp dword [esi + 0x119e0], 0x7c
jb 0x401b5e
mov eax, dword [esi + 0x119e4]
mov ecx, dword [esi + 0x119e8]
shl eax, 8
mov dword [esi + 0x119e0], ebp
mov dword [eax + esi + 0x19e0], ecx
mov dword [eax + esi + 0x19e4], ebp
add dword [esi + 0x119e8], edi
add dword [esi + 0x119e4], edi
cmp dword [esi + 0x119e4], 0x100
jb 0x401b5e
mov eax, dword [esi + 0x1504]
push ebp
lea edx, [esp + 0x18]
push edx
push 0x10000
lea edi, [esi + 0x19e0]
push edi
push eax
mov dword [esi + 0x119e4], ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x10000
push 0xff
push edi
call fcn.0040a590
mov ecx, dword [esp + 0x20]
add esp, 0xc
add dword [esi + 0x19c8], ecx
adc dword [esi + 0x19cc], ebp
call dword [sym.imp.WINMM.dll_timeGetTime]
mov edi, eax
mov edx, edi
sub edx, dword [esp + 0x10]
cmp edx, 0x3e8
jb 0x401b5e
mov ecx, esi
call fcn.00401750
mov eax, dword [esi + 0x19cc]
cmp eax, dword [esi + 0x19dc]
jl 0x401b53
jg 0x401b1e
mov ecx, dword [esi + 0x19c8]
cmp ecx, dword [esi + 0x19d8]
jbe 0x401b53
mov ecx, esi
call fcn.00401780
mov ecx, esi
call fcn.00401250
mov ecx, dword [esi + 0x119fc]
mov ebx, dword [ecx]
mov eax, ebx
cdq
idiv dword [esi + 0x1548]
cmp edx, ebp
je 0x401b53
cmp ebx, edx
jl 0x401b49
sub dword [ecx], edx
jmp 0x401b53
mov eax, dword [esi + 0x119f4]
sub eax, edx
add dword [ecx], eax
mov ecx, esi
call fcn.004016f0
mov dword [esp + 0x10], edi
mov ecx, dword [esi + 0x119fc]
mov edx, dword [esi + 0x119f8]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x401912
jmp 0x4018d7
mov eax, dword [esi + 0x119e0]
test eax, eax
pop edi
pop ebp
pop ebx
je 0x401ba5
push 0
lea ecx, [esp + 0xc]
push ecx
shl eax, 8
push eax
mov eax, dword [esi + 0x1504]
lea edx, [esi + 0x19e0]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, esi
call fcn.00401750
mov ecx, esi
call fcn.00401780
mov ecx, dword [esp + 0x130]
pop esi
xor ecx, esp
call fcn.0040a9f0
add esp, 0x130
ret