Function at 0x403670
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x1c
push ebx
push ebp
xor eax, eax
push esi
xor esi, esi
mov dword [esp + 0x18], eax
push edi
mov dword [esp + 0x20], eax
push esi
mov ebx, 1
push esi
mov dword [esp + 0x2c], eax
push ebx
mov edi, ecx
push esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x38], eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
cmp eax, esi
mov dword [esp + 0x28], eax
jne 0x4036c3
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x18bc], ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov eax, dword [edi + 0x49cc]
mov ebp, 2
cmp eax, ebp
jne 0x4037f5
mov eax, dword [esp + 0x38]
mov ebp, dword [esp + 0x30]
cdq
and edx, 0x1ff
mov ebx, 0x200
add eax, edx
sar eax, 9
mov dword [esp + 0x14], eax
cmp esi, dword [esp + 0x14]
jne 0x403702
mov eax, dword [esp + 0x38]
cdq
idiv ebx
mov ebx, edx
mov eax, dword [edi + 0x18b8]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x10]
push ecx
push edx
push ebx
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x403766
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403798
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x28]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x403749
cmp eax, 0x102
je 0x4037b7
jmp 0x403766
mov edx, dword [edi + 0x18b8]
lea eax, [esp + 0x10]
push 1
lea ecx, [esp + 0x1c]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x4037d6
inc esi
mov edx, dword [esp + 0x38]
mov eax, esi
sub edx, 0x200
imul eax, ebx
push 0xf
mov dword [esp + 0x3c], edx
lea ebp, [eax + edi + 0x1c24]
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, dword [esp + 0x14]
jg 0x403863
jmp 0x4036f3
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x18bc], 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov edx, dword [esp + 0x28]
mov dword [edi + 0x18bc], 2
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov dword [edi + 0x18bc], 1
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x18]
lea eax, [esp + 0x10]
push edx
mov edx, dword [esp + 0x34]
push eax
mov eax, dword [edi + 0x18b8]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4037eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x403842
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x18bc], ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x28]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, esi
je 0x403878
cmp eax, 0x102
jne 0x4037eb
mov dword [edi + 0x18bc], ebp
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov ecx, dword [edi + 0x18b8]
lea edx, [esp + 0x10]
push ebx
lea eax, [esp + 0x1c]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x4037e0
mov edx, dword [esp + 0x28]
mov dword [edi + 0x18bc], ebx
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc