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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x6001c8
mov eax, dword fs:[0]
push eax
sub esp, 0x38
push ebx
push esi
push edi
mov eax, dword [0x6687b8]
xor eax, esp
push eax
lea eax, [esp + 0x48]
mov dword fs:[0], eax
mov esi, ecx
mov edi, edx
cmp byte [edi + 0x35], 0
je 0x50f33c
push edi
call fcn.0050f8c0
lea ecx, [edi + 0x1c]
mov dword [esp + 0x2c], ecx
call fcn.004cb9a0
lea ecx, [edi + 4]
mov dword [esp + 0x28], ecx
call fcn.0045f230
push 0x6244e0
xor ebx, ebx
mov eax, edi
call fcn.004037a0
xor edx, edx
cmp esi, edx
mov byte [edi + 0x34], dl
mov byte [edi + 0x35], dl
jne 0x50f372
xor eax, eax
jmp 0x50f386
mov eax, esi
lea ebx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, dx
jne 0x50f377
sub eax, ebx
sar eax, 1
mov ebx, eax
push esi
mov eax, edi
call fcn.004037a0
xor ebx, ebx
xor edi, edi
mov dword [esp + 0x14], ebx
push edi
push 0x80
push 3
push edi
push 7
push SysReAllocStringLen
push esi
mov dword [esp + 0x6c], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x50f4d0
call fcn.0040f010
cmp eax, edi
jl 0x50f596
lea eax, [esp + 0x20]
push eax
xor esi, esi
push ebx
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
jne 0x50f3f1
call fcn.0040f010
cmp eax, esi
jl 0x50f3fb
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov edi, eax
mov dword [esp + 0x20], ecx
push edi
call fcn.005d1ef5
add esp, 4
mov dword [esp + 0x18], eax
cmp eax, esi
mov byte [esp + 0x50], 1
push esi
je 0x50f583
lea edx, [esp + 0x20]
push edx
push edi
push eax
push ebx
mov dword [esp + 0x30], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, esi
jne 0x50f431
call fcn.0040f010
cmp ebx, esi
je 0x50f442
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], esi
mov ebx, esi
mov eax, dword [0x677600]
mov edx, dword [eax + 0xc]
mov ecx, 0x677600
call edx
add eax, 0x10
mov dword [esp + 0x10], eax
cmp edi, esi
mov byte [esp + 0x50], 2
mov dword [esp + 0x30], 0xffffffff
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], esi
jbe 0x50f492
mov eax, dword [esp + 0x18]
mov dword [esp + 0x40], edi
lea edi, [esp + 0x30]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x34], eax
call fcn.0050e160
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x34]
call fcn.0050e200
test eax, eax
je 0x50f559
jmp 0x50f4b0
mov edi, dword [esp + 0x28]
mov ecx, dword [edi + 4]
mov edx, dword [esp + 0x10]
push esi
push ecx
push edx
mov ecx, edi
call fcn.0045f2d0
mov ecx, dword [edi + 4]
cmp ecx, esi
je 0x50f4db
mov dword [ecx], eax
jmp 0x50f4dd
mov dword [esp + 0x14], eax
mov ebx, eax
jmp 0x50f3c9
mov dword [edi], eax
lea ebx, [esp + 0x10]
mov dword [edi + 4], eax
mov dword [esp + 0x1c], eax
call fcn.00415310
mov edi, eax
call fcn.00415390
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 0xc]
cmp eax, 2
jle 0x50f53d
test eax, eax
jl 0x50f5a9
movzx edx, word [ecx]
cmp dx, 0x5b
jne 0x50f53d
test eax, eax
jle 0x50f53d
push 0x5d
push ecx
call fcn.005d33c4
add esp, 8
test eax, eax
je 0x50f53d
sub eax, dword [esp + 0x10]
sar eax, 1
cmp eax, 0xffffffff
je 0x50f53d
lea eax, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x30]
call fcn.005109b0
lea ecx, [esp + 0x10]
push ecx
lea eax, [esp + 0x34]
call fcn.0050e200
xor esi, esi
test eax, eax
jne 0x50f4b0
mov ebx, dword [esp + 0x14]
mov byte [esp + 0x50], 1
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x50f57e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x18]
push ecx
call fcn.005d2367
add esp, 4
cmp ebx, esi
je 0x50f596
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x48]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00403650
int3