Function at 0x5205f0
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffec
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
mov byte [ebp - 0xd], cl
mov dword [ebp - 4], edx
mov esi, eax
mov eax, dword [ebp - 4]
call fcn.00406f78
xor eax, eax
push ebp
push 0x52082d
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
test eax, eax
je 0x52063c
mov edx, eax
sub edx, 0xa
cmp word [edx], 2
je 0x52063c
lea eax, [ebp - 4]
mov edx, dword [ebp - 4]
call fcn.00406368
test eax, eax
je 0x520645
sub eax, 4
mov eax, dword [eax]
dec eax
jge 0x52064f
mov bl, 1
jmp 0x52080a
xor ebx, ebx
push 0
push 0x80
push 4
push 0
push 3
push 0xc0000000
mov eax, esi
call fcn.0040701c
push eax
call sub.kernel32.dll_CreateFileW
mov edi, eax
cmp edi, 0xffffffff
je 0x52080a
mov eax, edi
call fcn.0051ffd0
mov esi, eax
push 2
push 0
push 0
push edi
call sub.kernel32.dll_SetFilePointer
push 0
push edi
call sub.kernel32.dll_GetFileSize
test eax, eax
jne 0x52074e
cmp byte [ebp - 0xd], 0
je 0x5206fa
lea eax, [ebp - 0xc]
mov edx, 0x52084c
call fcn.0040622c
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x5206d2
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x5206d2
lea eax, [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0xc]
call fcn.00406398
mov esi, eax
test esi, esi
je 0x5206dd
sub esi, 4
mov esi, dword [esi]
push 0
lea eax, [ebp - 0x14]
push eax
push esi
mov eax, dword [ebp - 0xc]
call fcn.004068ec
push eax
push edi
call sub.kernel32.dll_WriteFile_1
mov esi, 3
jmp 0x52074e
lea eax, [ebp - 8]
mov edx, 0x52085c
call fcn.00406fe4
mov eax, dword [ebp - 8]
test eax, eax
je 0x520724
mov edx, eax
sub edx, 0xa
cmp word [edx], 2
je 0x520724
lea eax, [ebp - 8]
mov edx, dword [ebp - 8]
call fcn.00406368
mov esi, eax
test esi, esi
je 0x52072f
sub esi, 4
mov esi, dword [esi]
push 0
lea eax, [ebp - 0x14]
push eax
mov eax, esi
add eax, eax
push eax
mov eax, dword [ebp - 8]
call fcn.0040701c
push eax
push edi
call sub.kernel32.dll_WriteFile_1
mov esi, 1
cmp esi, 1
je 0x520758
cmp esi, 2
jne 0x5207b9
lea eax, [ebp - 8]
mov edx, dword [ebp - 4]
call fcn.00406fe4
cmp esi, 2
jne 0x520775
mov eax, dword [ebp - 8]
call fcn.0040701c
call fcn.0051df64
mov eax, dword [ebp - 8]
test eax, eax
je 0x520792
mov edx, eax
sub edx, 0xa
cmp word [edx], 2
je 0x520792
lea eax, [ebp - 8]
mov edx, dword [ebp - 8]
call fcn.00406368
mov esi, eax
test esi, esi
je 0x52079d
sub esi, 4
mov esi, dword [esi]
push 0
lea eax, [ebp - 0x14]
push eax
mov eax, esi
add eax, eax
push eax
mov eax, dword [ebp - 8]
call fcn.0040701c
push eax
push edi
call sub.kernel32.dll_WriteFile_1
jmp 0x520804
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.0040a12c
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x5207e3
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x5207e3
lea eax, [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0xc]
call fcn.00406398
mov esi, eax
test esi, esi
je 0x5207ee
sub esi, 4
mov esi, dword [esi]
push 0
lea eax, [ebp - 0x14]
push eax
push esi
mov eax, dword [ebp - 0xc]
call fcn.004068ec
push eax
push edi
call sub.kernel32.dll_WriteFile_1
push edi
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x520834
lea eax, [ebp - 0xc]
call fcn.0040617c
lea eax, [ebp - 8]
mov edx, 2
call fcn.00406f88
ret