Function at 0x1021b480
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x42c
mov eax, dword [0x1027c570]
mov dword [ebp - 4], eax
mov dword [ebp - 0x418], 0
mov eax, dword [ebp - 0x418]
mov dword [ebp - 0x428], eax
cmp dword [ebp + 0x10], 0
jne 0x1021b4b4
xor eax, eax
jmp 0x1021b757
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
imul edx, edx, 0x24
mov eax, dword [ecx*4 + sym.MSVCR71D.dll___pioinfo]
movsx ecx, byte [eax + edx + 4]
and ecx, 0x20
je 0x1021b4e6
push 2
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.1021c340
add esp, 0x10
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
imul ecx, ecx, 0x24
mov edx, dword [eax*4 + sym.MSVCR71D.dll___pioinfo]
movsx eax, byte [edx + ecx + 4]
and eax, 0x80
je 0x1021b65b
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x414], ecx
mov dword [ebp - 0x41c], 0
mov edx, dword [ebp - 0x414]
sub edx, dword [ebp + 0xc]
cmp edx, dword [ebp + 0x10]
jae 0x1021b659
lea eax, [ebp - 0x410]
mov dword [ebp - 0x424], eax
mov ecx, dword [ebp - 0x424]
lea edx, [ebp - 0x410]
sub ecx, edx
cmp ecx, 0x400
jge 0x1021b5d7
mov eax, dword [ebp - 0x414]
sub eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x10]
jae 0x1021b5d7
mov ecx, dword [ebp - 0x414]
mov dl, byte [ecx]
mov byte [ebp - 0x429], dl
mov eax, dword [ebp - 0x414]
add eax, 1
mov dword [ebp - 0x414], eax
movsx ecx, byte [ebp - 0x429]
cmp ecx, 0xa
jne 0x1021b5b5
mov edx, dword [ebp - 0x428]
add edx, 1
mov dword [ebp - 0x428], edx
mov eax, dword [ebp - 0x424]
mov byte [eax], 0xd
mov ecx, dword [ebp - 0x424]
add ecx, 1
mov dword [ebp - 0x424], ecx
mov edx, dword [ebp - 0x424]
mov al, byte [ebp - 0x429]
mov byte [edx], al
mov ecx, dword [ebp - 0x424]
add ecx, 1
mov dword [ebp - 0x424], ecx
jmp 0x1021b53d
push 0
lea edx, [ebp - 0x420]
push edx
mov eax, dword [ebp - 0x424]
lea ecx, [ebp - 0x410]
sub eax, ecx
push eax
lea edx, [ebp - 0x410]
push edx
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
imul ecx, ecx, 0x24
mov edx, dword [eax*4 + sym.MSVCR71D.dll___pioinfo]
mov eax, dword [edx + ecx]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1021b646
mov ecx, dword [ebp - 0x418]
add ecx, dword [ebp - 0x420]
mov dword [ebp - 0x418], ecx
mov edx, dword [ebp - 0x424]
lea eax, [ebp - 0x410]
sub edx, eax
cmp dword [ebp - 0x420], edx
jge 0x1021b644
jmp 0x1021b659
jmp 0x1021b654
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x41c], eax
jmp 0x1021b659
jmp 0x1021b51f
jmp 0x1021b6b4
push 0
lea ecx, [ebp - 0x420]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
imul edx, edx, 0x24
mov eax, dword [ecx*4 + sym.MSVCR71D.dll___pioinfo]
mov ecx, dword [eax + edx]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1021b6a8
mov dword [ebp - 0x41c], 0
mov edx, dword [ebp - 0x420]
mov dword [ebp - 0x418], edx
jmp 0x1021b6b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x41c], eax
cmp dword [ebp - 0x418], 0
jne 0x1021b74b
cmp dword [ebp - 0x41c], 0
je 0x1021b701
cmp dword [ebp - 0x41c], 5
jne 0x1021b6ed
call sym.MSVCR71D.dll__errno
mov dword [eax], 9
call sym.MSVCR71D.dll___doserrno
mov ecx, dword [ebp - 0x41c]
mov dword [eax], ecx
jmp 0x1021b6fc
mov edx, dword [ebp - 0x41c]
push edx
call fcn.102048f0
add esp, 4
or eax, 0xffffffff
jmp 0x1021b757
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
imul ecx, ecx, 0x24
mov edx, dword [eax*4 + sym.MSVCR71D.dll___pioinfo]
movsx eax, byte [edx + ecx + 4]
and eax, 0x40
je 0x1021b730
mov ecx, dword [ebp + 0xc]
movsx edx, byte [ecx]
cmp edx, 0x1a
jne 0x1021b730
xor eax, eax
jmp 0x1021b757
call sym.MSVCR71D.dll__errno
mov dword [eax], 0x1c
call sym.MSVCR71D.dll___doserrno
mov dword [eax], 0
or eax, 0xffffffff
jmp 0x1021b757
mov eax, dword [ebp - 0x418]
sub eax, dword [ebp - 0x428]
mov ecx, dword [ebp - 4]
call fcn.1020cd80
mov esp, ebp
pop ebp
ret