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

Disassembly:
mov eax, 0x1030
call fcn.00615620
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov dword [esp + 0x18], edi
test byte [edi + 8], 1
je 0x5d82a7
mov eax, dword [edi]
lea ecx, [esp + 0x28]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [esp + 0x24], eax
jne 0x5d826f
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x5d827d
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
test ecx, ecx
jl 0x5d82a7
jg 0x5d827d
test eax, eax
jb 0x5d82a7
push 2
xor eax, eax
lea edx, [esp + 0x38]
push edx
push eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov eax, dword [edi]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x30], eax
jne 0x5d82a7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test byte [edi + 8], 4
je 0x5d8318
mov ebp, dword [esp + 0x1048]
mov esi, ebp
xor ebx, ebx
test ebp, ebp
mov dword [esp + 0x10], esi
je 0x5d8480
mov dword [esp + 0x14], 0xffffffff
lea esp, [esp]
cmp esi, 0xffffffff
lea eax, [esp + 0x10]
jb 0x5d82dd
lea eax, [esp + 0x14]
mov edx, dword [eax]
mov eax, dword [esp + 0x1044]
push 0
lea ecx, [esp + 0x30]
push ecx
push edx
mov edx, dword [edi]
lea ecx, [ebx + eax]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x5d848f
sub esi, eax
add ebx, eax
test esi, esi
mov dword [esp + 0x10], esi
jne 0x5d82d0
jmp 0x5d8456
mov eax, dword [esp + 0x1048]
mov ebx, dword [esp + 0x1044]
lea ecx, [ebx + eax]
cmp eax, 0x1000
lea ebp, [esp + 0x3c]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x14], 0x1000
lea eax, [esp + 0x14]
jg 0x5d834b
lea eax, [esp + 0x1048]
mov esi, dword [eax]
test esi, esi
mov dword [esp + 0x10], esi
jle 0x5d83fd
jmp 0x5d8360
mov esi, dword [esp + 0x10]
nop
push esi
push 0xa
push ebx
call fcn.006131f0
add esp, 0xc
test eax, eax
je 0x5d83d9
sub eax, ebx
mov ecx, eax
mov edx, ecx
shr ecx, 2
mov edi, ebp
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
add ebp, eax
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
mov byte [ebp], 0xd
inc ebp
lea ebx, [ebx + eax + 1]
mov byte [ebp], 0xa
inc ebp
lea eax, [esp + 0x103c]
sub eax, ebp
sub ecx, ebx
mov dword [esp + 0x14], eax
test eax, eax
mov dword [esp + 0x10], 0
mov dword [esp + 0x1c], ecx
lea eax, [esp + 0x14]
jg 0x5d83c1
lea eax, [esp + 0x10]
cmp dword [eax], ecx
jl 0x5d83c9
lea eax, [esp + 0x1c]
mov eax, dword [eax]
test eax, eax
mov edi, dword [esp + 0x18]
mov dword [esp + 0x10], eax
jg 0x5d835b
jmp 0x5d83fd
test esi, esi
jle 0x5d83fd
mov ecx, esi
mov eax, ecx
shr ecx, 2
mov esi, ebx
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x10]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
add ebp, eax
add ebx, eax
lea esi, [esp + 0x3c]
mov ecx, esi
sub ebp, ecx
mov dword [esp + 0x10], ebp
je 0x5d8446
mov dword [esp + 0x1c], 0xffffffff
cmp ebp, 0xffffffff
lea eax, [esp + 0x10]
jb 0x5d8420
lea eax, [esp + 0x1c]
mov eax, dword [eax]
mov ecx, dword [edi]
push 0
lea edx, [esp + 0x3c]
push edx
push eax
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x38]
test eax, eax
je 0x5d848f
add esi, eax
sub ebp, eax
mov dword [esp + 0x10], ebp
jne 0x5d8413
mov eax, dword [esp + 0x1044]
mov ebp, dword [esp + 0x1048]
sub ebx, eax
cmp ebp, ebx
je 0x5d8480
test ebx, ebx
jle 0x5d848f
cmp ebx, ebp
jge 0x5d848f
mov eax, dword [esp + 0x1044]
sub ebp, ebx
add eax, ebx
mov dword [esp + 0x1048], ebp
mov dword [esp + 0x1044], eax
jmp 0x5d8244
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x1030
ret 8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x1030
ret 8