Function at 0x10042010
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x1007ff50]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
mov dword [ebp - 0xc], edi
jne 0x1004204a
mov esi, 6
call fcn.1004b610
mov ecx, dword [ebp + 0x18]
mov dword [ecx + 4], eax
or eax, 0xffffffff
mov dword [ecx], esi
or edx, eax
jmp 0x100422cd
cmp dword [0x1008034c], 0
jne 0x1004205d
call fcn.100380f0
mov dword [0x1008034c], eax
xor ebx, ebx
test byte [edi + 0x24], 4
jne 0x100420f4
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push ebx
lea edx, [ebp - 0x18]
push edx
push ecx
push eax
mov dword [ebp - 0x18], eax
mov eax, dword [edi + 4]
push eax
mov dword [ebp - 0x14], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x100420a9
call fcn.1004b610
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
or eax, 0xffffffff
mov dword [ecx + 4], esi
or edx, eax
jmp 0x100422cd
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
lea eax, [esi + ecx*8]
cmp esi, eax
mov dword [ebp - 0xc], eax
jae 0x100420ed
lea esp, [esp]
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push 0
lea edx, [ebp - 8]
push edx
mov edx, dword [edi + 4]
push eax
push ecx
push edx
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1004208a
add ebx, dword [ebp - 8]
add esi, 8
cmp esi, dword [ebp - 0xc]
jb 0x100420c0
mov eax, ebx
jmp 0x100422cb
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp + 0x10]
push eax
push edi
call fcn.10021ec0
mov ecx, dword [0x1008034c]
mov ebx, eax
lea eax, [ecx + ebx - 1]
cdq
idiv ecx
add esp, 8
mov dword [ebp - 0x10], eax
lea eax, [eax*8 + 8]
call fcn.1004a7f0
mov ecx, dword [ebp + 0x14]
lea eax, [edi + ecx*8]
cmp edi, eax
mov esi, esp
mov dword [ebp - 0x14], esi
mov dword [ebp - 8], eax
jae 0x10042162
xor ecx, ecx
cmp dword [edi + 4], ecx
jle 0x1004215b
jmp 0x10042140
mov eax, dword [edi]
add eax, ecx
cdq
mov dword [esi], eax
mov dword [esi + 4], edx
add ecx, dword [0x1008034c]
add esi, 8
cmp ecx, dword [edi + 4]
jl 0x10042140
mov eax, dword [ebp - 8]
add edi, 8
cmp edi, eax
jb 0x10042134
xor ecx, ecx
xor eax, eax
mov dword [esi], ecx
mov dword [esi + 4], ecx
push ecx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0xc]
push ecx
mov edx, eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
push 1
push ecx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], ecx
sar edx, 0x1f
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x1004208a
mov ecx, dword [0x1008034c]
lea edx, [ecx - 1]
xor esi, esi
xor edi, edi
test ebx, edx
mov dword [ebp - 8], ebx
je 0x100421ce
mov eax, ebx
cdq
mov esi, eax
add esi, dword [ebp + 8]
mov edi, edx
adc edi, dword [ebp + 0xc]
imul ecx, dword [ebp - 0x10]
mov ebx, ecx
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0xc]
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [edx + 4]
push 0
push ebx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFileGather]
test eax, eax
jne 0x100422a6
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x3e5
mov dword [ebp - 0x14], eax
je 0x1004222b
cmp eax, 0x22a
je 0x1004222b
call fcn.1004b610
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x14]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x1c]
push eax
mov dword [ecx], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x100422cd
mov ecx, dword [ebp - 0x1c]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x1004225e
call fcn.1004b610
mov esi, eax
call ebx
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x1c]
push edx
mov dword [ecx], eax
mov dword [ecx + 4], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x100422cd
mov edx, dword [ebp - 0xc]
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [edx + 4]
lea ecx, [ebp - 0x2c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x1004229b
call ebx
mov esi, eax
call fcn.1004b610
mov ecx, dword [ebp + 0x18]
mov dword [ecx], esi
mov dword [ecx + 4], eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x100422cd
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 8]
jae 0x100422a6
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
jl 0x100422c8
jg 0x100422ba
test esi, esi
jbe 0x100422c8
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp - 0xc]
push eax
push edi
push esi
call fcn.10041cd0
mov eax, dword [ebp - 8]
xor edx, edx
lea esp, [ebp - 0x38]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1004a1cc
mov esp, ebp
pop ebp
ret 0x14