Function at 0x101039f1
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10155c41
mov eax, dword fs:[0]
push eax
sub esp, 0x6c
push ebx
push esi
push edi
mov eax, dword [0x101fe1c0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
call fcn.10103614
push dword [ebp + 0x1c]
mov esi, eax
mov dword [ebp - 0x14], edx
lea ecx, [ebp - 0x78]
mov dword [ebp - 0x18], esi
mov byte [ebp - 0xd], 0
call fcn.1010978a
mov ebx, dword [ebp + 0x14]
mov ecx, 0x10000
and dword [ebp - 0x4c], 0
mov eax, ebx
cmp ebx, ecx
mov dword [ebp - 0x78], 0x101b1888
push 0
cmovae eax, ecx
mov dword [ebp - 0x50], 1
and dword [ebp - 0x48], 0
lea ecx, [ebp - 0x78]
mov dword [ebp + 0x14], eax
mov eax, dword [ebp + 0x18]
push ebx
mov dword [ebp - 0x58], eax
call fcn.10103fc4
mov ecx, dword [ebp + 8]
mov eax, ebx
mov edx, dword [ebp + 0xc]
add eax, ecx
mov dword [ebp - 0x20], eax
push 0
pop eax
adc eax, edx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x1c], eax
add esi, 0x10000
mov eax, dword [ebp - 0x14]
adc eax, 0
mov dword [ebp - 0x2c], edx
cmp dword [ebp - 0x1c], eax
jb 0x10103ad0
ja 0x10103aa3
cmp dword [ebp - 0x20], esi
jbe 0x10103ad0
lea ecx, [ebp - 0x78]
call fcn.10109829
mov esi, eax
test esi, esi
js 0x10103bc3
push dword [ebp + 0x1c]
mov eax, dword [edi]
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push edi
call dword [eax + 0x18]
mov ecx, dword [ebp + 8]
test eax, eax
mov edx, dword [ebp + 0xc]
setns byte [ebp - 0xd]
and dword [ebp - 0x30], 0
mov dword [ebp - 0x38], ecx
lea ecx, [ebp - 0x78]
mov dword [ebp - 0x34], edx
call fcn.10109829
mov esi, eax
test esi, esi
js 0x10103bab
mov esi, dword [ebp + 0x14]
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x24]
push eax
push esi
push dword [ebp + 0x10]
push dword [edi + 0x14]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [edi + 0x1c], 0
je 0x10103b34
test eax, eax
jne 0x10103b54
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x10103b38
push 1
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x40]
push eax
push dword [edi + 0x14]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
neg eax
sbb eax, eax
neg eax
test eax, eax
jne 0x10103b54
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x10103b4f
movzx esi, si
or esi, 0x80070000
test esi, esi
jne 0x10103bab
mov esi, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp - 0x24]
sub ebx, eax
add dword [ebp + 0x10], eax
mov edx, dword [ebp - 0x2c]
add dword [ecx], eax
mov ecx, dword [ebp - 0x28]
add ecx, eax
mov dword [ebp - 0x28], ecx
adc edx, 0
mov dword [ebp - 0x2c], edx
cmp dword [ebp - 0x14], edx
ja 0x10103b84
jb 0x10103b7e
cmp dword [ebp - 0x18], ecx
ja 0x10103b84
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], edx
cmp esi, eax
jne 0x10103ba6
xor esi, esi
test ebx, ebx
je 0x10103ba2
mov esi, 0x10000
cmp ebx, esi
mov eax, esi
cmovb eax, ebx
mov dword [ebp + 0x14], eax
jmp 0x10103ad0
xor al, al
jmp 0x10103bae
mov esi, 0x80004005
mov al, byte [ebp - 0xd]
test al, al
je 0x10103bc3
mov ecx, dword [ebp - 0x18]
mov eax, dword [edi]
push 0
push dword [ebp - 0x14]
push ecx
push edi
call dword [eax + 0x18]
jmp 0x10103bcf
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x14]
mov dword [edi + 0x58], ecx
mov dword [edi + 0x5c], eax
mov ecx, dword [ebp - 0x74]
mov dword [ebp - 0x78], 0x101b15a0
test ecx, ecx
je 0x10103be7
and dword [ebp - 0x74], 0
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret 0x18