Function at 0x4584a0
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov eax, dword [0x4e90f8]
push ebx
push esi
push edi
push 1
push 0
push 0xffffffffffffffff
mov dword [esp + 0x24], ecx
mov ecx, eax
push 0
mov dword [esp + 0x24], eax
call fcn.0049e6b0
mov esi, dword [ebp + 8]
or eax, 0xffffffff
mov dword [esp + 0x20], eax
mov eax, dword [0x4e498c]
mov byte [esp + 0x12], 0
mov byte [esp + 0x24], 0
mov dword [esp + 0x28], 0xffffffff
mov ebx, dword [eax + 0xdc]
and ebx, 0x7fffffff
mov dword [esp + 0x2c], ebx
nop dword [eax]
mov edi, esi
mov al, byte [edi]
cmp al, 0x20
je 0x45850c
cmp al, 9
jne 0x45850f
inc edi
jmp 0x458502
cmp al, 0x2a
jne 0x45861b
movzx ebx, byte [edi + 1]
lea esi, [edi + 1]
test ebx, 0xffffff80
je 0x45852a
xor edx, edx
jmp 0x458537
push 2
push ebx
call fcn.004b47c1
add esp, 8
mov edx, eax
mov al, bl
and al, 0xdf
test edx, edx
movzx ecx, al
mov eax, ebx
cmove ecx, eax
movsx eax, cl
add eax, 0xffffffbd
cmp eax, 0x11
ja case.0x45855b.68
movzx eax, byte [eax + 0x458aa0]
jmp dword [eax*4 + 0x458a8c]
mov byte [esp + 0x24], 1
jmp case.0x45855b.68
lea ecx, [edi + 2]
call fcn.004488e0
mov bl, byte [esi]
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], edx
test bl, bl
je 0x4585a4
mov ecx, 0x4d5ff4
mov al, 0x20
nop dword [eax]
cmp bl, al
je 0x4585c4
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x458590
mov bl, byte [esi + 1]
inc esi
test bl, bl
jne 0x458582
mov eax, dword [0x4e498c]
mov ecx, dword [esp + 0x18]
push 1
mov dword [eax + 0x30], 0x57
call fcn.004469f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
dec esi
jmp case.0x45855b.68
lea eax, [edi + 2]
push eax
call fcn.004b2c14
mov dl, byte [esi]
add esp, 4
mov dword [esp + 0x2c], eax
test dl, dl
je 0x4585a4
nop dword [eax]
mov ecx, 0x4d5ff4
mov al, 0x20
cmp dl, al
je 0x4585c4
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x4585e7
mov dl, byte [esi + 1]
inc esi
test dl, dl
jne 0x4585e0
jmp 0x4585a4
mov byte [esp + 0x12], 1
cmp byte [esi], 0
je 0x458500
inc esi
cmp byte [esi], 0
je 0x458500
inc esi
jmp 0x458500
push 0
push 0x8000000
push 3
push 0
push 3
push connect
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x45865e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4e498c]
push 1
mov dword [ecx + 0x30], eax
mov ecx, dword [esp + 0x1c]
call fcn.004469f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea eax, [esp + 0x34]
xorps xmm0, xmm0
push eax
push ebx
movq qword [esp + 0x38], xmm0
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [esp + 0x30], esi
cmp esi, 0xffffffff
jne 0x45868e
call edi
test eax, eax
jne 0x45869b
mov esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov eax, esi
and eax, ecx
cmp eax, 0xffffffff
jne 0x4586f8
call edi
mov ecx, dword [0x4e498c]
push ebx
mov dword [ecx + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4e498c]
test byte [eax + 0xe0], 1
jne 0x4586da
mov ecx, dword [0x4e7934]
push 1
push 0
push 0xffffffffffffffff
push 0x4d07c0
call fcn.0049e6b0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esp + 0x18]
push 0x4d0335
push 0
push 0x4d07c0
call fcn.00446950
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov edx, dword [esp + 0x28]
cmp ecx, edx
jb 0x45870e
mov eax, dword [esp + 0x20]
ja 0x45870a
cmp esi, eax
jbe 0x45870e
mov esi, eax
mov ecx, edx
test ecx, ecx
jne 0x458a6c
cmp esi, 0xfffffffd
ja 0x458a6c
mov eax, esi
or eax, ecx
jne 0x45874c
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4e498c]
mov ecx, dword [esp + 0x18]
push 0
mov dword [eax + 0x30], 0
call fcn.004469f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp byte [esp + 0x24], 0
je 0x458823
mov edi, dword [esp + 0x14]
mov al, byte [edi + 0x17]
test al, al
jne 0x458768
mov eax, dword [edi + 0xc]
mov al, byte [eax + 0x17]
cmp al, 2
je 0x458823
push 0
push 1
lea eax, [esi + 1]
mov byte [esp + 0x1b], 1
push eax
push 0
mov ecx, edi
call fcn.0049e6b0
cmp eax, 1
jne 0x458852
push 0
push eax
mov ecx, edi
call fcn.00401680
mov edi, eax
test edi, edi
je 0x458852
push 0
lea eax, [esp + 0x20]
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4e498c]
push ebx
mov dword [ecx + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x458a16
cmp byte [esp + 0x24], 0
jne 0x4589b3
mov ecx, dword [esp + 0x1c]
cmp ecx, 3
jb 0x458864
cmp byte [edi], 0xef
jne 0x458864
cmp byte [edi + 1], 0xbb
jne 0x458864
cmp byte [edi + 2], 0xbf
jne 0x458864
mov esi, dword [esp + 0x14]
lea eax, [ecx - 3]
push 0xfde9
push eax
lea eax, [edi + 3]
mov ecx, esi
push eax
call fcn.0049f180
test eax, eax
jne 0x4588f7
xor ebx, ebx
jmp 0x4588fb
lea eax, [esi + 2]
mov byte [esp + 0x13], 0
push eax
call fcn.004b2c3e
mov edi, eax
add esp, 4
test edi, edi
jne 0x4587a3
mov ecx, dword [esp + 0x18]
push 0x4d0335
push eax
push str.Out_of_memory.
call fcn.00446d50
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp ecx, 2
jb 0x4588a4
cmp byte [edi], 0xff
jne 0x4588a4
cmp byte [edi + 1], 0xfe
jne 0x4588a4
mov dl, 1
sub esp, 0xc
lea eax, [ecx - 2]
test dl, dl
cmove eax, ecx
mov ecx, dword [esp + 0x20]
shr eax, 1
test dl, dl
push eax
lea eax, [edi + 2]
cmove eax, edi
push eax
call fcn.0049f250
neg eax
sbb eax, eax
and eax, esi
mov esi, dword [esp + 0x14]
mov ebx, eax
jmp 0x4588fb
mov ebx, dword [esp + 0x2c]
xor dl, dl
cmp ebx, 0x4b0
je 0x458876
test ebx, ebx
je 0x4588dd
call dword [sym.imp.KERNEL32.dll_GetACP]
cmp ebx, eax
je 0x4588d9
mov esi, dword [esp + 0x14]
mov ecx, esi
push ebx
push dword [esp + 0x20]
push edi
call fcn.0049f180
test eax, eax
jne 0x4588f7
xor ebx, ebx
jmp 0x4588fb
mov ecx, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov byte [ecx + edi], 0
mov ecx, esi
push dword [esp + 0x1c]
push edi
call fcn.0049ed20
mov ebx, dword [esp + 0x20]
jmp 0x458904
mov ebx, dword [esp + 0x20]
push edi
call fcn.004b2343
add esp, 4
push 0
push 1
mov ecx, esi
call fcn.00401680
cmp byte [esp + 0x12], 0
mov edi, eax
je 0x458a3c
mov eax, dword [esp + 0x14]
cmp byte [eax + 0x17], 0
jne 0x45892b
mov esi, dword [eax + 0xc]
jmp 0x45892d
mov esi, eax
cmp byte [esi + 0x17], 1
jne 0x458945
test byte [esi + 0x15], 8
je 0x458940
mov ecx, esi
call fcn.004015a0
lea eax, [esi + 0xc]
jmp 0x45894a
mov eax, 0x4eb4fc
mov eax, dword [eax]
mov edx, 0x4da4d4
mov dword [esp + 0x2c], eax
mov ecx, edi
lea eax, [esp + 0x2c]
push eax
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
push 1
push 0x4daa28
call fcn.0049acc0
mov eax, dword [esp + 0x2c]
add esp, 0x18
cmp byte [eax + 0x17], 0
jne 0x458980
mov esi, dword [eax + 0xc]
jmp 0x458982
mov esi, eax
cmp byte [esi + 0x17], 1
jne 0x4589a3
test byte [esi + 0x15], 8
je 0x458995
mov ecx, esi
call fcn.004015a0
mov eax, dword [esp + 0x2c]
add esi, 0xc
mov dword [esi], eax
jmp 0x458a3c
mov eax, dword [esp + 0x2c]
mov esi, 0x4eb4fc
mov dword [esi], eax
jmp 0x458a3c
mov ecx, dword [esp + 0x14]
mov al, byte [ecx + 0x17]
test al, al
jne 0x4589c4
mov eax, dword [ecx + 0xc]
mov al, byte [eax + 0x17]
cmp al, 2
jne 0x458a05
mov edx, dword [esp + 0x1c]
mov ecx, edi
call fcn.0049e4e0
push edi
mov esi, eax
call fcn.004b2343
add esp, 4
cmp esi, 1
jne 0x458859
mov ecx, dword [0x4e7934]
push esi
push 0
push 0xffffffffffffffff
push 0x4d03bc
call fcn.0049e6b0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov esi, dword [esp + 0x1c]
mov byte [esi + edi], 0
call fcn.00424a60
mov dword [eax], esi
jmp 0x458a38
mov ecx, dword [esp + 0x14]
mov byte [edi], 0
call fcn.00424a60
cmp byte [esp + 0x13], 0
mov dword [eax], 0
jne 0x458a38
push edi
call fcn.004b2343
add esp, 4
mov ebx, dword [esp + 0x20]
push dword [esp + 0x24]
mov ecx, dword [esp + 0x18]
call fcn.00427880
test eax, eax
je 0x458859
mov ecx, dword [esp + 0x18]
test ebx, ebx
sete al
movzx eax, al
push eax
call fcn.004469f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esp + 0x18]
push 0x4d0335
push 0
push str.Out_of_memory.
call fcn.00446d50
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4