Function at 0x504590
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x655718
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push esi
push edi
mov eax, dword [0x6f36d4]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0
call fcn.0057a360
add esp, 4
test al, al
jne 0x50480a
push 5
call fcn.0057a360
add esp, 4
test al, al
jne 0x50480a
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x5045f7
cmp dword [ebx + 0x14], 0x10
mov eax, ebx
mov dword [ebx + 0x10], 0
jb 0x5045f4
mov eax, dword [ebx]
mov byte [eax], 0
mov eax, dword [ebp + 8]
cmp dword [eax + 0x14], 0x10
jb 0x504602
mov eax, dword [eax]
push 0x67daa8
push eax
call fcn.0060474b
add esp, 8
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x50480a
push 0x10000
call fcn.0055d73c
mov esi, eax
mov dword [ebp - 0x30], esi
push dword [ebp - 0x1c]
xor edi, edi
mov dword [ebp - 4], 1
push 0x10000
push 1
push esi
mov dword [ebp - 0x24], edi
call fcn.006051e2
mov edx, eax
add esp, 0x14
mov dword [ebp - 0x18], edx
test edx, edx
je 0x5047ca
test ebx, ebx
je 0x504794
mov eax, dword [ebp + 0x10]
mov ecx, edx
sub eax, edi
mov edi, dword [ebx + 0x10]
cmp eax, edx
mov edx, dword [ebx + 0x14]
mov dword [ebp - 0x28], edx
cmovb ecx, eax
mov eax, edx
sub eax, edi
mov dword [ebp - 0x10], ecx
cmp ecx, eax
ja 0x5046a6
lea eax, [ecx + edi]
mov dword [ebx + 0x10], eax
mov eax, ebx
cmp edx, 0x10
jb 0x50468d
mov eax, dword [ebx]
push ecx
add edi, eax
push esi
push edi
call fcn.005d97f0
mov eax, dword [ebp - 0x10]
add esp, 0xc
mov byte [edi + eax], 0
jmp 0x504791
mov eax, SysReAllocString
sub eax, edi
cmp eax, ecx
jb 0x504823
lea eax, [ecx + edi]
mov ecx, eax
mov dword [ebp - 0x2c], eax
or ecx, 0xf
cmp ecx, 0x7fffffff
jbe 0x5046cf
mov ecx, SysReAllocString
jmp 0x5046f3
mov eax, edx
shr eax, 1
mov dword [ebp - 0x20], eax
mov eax, SysReAllocString
sub eax, dword [ebp - 0x20]
cmp edx, eax
jbe 0x5046e9
mov ecx, SysReAllocString
jmp 0x5046f3
mov eax, dword [ebp - 0x20]
add eax, edx
cmp ecx, eax
cmovb ecx, eax
lea eax, [ecx + 1]
mov dword [ebp - 0x20], ecx
push eax
mov ecx, ebx
call fcn.00483c30
cmp dword [ebp - 0x28], 0x10
mov edx, eax
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x14], edx
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], ecx
push edi
jb 0x50476e
mov eax, dword [ebx]
push eax
push edx
mov dword [ebp - 0x20], eax
call fcn.005d9270
mov eax, dword [ebp - 0x10]
add edi, dword [ebp - 0x14]
push eax
push esi
push edi
call fcn.005d9270
mov eax, dword [ebp - 0x10]
add esp, 0x18
mov ecx, dword [ebp - 0x28]
inc ecx
mov byte [edi + eax], 0
mov eax, dword [ebp - 0x20]
cmp ecx, 0x1000
jb 0x504762
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x50481e
mov eax, edx
push ecx
push eax
call fcn.0055d2a5
add esp, 8
jmp 0x50478c
push ebx
push edx
call fcn.005d9270
push dword [ebp - 0x10]
add edi, dword [ebp - 0x14]
push esi
push edi
call fcn.005d9270
mov eax, dword [ebp - 0x10]
add esp, 0x18
mov byte [edi + eax], 0
mov eax, dword [ebp - 0x14]
mov dword [ebx], eax
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x24]
sub eax, ecx
mov edi, dword [ebp - 0x1c]
cmp eax, edx
jb 0x5047de
push edi
push 0x10000
add ecx, edx
push 1
push esi
mov dword [ebp - 0x24], ecx
call fcn.006051e2
mov edx, eax
add esp, 0x10
mov dword [ebp - 0x18], edx
test edx, edx
je 0x5047cd
mov edi, dword [ebp - 0x24]
jmp 0x504656
mov edi, dword [ebp - 0x1c]
push edi
call fcn.00616e0e
add esp, 4
test eax, eax
jne 0x5047de
mov bl, 1
jmp 0x5047e0
xor bl, bl
push edi
call fcn.0060490a
add esp, 4
test esi, esi
je 0x5047f6
push esi
call fcn.0055d745
add esp, 4
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.005e3e64
call fcn.00483be0
int3