Function at 0x4050b1
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push 2
push 0xffffffffffffffea
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.MSVCRTD.dll__lseek]
add esp, 0xc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jge 0x4050da
or eax, 0xffffffff
jmp 0x4052c5
push 0x16
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.MSVCRTD.dll__read]
add esp, 0xc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jge 0x4050fe
or eax, 0xffffffff
jmp 0x4052c5
mov eax, dword [ebp + 0xc]
xor ecx, ecx
mov cl, byte [eax]
mov edx, dword [ebp + 0xc]
xor eax, eax
mov al, byte [edx + 1]
shl eax, 8
or ecx, eax
mov edx, dword [ebp + 0xc]
xor eax, eax
mov al, byte [edx + 2]
mov edx, dword [ebp + 0xc]
xor ebx, ebx
mov bl, byte [edx + 3]
shl ebx, 8
or eax, ebx
shl eax, 0x10
or ecx, eax
cmp ecx, 0x6054b50
jne 0x40513c
mov eax, dword [ebp - 0x1c]
jmp 0x4052c5
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.MSVCRTD.dll__lseek]
add esp, 0xc
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jge 0x40515e
or eax, 0xffffffff
jmp 0x4052c5
cmp dword [ebp - 0x14], 0x10015
jge 0x40516f
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x20], ecx
jmp 0x405176
mov dword [ebp - 0x20], 0x10015
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x10], edx
push 2
mov eax, dword [ebp - 0x10]
neg eax
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.MSVCRTD.dll__lseek]
add esp, 0xc
test eax, eax
jge 0x40519d
or eax, 0xffffffff
jmp 0x4052c5
push 0x10015
call dword [sym.imp.MSVCRTD.dll_malloc]
add esp, 4
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x4051bc
or eax, 0xffffffff
jmp 0x4052c5
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.MSVCRTD.dll__read]
add esp, 0xc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jge 0x4051ef
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.MSVCRTD.dll_free]
add esp, 4
or eax, 0xffffffff
jmp 0x4052c5
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x18]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
lea eax, [edx + ecx - 0x16]
mov dword [ebp - 4], eax
jmp 0x405210
mov ecx, dword [ebp - 4]
sub ecx, 1
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 4]
cmp edx, dword [ebp - 0xc]
jb 0x4052b5
mov eax, dword [ebp - 4]
xor ecx, ecx
mov cl, byte [eax]
cmp ecx, 0x50
jne 0x4052b0
mov edx, dword [ebp - 4]
xor eax, eax
mov al, byte [edx]
mov ecx, dword [ebp - 4]
xor edx, edx
mov dl, byte [ecx + 1]
shl edx, 8
or eax, edx
mov ecx, dword [ebp - 4]
xor edx, edx
mov dl, byte [ecx + 2]
mov ecx, dword [ebp - 4]
xor ebx, ebx
mov bl, byte [ecx + 3]
shl ebx, 8
or edx, ebx
shl edx, 0x10
or eax, edx
cmp eax, 0x6054b50
jne 0x4052b0
mov edx, dword [ebp - 4]
xor eax, eax
mov al, byte [edx + 0x14]
mov ecx, dword [ebp - 4]
xor edx, edx
mov dl, byte [ecx + 0x15]
shl edx, 8
or eax, edx
mov ecx, dword [ebp - 4]
lea edx, [ecx + eax + 0x16]
cmp edx, dword [ebp - 8]
jne 0x4052b0
push 0x16
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call sub.MSVCRTD.dll_memcpy
add esp, 0xc
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.MSVCRTD.dll_free]
add esp, 4
mov eax, dword [ebp - 8]
sub eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x14]
sub ecx, eax
mov eax, ecx
jmp 0x4052c5
jmp 0x405207
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.MSVCRTD.dll_free]
add esp, 4
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret