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

Disassembly:
push edi
push esi
push ebp
push ebx
push ecx
mov eax, 0x104c
call fcn.007444c0
mov ecx, dword [esp + 0x104c]
mov edx, dword [esp + 0x1064]
mov esi, edx
mov edi, ecx
mov eax, dword [esp + 0x1068]
mov ebp, eax
jmp 0x5d85c0
sub ebp, edx
add esi, edx
mov ebx, dword [edi + 4]
test bl, 1
jne 0x5d8825
test bl, 4
je 0x5d864a
mov eax, ebp
test ebp, ebp
je 0x5d87b9
mov dword [esp + 0x1044], ebp
xor edx, edx
mov ebx, edx
mov dword [esp + 0x1048], 0xffffffff
lea edx, [esp + 0x1048]
cmp eax, 0xffffffff
lea ecx, [esi + ebx]
lea eax, [esp + 0x1044]
jb 0x5d8609
mov eax, edx
lea edx, [esp + 0x104c]
push 0
push edx
push dword [eax]
push ecx
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x104c]
test edx, edx
je 0x5d87cb
mov eax, dword [esp + 0x1044]
sub eax, edx
mov dword [esp + 0x1044], eax
add ebx, edx
test eax, eax
jne 0x5d85e6
mov edx, ebx
jmp 0x5d87a7
lea eax, [esp]
mov edx, esi
lea ecx, [esi + ebp]
mov ebx, 0x1000
cmp ebp, 0x1000
cmovle ebx, ebp
test ebx, ebx
jle 0x5d872f
mov dword [esp + 0x1034], ecx
mov dword [esp + 0x1020], ebp
mov ebp, eax
mov dword [esp + 0x101c], esi
mov esi, ebx
mov dword [esp + 0x1024], edi
mov ebx, edx
push esi
push 0xa
push ebx
call fcn.00744530
add esp, 0xc
mov edi, eax
test edi, edi
je 0x5d87da
sub edi, ebx
push edi
push ebx
push ebp
call fcn.007666b0
add esp, 0xc
mov byte [edi + ebp], 0xd
lea ecx, [esp]
lea ebx, [ebx + edi + 1]
lea ebp, [ebp + edi + 1]
mov edi, dword [esp + 0x1034]
mov byte [ebp], 0xa
inc ebp
sub edi, ebx
mov dword [esp + 0x1028], edi
mov dword [esp + 0x102c], 0
sub ecx, ebp
add ecx, 0x1000
mov dword [esp + 0x1030], ecx
lea esi, [esp + 0x102c]
lea eax, [esp + 0x1030]
test ecx, ecx
jg 0x5d86ff
mov eax, esi
cmp edi, dword [eax]
lea ecx, [esp + 0x1028]
jg 0x5d870c
mov eax, ecx
mov esi, dword [eax]
test esi, esi
jg 0x5d868a
mov esi, dword [esp + 0x101c]
mov edi, dword [esp + 0x1024]
mov edx, ebx
mov eax, ebp
mov ebp, dword [esp + 0x1020]
lea ecx, [esp]
sub eax, ecx
mov dword [esp + 0x1038], eax
je 0x5d87a5
mov dword [esp + 0x101c], esi
mov ebx, edx
mov esi, ecx
mov dword [esp + 0x103c], 0xffffffff
lea edx, [esp + 0x103c]
cmp eax, 0xffffffff
lea ecx, [esp + 0x1038]
lea eax, [esp + 0x1040]
push 0
jb 0x5d8771
mov ecx, edx
push eax
push dword [ecx]
push esi
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x1040]
test edx, edx
je 0x5d87cb
mov eax, dword [esp + 0x1038]
add esi, edx
sub eax, edx
mov dword [esp + 0x1038], eax
jne 0x5d8748
mov esi, dword [esp + 0x101c]
mov edx, ebx
sub edx, esi
cmp ebp, edx
je 0x5d87b9
test edx, edx
jle 0x5d87cb
cmp edx, ebp
jl 0x5d85bc
jmp 0x5d87cb
mov eax, 1
add esp, 0x1050
pop ebx
pop ebp
pop esi
pop edi
ret 8
xor eax, eax
add esp, 0x1050
pop ebx
pop ebp
pop esi
pop edi
ret 8
mov edi, dword [esp + 0x1024]
mov edx, ebx
mov ebx, esi
mov esi, dword [esp + 0x101c]
mov eax, ebp
mov ebp, dword [esp + 0x1020]
push ebx
push edx
push eax
mov dword [esp + 0x1020], eax
mov dword [esp + 0x1024], edx
call fcn.007666b0
mov edx, dword [esp + 0x1024]
mov eax, dword [esp + 0x1020]
add esp, 0xc
add eax, ebx
add edx, ebx
jmp 0x5d872f
lea ebx, [esp + 0x1008]
push ebx
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x1004], eax
cmp eax, 0xffffffff
jne 0x5d884b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x5d885f
mov ebx, dword [esp + 0x1008]
sub ebx, 0
jge 0x5d885f
mov ebx, dword [edi + 4]
jmp 0x5d85cc
lea ebx, [esp + 0x1010]
xor eax, eax
mov dword [esp + 0x100c], eax
mov dword [esp + 0x1010], eax
push 2
push ebx
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x100c], eax
cmp eax, 0xffffffff
je 0x5d8896
mov ebx, dword [edi + 4]
jmp 0x5d85cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [edi + 4]
jmp 0x5d85cc