Function at 0x10021ff0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
mov eax, dword [0x10094084]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x38], ecx
mov eax, 0xffff
mov word [ebp - 0x42], ax
movzx ecx, word [ebp - 0x42]
movzx edx, word [ebp + 8]
cmp ecx, edx
jne 0x10022021
mov dword [ebp - 0x58], 1
jmp 0x10022028
mov dword [ebp - 0x58], 0
movzx eax, byte [ebp - 0x58]
test eax, eax
je 0x10022078
movzx ecx, word [ebp + 8]
mov edx, 0xffff
movzx eax, dx
cmp ecx, eax
je 0x1002204a
mov cx, word [ebp + 8]
mov word [ebp - 0x3c], cx
jmp 0x1002206f
mov edx, 0xffff
movzx eax, dx
test eax, eax
jne 0x10022061
mov ecx, 1
mov word [ebp - 0x3a], cx
jmp 0x10022067
xor edx, edx
mov word [ebp - 0x3a], dx
mov ax, word [ebp - 0x3a]
mov word [ebp - 0x3c], ax
mov ax, word [ebp - 0x3c]
jmp 0x10022262
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x20]
mov eax, dword [edx]
mov dword [ebp - 0x68], eax
cmp dword [ebp - 0x68], 0
je 0x100220cc
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x20]
mov eax, dword [edx]
mov dword [ebp - 0x6c], eax
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x30]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x20]
mov ecx, dword [edx]
lea edx, [ecx + eax*2]
cmp dword [ebp - 0x6c], edx
jae 0x100220cc
mov ax, word [ebp + 8]
mov word [ebp - 0x44], ax
mov ecx, dword [ebp - 0x38]
call fcn.1001b5a0
mov cx, word [ebp - 0x44]
mov word [eax], cx
mov ax, word [ebp + 8]
jmp 0x10022262
mov edx, dword [ebp - 0x38]
cmp dword [edx + 0x4c], 0
jne 0x100220df
mov eax, 0xffff
jmp 0x10022262
mov ecx, dword [ebp - 0x38]
call fcn.1001fdf0
mov eax, dword [ebp - 0x38]
cmp dword [eax + 0x38], 0
jne 0x10022150
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x4c]
mov dword [ebp - 0x70], edx
mov ax, word [ebp + 8]
mov word [ebp - 0x46], ax
mov ecx, dword [ebp - 0x70]
push ecx
movzx edx, word [ebp - 0x46]
push edx
call fcn.10042043
add esp, 8
movzx eax, ax
cmp eax, 0xffff
je 0x10022125
mov dword [ebp - 0x5c], 1
jmp 0x1002212c
mov dword [ebp - 0x5c], 0
movzx ecx, byte [ebp - 0x5c]
test ecx, ecx
je 0x1002213e
mov dx, word [ebp + 8]
mov word [ebp - 0x3e], dx
jmp 0x10022147
mov eax, 0xffff
mov word [ebp - 0x3e], ax
mov ax, word [ebp - 0x3e]
jmp 0x10022262
mov dword [ebp - 0x7c], 0x20
mov cx, word [ebp + 8]
mov word [ebp - 0x2c], cx
mov edx, dword [ebp - 0x38]
mov eax, dword [edx + 0x38]
mov dword [ebp - 0x60], eax
mov ecx, dword [ebp - 0x60]
mov edx, dword [ecx]
mov eax, dword [edx + 0x1c]
mov dword [ebp - 0x74], eax
lea ecx, [ebp - 0x30]
push ecx
lea edx, [ebp - 8]
push edx
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x34]
push ecx
lea edx, [ebp - 0x2a]
push edx
lea eax, [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x38]
add ecx, 0x40
push ecx
mov ecx, dword [ebp - 0x60]
call dword [ebp - 0x74]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
je 0x100221b2
cmp dword [ebp - 0x50], 1
je 0x100221b2
cmp dword [ebp - 0x50], 3
je 0x10022200
jmp 0x1002225d
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 0x28]
sub edx, eax
mov dword [ebp - 0x54], edx
je 0x100221e4
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x4c]
push edx
mov eax, dword [ebp - 0x54]
push eax
push 1
lea ecx, [ebp - 0x28]
push ecx
call fcn.10043043
add esp, 0x10
cmp dword [ebp - 0x54], eax
je 0x100221e4
mov eax, 0xffff
jmp 0x10022262
mov edx, dword [ebp - 0x38]
mov byte [edx + 0x3e], 1
lea eax, [ebp - 0x2c]
cmp dword [ebp - 0x34], eax
je 0x100221f9
mov ax, word [ebp + 8]
jmp 0x10022262
mov eax, 0xffff
jmp 0x10022262
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x4c]
mov dword [ebp - 0x78], edx
mov ax, word [ebp - 0x2c]
mov word [ebp - 0x4c], ax
mov ecx, dword [ebp - 0x78]
push ecx
movzx edx, word [ebp - 0x4c]
push edx
call fcn.10042043
add esp, 8
movzx eax, ax
cmp eax, 0xffff
je 0x10022235
mov dword [ebp - 0x64], 1
jmp 0x1002223c
mov dword [ebp - 0x64], 0
movzx ecx, byte [ebp - 0x64]
test ecx, ecx
je 0x1002224e
mov dx, word [ebp + 8]
mov word [ebp - 0x40], dx
jmp 0x10022257
mov eax, 0xffff
mov word [ebp - 0x40], ax
mov ax, word [ebp - 0x40]
jmp 0x10022262
mov eax, 0xffff
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100375db
mov esp, ebp
pop ebp
ret 4