Function at 0xf020540
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x424
mov eax, dword [ebp + 8]
cmp eax, dword [0xf2075fc]
jae 0xf020573
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
mov eax, dword [ecx*4 + 0xf207600]
movsx ecx, byte [eax + edx*8 + 4]
and ecx, 1
jne 0xf02058f
mov dword [0xf0b615c], 9
mov dword [0xf0b6160], 0
or eax, 0xffffffff
jmp 0xf020840
mov dword [ebp - 0x410], 0
mov edx, dword [ebp - 0x410]
mov dword [ebp - 0x420], edx
cmp dword [ebp + 0x10], 0
jne 0xf0205b2
xor eax, eax
jmp 0xf020840
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0xf207600]
movsx eax, byte [edx + ecx*8 + 4]
and eax, 0x20
je 0xf0205df
push 2
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.0f020850
add esp, 0xc
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0xf207600]
movsx edx, byte [ecx + eax*8 + 4]
and edx, 0x80
je 0xf02074e
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x40c], eax
mov dword [ebp - 0x414], 0
mov ecx, dword [ebp - 0x40c]
sub ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp + 0x10]
jae 0xf02074c
lea edx, [ebp - 0x408]
mov dword [ebp - 0x41c], edx
mov eax, dword [ebp - 0x41c]
lea ecx, [ebp - 0x408]
sub eax, ecx
cmp eax, 0x400
jge 0xf0206cd
mov edx, dword [ebp - 0x40c]
sub edx, dword [ebp + 0xc]
cmp edx, dword [ebp + 0x10]
jae 0xf0206cd
mov eax, dword [ebp - 0x40c]
mov cl, byte [eax]
mov byte [ebp - 0x421], cl
mov edx, dword [ebp - 0x40c]
add edx, 1
mov dword [ebp - 0x40c], edx
movsx eax, byte [ebp - 0x421]
cmp eax, 0xa
jne 0xf0206ab
mov ecx, dword [ebp - 0x420]
add ecx, 1
mov dword [ebp - 0x420], ecx
mov edx, dword [ebp - 0x41c]
mov byte [edx], 0xd
mov eax, dword [ebp - 0x41c]
add eax, 1
mov dword [ebp - 0x41c], eax
mov ecx, dword [ebp - 0x41c]
mov dl, byte [ebp - 0x421]
mov byte [ecx], dl
mov eax, dword [ebp - 0x41c]
add eax, 1
mov dword [ebp - 0x41c], eax
jmp 0xf020634
push 0
lea ecx, [ebp - 0x418]
push ecx
mov edx, dword [ebp - 0x41c]
lea eax, [ebp - 0x408]
sub edx, eax
push edx
lea ecx, [ebp - 0x408]
push ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0xf207600]
mov edx, dword [ecx + eax*8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0xf020739
mov eax, dword [ebp - 0x410]
add eax, dword [ebp - 0x418]
mov dword [ebp - 0x410], eax
mov ecx, dword [ebp - 0x41c]
lea edx, [ebp - 0x408]
sub ecx, edx
cmp dword [ebp - 0x418], ecx
jge 0xf020737
jmp 0xf02074c
jmp 0xf020747
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x414], eax
jmp 0xf02074c
jmp 0xf020616
jmp 0xf0207a4
push 0
lea eax, [ebp - 0x418]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0xf207600]
mov eax, dword [edx + ecx*8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0xf020798
mov dword [ebp - 0x414], 0
mov ecx, dword [ebp - 0x418]
mov dword [ebp - 0x410], ecx
jmp 0xf0207a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x414], eax
cmp dword [ebp - 0x410], 0
jne 0xf020834
cmp dword [ebp - 0x414], 0
je 0xf0207ef
cmp dword [ebp - 0x414], 5
jne 0xf0207db
mov dword [0xf0b615c], 9
mov edx, dword [ebp - 0x414]
mov dword [0xf0b6160], edx
jmp 0xf0207ea
mov eax, dword [ebp - 0x414]
push eax
call fcn.0f020cf0
add esp, 4
or eax, 0xffffffff
jmp 0xf020840
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
mov eax, dword [ecx*4 + 0xf207600]
movsx ecx, byte [eax + edx*8 + 4]
and ecx, 0x40
je 0xf02081b
mov edx, dword [ebp + 0xc]
movsx eax, byte [edx]
cmp eax, 0x1a
jne 0xf02081b
xor eax, eax
jmp 0xf020840
mov dword [0xf0b615c], 0x1c
mov dword [0xf0b6160], 0
or eax, 0xffffffff
jmp 0xf020840
mov eax, dword [ebp - 0x410]
sub eax, dword [ebp - 0x420]
mov esp, ebp
pop ebp
ret