Function at 0x1021f1a
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
cmp dword [ebp + 8], 0xffffffff
push ebx
push esi
push edi
je 0x1022114
cmp dword [ebp + 0xc], 0xffffffff
je 0x1022114
mov esi, dword [ebp + 0x10]
xor edi, edi
cmp esi, edi
je 0x1022114
mov ebx, dword [ebp + 0x14]
cmp ebx, edi
je 0x1022114
cmp dword [ebp + 0x20], edi
je 0x1022114
cmp dword [ebp + 0x18], edi
jle 0x1022114
mov eax, dword [ebp + 0x1c]
cmp eax, edi
jl 0x1022114
cmp eax, dword [0x102f768]
jg 0x1022114
mov eax, dword [ebx]
mov dword [ebp - 4], eax
lea eax, [ebp - 4]
push eax
call fcn.01020b45
mov esi, dword [esi + 8]
add esi, dword [ebp - 4]
push edi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
push dword [ebp + 8]
call edi
cmp eax, esi
jne 0x1022114
push 0
push 0
push esi
push dword [ebp + 0xc]
call edi
cmp eax, esi
jne 0x1022114
mov eax, dword [0x102f768]
shl eax, 2
cmp eax, dword [ebp + 0x18]
jge 0x1022114
mov eax, dword [ebp + 0x1c]
lea esi, [ebx + eax*4]
mov eax, dword [esi]
mov dword [ebp - 4], eax
lea eax, [ebp - 4]
push eax
call fcn.01020b45
mov eax, dword [esi + 4]
mov dword [ebp + 0x18], eax
lea eax, [ebp + 0x18]
push eax
call fcn.01020b45
mov ebx, dword [ebp - 4]
lea eax, [ebp - 4]
push eax
push dword [ebp + 0xc]
mov eax, ebx
push dword [ebp + 8]
call fcn.01021dd5
test eax, eax
jne 0x1022114
mov esi, dword [ebp + 0x24]
test esi, esi
jle 0x1022079
mov ecx, esi
and ecx, 0x80000003
jns 0x102201a
dec ecx
or ecx, 0xfffffffc
inc ecx
je 0x102204c
push 4
pop eax
sub eax, ecx
lea ecx, [eax + esi]
cmp ecx, 0xffff
mov dword [ebp + 0x24], ecx
jg 0x1022114
push eax
mov eax, dword [ebp + 0x20]
add eax, esi
push 0
push eax
call sub.msvcrt.dll_memset
mov eax, dword [ebp + 0x24]
add esp, 0xc
mov dword [ebp + 0x24], eax
mov esi, eax
push 0
lea eax, [ebp - 4]
push eax
push esi
push dword [ebp + 0x20]
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1022114
cmp dword [ebp - 4], esi
jne 0x1022114
push esi
push dword [ebp + 0x20]
call fcn.01020bbd
mov eax, dword [ebp + 0x10]
mov esi, dword [eax + 8]
add esi, dword [ebp + 0x18]
push 0
push 0
push esi
push dword [ebp + 8]
call edi
cmp eax, esi
jne 0x1022114
mov ecx, dword [ebp + 0x14]
mov eax, dword [0x102f768]
mov eax, dword [ecx + eax*4]
mov dword [ebp + 0x20], eax
lea eax, [ebp + 0x20]
push eax
call fcn.01020b45
lea eax, [ebp - 4]
push eax
push dword [ebp + 0xc]
mov eax, dword [ebp + 0x20]
sub eax, dword [ebp + 0x18]
push dword [ebp + 8]
call fcn.01021dd5
test eax, eax
jne 0x1022114
sub ebx, dword [ebp + 0x18]
mov esi, dword [ebp + 0x1c]
add ebx, dword [ebp + 0x24]
mov edi, dword [0x102f768]
jmp 0x1022100
mov eax, dword [ebp + 0x14]
lea eax, [eax + esi*4]
mov dword [ebp + 8], eax
mov eax, dword [eax]
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
call fcn.01020b45
add dword [ebp + 0xc], ebx
lea eax, [ebp + 0xc]
push eax
call fcn.01020b97
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
inc esi
cmp esi, edi
jle 0x10220d5
mov eax, dword [ebp + 0x20]
add ebx, eax
mov eax, dword [ebp + 0x10]
mov dword [eax + 0xc], ebx
xor eax, eax
jmp 0x1022117
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret 0x20