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

Disassembly:
push rbp
push rbx
push r14
mov rbp, rsp
sub rsp, 0x50
xor r14d, r14d
lea r9, [rbp + 0x20]
mov rbx, rcx
mov dword [rbp + 0x20], r14d
mov rcx, qword [rcx + 0x70]
lea rdx, [rbp - 0x20]
mov qword [rsp + 0x20], r14
lea r8d, [r14 + 0x18]
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rbp - 0x20]
cmp eax, 0x64732e
je 0x14005112a
cmp eax, 0x2e736400
je 0x1400510fe
cmp eax, 0x2e736e64
je 0x14005112a
cmp eax, 0x646e732e
je 0x1400510fe
mov eax, 0x8004020c
add rsp, 0x50
pop r14
pop rbx
pop rbp
ret
mov eax, dword [rbp - 0x1c]
mov ecx, dword [rbp - 0x18]
bswap eax
mov dword [rbp - 0x1c], eax
mov eax, dword [rbp - 0x14]
bswap eax
mov dword [rbp - 0x14], eax
mov eax, dword [rbp - 0x10]
bswap eax
mov dword [rbp - 0x10], eax
mov eax, dword [rbp - 0xc]
bswap eax
bswap ecx
mov dword [rbp - 0xc], eax
mov al, 1
mov dword [rbp - 0x18], ecx
jmp 0x14005112f
mov ecx, dword [rbp - 0x18]
xor al, al
mov qword [rsp + 0x80], rdi
mov byte [rbx + 0x2c1], al
lea eax, [rcx - 1]
cmp eax, 0xfffffffd
ja 0x14005116c
mov rcx, qword [rbx + 0x70]
lea rdx, [rbp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov r8d, dword [rbp - 0x1c]
mov rdx, r14
test eax, eax
mov eax, dword [rbp - 0x18]
cmovne rdx, qword [rbp + 0x20]
add eax, r8d
cmp rax, rdx
jle 0x14005118e
mov rcx, qword [rbx + 0x70]
lea rdx, [rbp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov r8d, dword [rbp - 0x1c]
mov rcx, r14
test eax, eax
cmovne rcx, qword [rbp + 0x20]
sub ecx, r8d
mov dword [rbp - 0x18], ecx
lea edi, [r8 - 0x18]
test edi, edi
jle 0x1400511ed
movsxd rcx, edi
mov qword [rsp + 0x78], rsi
call fcn.1400b609c
mov rsi, rax
test rax, rax
je 0x1400511e4
mov rcx, qword [rbx + 0x70]
lea r9, [rbp + 0x20]
mov r8d, edi
mov dword [rbp + 0x20], r14d
mov rdx, rax
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
lea rcx, [rbx + 0x58]
mov r9d, edi
mov r8, rsi
mov edx, recv
call fcn.140025fb0
mov rcx, rsi
call fcn.1400b60a4
mov r8d, dword [rbp - 0x1c]
mov rsi, qword [rsp + 0x78]
mov ecx, dword [rbp - 0xc]
xor edx, edx
mov eax, dword [rbp - 0x18]
mov rdi, qword [rsp + 0x80]
div ecx
mov dword [rbx + 0x20], ecx
mov ecx, eax
mov eax, dword [rbp - 0x10]
mov dword [rbx + 0x28], eax
mov eax, r8d
mov qword [rbx + 0x290], rax
mov eax, dword [rbp - 0x14]
mov qword [rbx + 0x18], rcx
cmp eax, 0x37323632
ja case.0x140051250.8
je case.0x140051250.51
dec eax
cmp eax, 0x34
ja case.0x140051250.8
lea rdx, [0x140000000]
movzx eax, byte [rdx + rax + 0x513e0]
mov ecx, dword [rdx + rax*4 + 0x513a8]
add rcx, rdx
jmp rcx
lea r8, [0x14012f280]
mov r9d, 0xffffffff
lea rcx, [rbx + 0x58]
lea edx, [r9 + 3]
call fcn.140025fb0
mov rcx, rbx
call fcn.140023ca0
jmp 0x140051377
lea r8, [0x14012f1f8]
jmp 0x140051259
lea r8, [0x14012f1d8]
jmp 0x140051259
lea r8, [0x14012f1e8]
jmp 0x140051259
lea r8, [0x14012f260]
jmp 0x140051259
lea r8, [0x14012f270]
jmp 0x140051259
lea r8, [0x14012f1c8]
jmp 0x140051259
lea r8, [0x14012f288]
jmp 0x140051259
mov r9d, 0xffffffff
lea rcx, [rbx + 0x58]
lea r8, [0x140140980]
lea edx, [r9 + 3]
call fcn.140025fb0
mov dword [rbx + 0x2ac], 3
jmp 0x140051377
mov r9d, 0xffffffff
lea rcx, [rbx + 0x58]
lea r8, [0x140140998]
lea edx, [r9 + 3]
call fcn.140025fb0
mov dword [rbx + 0x2ac], 4
jmp 0x140051377
mov r9d, 0xffffffff
lea rcx, [rbx + 0x58]
lea r8, [0x1401409b0]
lea edx, [r9 + 3]
call fcn.140025fb0
mov dword [rbx + 0x2ac], 5
jmp 0x140051377
mov r9d, 0xffffffff
lea rcx, [rbx + 0x58]
lea r8, [0x1401409c8]
lea edx, [r9 + 3]
call fcn.140025fb0
mov dword [rbx + 0x2ac], 4
jmp 0x140051377
mov r9d, 0xffffffff
lea rcx, [rbx + 0x58]
lea r8, [0x140140968]
lea edx, [r9 + 3]
call fcn.140025fb0
mov dword [rbx + 0x2ac], 2
mov rax, qword [rbx + 0x18]
mov ecx, dword [rbx + 0x2ac]
shl rax, 3
cqo
idiv rcx
mov qword [rbx + 0x18], rax
xor eax, eax
add rsp, 0x50
pop r14
pop rbx
pop rbp
ret
mov eax, 0x8004020b
add rsp, 0x50
pop r14
pop rbx
pop rbp
ret