Function at 0x402790
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x2c
push esi
mov esi, ecx
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.00402620
push ebx
push ebp
push edi
lea esp, [esp]
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esi + 0x11a00]
cmp dword [eax], 0
je 0x4027f9
mov ecx, dword [esi + 0x119fc]
mov edx, dword [esi + 0x119f8]
mov eax, dword [ecx]
cmp eax, dword [edx]
je 0x4029f1
mov ecx, dword [esi + 0x119fc]
mov edx, dword [esi + 0x119f8]
mov eax, dword [ecx]
cmp eax, dword [edx]
je 0x4027d0
jmp 0x402810
mov ebx, dword [esi + 0x119fc]
mov ecx, dword [esi + 0x11a04]
mov dword [esi + 0x19d0], 1
mov edi, dword [ebx]
movsx ecx, word [ecx + edi*2]
shl ecx, 0xd
mov eax, 0x10624dd3
imul ecx
sar edx, 9
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov eax, edi
cdq
idiv dword [esi + 0x154c]
lea eax, [edi + 1]
mov ebp, edx
mov edx, dword [esi + ebp*4 + 0x1528]
mov dword [esp + 0x18], edx
cdq
idiv dword [esi + 0x119f4]
mov dword [ebx], edx
mov eax, dword [esi + 0x1524]
mov edx, dword [esp + 0x18]
cmp byte [edx + eax], 0x2b
jne 0x4029d6
lea ebp, [esp + ebp*4 + 0x1c]
mov edx, 1
add dword [ebp], edx
mov eax, dword [ebp]
cmp eax, dword [esi + 0x1570]
jb 0x4029d6
xor ebx, ebx
lea ecx, [ecx*4 + 0x7fff]
cmp ecx, 0xffff
mov dword [ebp], ebx
jle 0x4028aa
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], edx
cmp dword [esi + 0x119e0], 0x7c
jb 0x4029d6
mov eax, dword [esi + 0x119e4]
mov ecx, dword [esi + 0x119e8]
shl eax, 8
mov dword [esi + 0x119e0], ebx
mov dword [eax + esi + 0x19e0], ecx
mov dword [eax + esi + 0x19e4], ebx
add dword [esi + 0x119e8], edx
add dword [esi + 0x119e4], edx
cmp dword [esi + 0x119e4], 0x100
jb 0x4029d6
mov eax, dword [esi + 0x1504]
push ebx
lea edx, [esp + 0x18]
push edx
push 0x10000
lea edi, [esi + 0x19e0]
push edi
push eax
mov dword [esi + 0x119e4], ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x10000
push 0xff
push edi
call fcn.0040a680
mov ecx, dword [esp + 0x20]
add esp, 0xc
add dword [esi + 0x19c8], ecx
adc dword [esi + 0x19cc], ebx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov edi, eax
mov edx, edi
sub edx, dword [esp + 0x10]
cmp edx, 0x3e8
jb 0x4029d6
mov ecx, esi
call fcn.00402680
mov eax, dword [esi + 0x19cc]
cmp eax, dword [esi + 0x19dc]
jl 0x4029cb
jg 0x402996
mov ecx, dword [esi + 0x19c8]
cmp ecx, dword [esi + 0x19d8]
jbe 0x4029cb
mov ecx, esi
call fcn.004026b0
mov ecx, esi
call fcn.00402180
mov ecx, dword [esi + 0x119fc]
mov ebp, dword [ecx]
mov eax, ebp
cdq
idiv dword [esi + 0x1548]
cmp edx, ebx
je 0x4029cb
cmp ebp, edx
jl 0x4029c1
sub dword [ecx], edx
jmp 0x4029cb
mov eax, dword [esi + 0x119f4]
sub eax, edx
add dword [ecx], eax
mov ecx, esi
call fcn.00402620
mov dword [esp + 0x10], edi
mov ecx, dword [esi + 0x119fc]
mov edx, dword [esi + 0x119f8]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x402810
jmp 0x4027d0
mov eax, dword [esi + 0x119e0]
test eax, eax
pop edi
pop ebp
pop ebx
je 0x402a1d
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.00402680
mov ecx, esi
call fcn.004026b0
pop esi
add esp, 0x2c
ret