Function at 0x402e60
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov eax, dword [ebx + 0x18]
test ah, 2
je 0x402ed9
mov eax, dword [ebx + 0xc]
test eax, eax
jne 0x402ed9
mov eax, dword [ebx]
push 0x14
push eax
xor esi, esi
call fcn.00403550
mov ecx, eax
mov dword [eax], esi
mov dword [eax + 4], esi
mov dword [eax + 8], esi
mov dword [eax + 0xc], esi
push esi
push esi
push esi
mov dword [eax + 0x10], esi
push esi
mov dword [ebx + 0xc], ecx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov edx, dword [ebx + 0xc]
mov dword [edx + 0x10], eax
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax + 0x10]
test ecx, ecx
jne 0x402ed9
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jne 0x402ec9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
call esi
pop edi
pop esi
add eax, 0xafc80
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov al, byte [ebx + 0x2c]
test al, al
je 0x402fc6
mov edx, dword [ebp + 0x10]
mov eax, dword [ebx + 0x58]
mov ecx, dword [ebp + 0xc]
push eax
mov esi, dword [edx]
mov dword [ebp + 0xc], ecx
mov dword [ebp + 0x10], esi
call fcn.00407470
mov ecx, dword [ebx + 0x48]
xor eax, eax
cmp ecx, eax
jne 0x402f4d
mov ecx, dword [ebx + 0x3c]
mov esi, dword [ebx + 0x44]
mov edx, dword [ebx + 0x50]
xor edi, edi
sub ecx, esi
mov esi, dword [ebx + 0x54]
sbb eax, edi
add ecx, edx
adc eax, esi
mov edi, eax
mov dword [ebp - 4], eax
sar edi, 0x1f
cmp ecx, edx
jne 0x402f2a
cmp eax, esi
je 0x402f3b
mov eax, dword [ebx + 4]
lea edx, [ebp - 4]
push 0
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [ebp + 0x10]
xor eax, eax
mov dword [ebx + 0x44], eax
mov dword [ebx + 0x3c], eax
mov dword [ebx + 0x48], 1
mov dword [ebp - 4], eax
jmp 0x402f55
mov esi, dword [ebp + 0x10]
test esi, esi
jbe 0x402fb1
mov ecx, dword [ebx + 0x3c]
mov eax, dword [ebx + 0x40]
cmp ecx, eax
jne 0x402f6c
push ebx
call fcn.004031e0
mov dword [ebp - 4], eax
mov edx, dword [ebx + 0x3c]
mov eax, dword [ebx + 0x40]
sub eax, edx
cmp esi, eax
ja 0x402f7a
mov eax, esi
mov edi, dword [ebx + 0x38]
mov esi, dword [ebp + 0xc]
mov ecx, eax
add edi, edx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp + 0xc]
and ecx, 3
add edx, eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebx + 0x3c]
mov ecx, dword [ebp + 0x10]
add esi, eax
sub ecx, eax
mov eax, dword [ebp - 4]
mov dword [ebx + 0x3c], esi
test eax, eax
mov dword [ebp + 0xc], edx
mov dword [ebp + 0x10], ecx
je 0x402f52
mov eax, dword [ebx + 0x58]
push eax
call fcn.004074e0
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov al, byte [ebx + 8]
test al, al
jne 0x40308a
mov eax, dword [ebx + 0x34]
xor edi, edi
cmp eax, edi
mov dword [ebp - 8], edi
mov dword [ebp - 4], edi
je 0x403031
mov ecx, dword [ebx + 0x58]
push ecx
call fcn.00407470
push 2
push ebx
call fcn.00407740
mov esi, eax
cmp esi, edi
je 0x40300b
mov edx, dword [ebx + 0x58]
push edx
call fcn.004074e0
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
lea eax, [ebp - 8]
push eax
push 2
push ebx
call fcn.00406c90
mov esi, eax
cmp esi, edi
je 0x403031
mov ecx, dword [ebx + 0x58]
push ecx
call fcn.004074e0
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 0xc]
cmp eax, edi
je 0x403054
mov edx, dword [ebx + 0x50]
mov ecx, 0x20
mov dword [eax + 8], edx
mov eax, dword [ebx + 0x50]
mov edx, dword [ebx + 0x54]
call fcn.0040acc0
mov ecx, dword [ebx + 0xc]
mov dword [ecx + 0xc], eax
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebp + 0x10]
lea eax, [ebp + 8]
push edx
mov edx, dword [ecx]
mov ecx, dword [ebx + 4]
push eax
mov eax, dword [ebp + 0xc]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
mov eax, dword [ebx + 0x34]
cmp eax, edi
je 0x4030a8
push ebx
call fcn.00407820
mov edx, dword [ebx + 0x58]
push edx
call fcn.004074e0
jmp 0x4030a8
mov eax, dword [ebx + 0xc]
mov edx, dword [ebp + 0x10]
lea ecx, [ebp + 8]
push eax
mov eax, dword [edx]
mov edx, dword [ebx + 4]
push ecx
mov ecx, dword [ebp + 0xc]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
je 0x4030bb
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
xor esi, esi
mov dword [ecx], eax
jmp 0x4031a3
mov edx, dword [ebp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edx], 0
call esi
test eax, eax
jne 0x4030d7
xor esi, esi
jmp 0x4031a3
call esi
mov esi, eax
add esi, 0xafc80
cmp esi, 0xb0065
jne 0x40319f
mov eax, dword [ebx + 0x10]
mov ecx, dword [ebx + 0x14]
mov edx, eax
or edx, ecx
jne 0x4030fd
xor edi, edi
jmp 0x40311c
test ecx, ecx
jg 0x40310c
jl 0x403107
test eax, eax
jae 0x40310c
or edi, 0xffffffff
jmp 0x40311c
push 0
push 0x3e8
push ecx
push eax
call fcn.0040ab00
mov edi, eax
mov eax, dword [ebx + 0xc]
push edi
mov ecx, dword [eax + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, eax
cmp esi, 0xffffffff
je 0x40316e
test esi, esi
je 0x40314e
cmp esi, 0x102
jne 0x403188
neg edi
sbb edi, edi
and edi, 0x1116c
add edi, 0xb
mov esi, edi
jmp 0x403188
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebx + 4]
lea edx, [ebp + 8]
push 1
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
xor esi, esi
mov dword [eax], edx
jmp 0x4031a3
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jne 0x40317e
xor esi, esi
jmp 0x4031a3
call esi
mov esi, eax
add esi, 0xafc80
test esi, esi
je 0x4031a3
cmp dword [0x40de14], 0xe
jl 0x40319f
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CancelIo]
test esi, esi
jne 0x4031c7
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x4031c7
mov al, byte [ebx + 8]
test al, al
jne 0x4031c7
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebx + 0x50]
mov eax, dword [edx]
add ecx, eax
mov eax, dword [ebx + 0x54]
adc eax, 0
mov dword [ebx + 0x50], ecx
mov dword [ebx + 0x54], eax
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc