Function at 0x405c80
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 0x405cd3
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x1a9c], ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov eax, dword [edi + 0x4bd0]
mov ebp, 2
cmp eax, ebp
jne 0x405e05
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 0x405d12
mov eax, dword [esp + 0x38]
cdq
idiv ebx
mov ebx, edx
mov eax, dword [edi + 0x1a98]
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 0x405d76
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x405da8
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 0x405d59
cmp eax, 0x102
je 0x405dc7
jmp 0x405d76
mov edx, dword [edi + 0x1a98]
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 0x405de6
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 + 0x1e28]
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, dword [esp + 0x14]
jg 0x405e73
jmp 0x405d03
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x1a9c], 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov edx, dword [esp + 0x28]
mov dword [edi + 0x1a9c], 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 + 0x1a9c], 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 + 0x1a98]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x405dfb
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x405e52
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x1a9c], 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 0x405e88
cmp eax, 0x102
jne 0x405dfb
mov dword [edi + 0x1a9c], 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 + 0x1a98]
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 0x405df0
mov edx, dword [esp + 0x28]
mov dword [edi + 0x1a9c], ebx
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc