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

Disassembly:
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x68
mov r14, qword [0x140115db0]
xor r9d, r9d
mov rdi, rdx
mov qword [rsp + 0x58], r14
mov r13, rcx
mov byte [rsp + 0x20], 1
xor edx, edx
mov rcx, r14
lea r8, [r9 - 1]
call fcn.1400befb0
mov rax, qword [0x1401101f0]
xor sil, sil
xor r12b, r12b
mov byte [rsp + 0xb8], sil
mov rbp, 0xffffffffffffffff
mov r15d, dword [rax + 0x13c]
btr r15d, 0x1f
xor ecx, ecx
nop word [rax + rax]
mov rbx, rdi
movzx eax, word [rbx]
cmp ax, 0x20
je 0x14006cad2
cmp ax, 9
jne 0x14006cad8
add rbx, 2
jmp 0x14006cac3
cmp ax, 0x2a
jne 0x14006cc45
movzx esi, word [rbx + 2]
lea rdi, [rbx + 2]
test esi, 0xffffff80
jne 0x14006cb01
mov edx, 2
mov ecx, esi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
mov ecx, eax
mov eax, esi
and eax, 0xffffffdf
test ecx, ecx
cmove eax, esi
cmp eax, 0x43
je 0x14006cc15
cmp eax, 0x4d
je 0x14006cb98
cmp eax, 0x50
je 0x14006cb37
movzx esi, byte [rsp + 0xb8]
cmp eax, 0x54
jne 0x14006cc20
mov r12b, 1
jmp 0x14006cc20
lea rcx, [rbx + 4]
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__wtoi]
movzx edx, word [rdi]
mov r15d, eax
test dx, dx
je 0x14006cb83
nop dword [rax]
lea rcx, [0x1400f16e0]
mov eax, SafeArrayAllocDescriptor
nop dword [rax]
cmp dx, ax
je 0x14006cc07
movzx eax, word [rcx + 2]
add rcx, 2
test ax, ax
jne 0x14006cb60
movzx edx, word [rdi + 2]
add rdi, 2
test dx, dx
jne 0x14006cb50
mov rax, qword [0x1401101f0]
mov dl, 1
mov dword [rax + 0x40], 0x57
jmp 0x14006d2e2
lea rcx, [rbx + 4]
call fcn.1400056a0
test al, al
lea rcx, [rbx + 4]
mov eax, reloc.WSOCK32.dll_recv
mov r8d, 0xa
cmovne r8d, eax
xor edx, edx
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__wcstoui64]
movzx r8d, word [rdi]
mov rbp, rax
test r8w, r8w
je 0x14006cb83
mov eax, SafeArrayAllocDescriptor
lea rdx, [0x1400f16e0]
movzx ecx, ax
nop word [rax + rax]
cmp r8w, cx
je 0x14006cc07
movzx ecx, word [rdx + 2]
add rdx, 2
test cx, cx
jne 0x14006cbe0
movzx r8d, word [rdi + 2]
add rdi, 2
test r8w, r8w
jne 0x14006cbd0
jmp 0x14006cb83
movzx esi, byte [rsp + 0xb8]
add rdi, 0xfffffffffffffffe
jmp 0x14006cc20
mov sil, 1
mov byte [rsp + 0xb8], sil
cmp word [rdi], 0
mov ecx, 0
je 0x14006cac0
add rdi, 2
cmp word [rdi], cx
je 0x14006cac0
add rdi, 2
jmp 0x14006cac0
mov qword [rsp + 0x30], rcx
xor r9d, r9d
mov dword [rsp + 0x28], 0x8000000
mov edx, 0x80000000
mov rcx, rdi
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 3]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x14006cc8f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [0x1401101f0]
mov dl, 1
mov dword [rcx + 0x40], eax
jmp 0x14006d2e2
xor eax, eax
lea rdx, [rsp + 0xc4]
mov rcx, rbx
mov qword [rsp + 0xc0], rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, 0xffffffff
mov dword [rsp + 0xc0], eax
cmp eax, ecx
jne 0x14006ccc9
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x14006ccd7
mov ecx, 0xffffffff
mov rax, qword [rsp + 0xc0]
cmp rax, 0xffffffffffffffff
jne 0x14006cd3b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [0x1401101f0]
mov dword [rcx + 0x40], eax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [0x1401101f0]
lea rdx, [0x1400f11dc]
test byte [rax + 0x140], 1
jne 0x14006cd24
mov rcx, qword [0x140113a28]
xor r9d, r9d
mov byte [rsp + 0x20], 1
lea r8, [r9 - 1]
call fcn.1400befb0
jmp 0x14006d2ea
lea r9, [0x1400da7a4]
xor r8d, r8d
mov rcx, r13
call fcn.140056cc0
jmp 0x14006d2ea
cmp rax, rbp
cmovbe rbp, rax
cmp rbp, rcx
jbe 0x14006cd65
lea r9, [0x1400da7a4]
xor r8d, r8d
lea rdx, str.Out_of_memory.
mov rcx, r13
call fcn.1400571b0
jmp 0x14006d2ea
test rbp, rbp
jne 0x14006cd86
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [0x1401101f0]
xor ecx, ecx
xor edx, edx
mov dword [rax + 0x40], ecx
jmp 0x14006d2e2
test sil, sil
je 0x14006ce71
movzx eax, byte [r14 + 0x23]
test al, al
jne 0x14006cda0
mov rax, qword [r14 + 0x10]
movzx eax, byte [rax + 0x23]
cmp al, 2
je 0x14006ce71
mov rax, rbp
mov byte [rsp + 0x20], 0
and eax, 1
mov r8, rbp
shr r8, 1
mov sil, 1
add r8, rax
movzx r9d, sil
xor edx, edx
mov rcx, r14
call fcn.1400befb0
cmp eax, 1
jne 0x14006cea3
xor r8d, r8d
mov edx, eax
mov rcx, r14
call fcn.1400017c0
mov rdi, rax
test rax, rax
je 0x14006cea3
xor ecx, ecx
lea r9, [rsp + 0x40]
mov qword [rsp + 0x20], rcx
mov r8d, ebp
mov rcx, rbx
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov ebp, eax
mov dword [rsp + 0xc0], eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [0x1401101f0]
mov dword [rcx + 0x40], eax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test ebp, ebp
je 0x14006d26c
movzx ebx, byte [rsp + 0xb8]
test bl, bl
jne 0x14006d1f0
mov ecx, dword [rsp + 0x40]
cmp ecx, 3
jb 0x14006ceb3
cmp byte [rdi], 0xef
jne 0x14006ceb3
cmp byte [rdi + 1], 0xbb
jne 0x14006ceb3
cmp byte [rdi + 2], 0xbf
jne 0x14006ceb3
lea r8d, [rcx - 3]
mov r9d, 0xfde9
lea rdx, [rdi + 3]
jmp 0x14006cf4b
lea rcx, [rbp + 2]
xor sil, sil
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rdi, rax
test rax, rax
jne 0x14006cdef
lea r9, [0x1400da7a4]
xor r8d, r8d
lea rdx, str.Out_of_memory.
mov rcx, r13
call fcn.1400571b0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x14006d2ea
cmp ecx, 2
jb 0x14006cf36
cmp byte [rdi], 0xff
jne 0x14006cf36
cmp byte [rdi + 1], 0xfe
jne 0x14006cf36
mov r9b, 1
test r9b, r9b
mov byte [rsp + 0x20], 0
lea r8d, [rcx - 2]
cmove r8d, ecx
lea rdx, [rdi + 2]
shr r8, 1
mov rcx, r14
test r9b, r9b
mov r9b, 1
cmove rdx, rdi
call fcn.1400befb0
test eax, eax
mov esi, 0
cmove ebp, esi
mov dword [rsp + 0xc0], ebp
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor r8d, r8d
mov rcx, r14
lea edx, [r8 + 1]
call fcn.1400017c0
mov qword [rsp + 0x50], rax
mov r15, rax
test r12b, r12b
je 0x14006d292
cmp byte [r14 + 0x23], 0
jne 0x14006cf62
mov rbx, qword [r14 + 0x10]
jmp 0x14006cf65
xor r9d, r9d
cmp r15d, 0x4b0
je 0x14006cec6
mov r9d, r15d
mov r8d, ecx
mov rdx, rdi
mov rcx, r14
call fcn.1400bfce0
xor esi, esi
test eax, eax
jne 0x14006cf00
mov dword [rsp + 0xc0], esi
jmp 0x14006cf00
mov rbx, r14
cmp byte [rbx + 0x23], 1
jne 0x14006cf7f
test byte [rbx + 0x21], 8
je 0x14006cf79
mov rcx, rbx
call fcn.140001670
lea rdi, [rbx + 0x10]
jmp 0x14006cf86
lea rdi, [0x1401195c0]
mov rdi, qword [rdi]
mov r12d, 0xffffffff
shr rdi, 1
mov ebp, r12d
cmp word [r15], 0
mov r14, rsi
mov rbx, rsi
mov qword [rsp + 0x48], rsi
je 0x14006d191
cmp rdi, 0x1388
jb 0x14006d135
mov r12, r15
mov dword [rsp + 0xc8], esi
mov r15, rsi
nop word [rax + rax]
lea rdx, [0x1400fa5a8]
mov rcx, r12
call qword [sym.imp.VCRUNTIME140.dll_wcsstr]
mov r13, rax
test rax, rax
je 0x14006d0a1
mov edx, dword [rsp + 0xc8]
mov rbx, r13
sub rbx, r12
inc edx
sar rbx, 1
mov eax, 0xffffffff
add ebp, eax
mov dword [rsp + 0xc8], edx
lea r15, [rsi + rbx]
lea rcx, [r15 + 1]
cmp rcx, qword [rsp + 0x48]
jb 0x14006d065
movsxd rcx, ecx
mov rax, r13
sub rax, qword [rsp + 0x50]
mov r8d, ebp
sar rax, 1
cdqe
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
mov rcx, 0xffffffffffffffff
movsxd r9, edi
call fcn.1400bb050
mov rcx, r14
mov qword [rsp + 0x48], rax
lea rdx, [rax + rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
test rax, rax
je 0x14006d0e3
mov r14, rax
test rbx, rbx
je 0x14006d07c
lea r8, [rbx + rbx]
mov rdx, r12
lea rcx, [r14 + rsi*2]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x14006d07f
mov r15, rsi
movzx eax, word [reloc.WSOCK32.dll_inet_addr]
lea rbx, [r15 + 1]
mov word [r14 + r15*2], ax
mov r15, rbx
lea r12, [r13 + 4]
mov rsi, rbx
test ebp, ebp
jne 0x14006cfd0
cmp dword [rsp + 0xc8], 0
je 0x14006d191
mov rsi, qword [rsp + 0x50]
mov rax, r12
sub rax, rsi
sar rax, 1
sub rdi, rax
je 0x14006d110
lea rbx, [rdi + r15]
cmp rbx, qword [rsp + 0x48]
jb 0x14006d0fd
lea rdx, [rbx*2 + 2]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
test rax, rax
jne 0x14006d0fa
test r14, r14
je 0x14006d0f1
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor ecx, ecx
mov ebx, ecx
jmp 0x14006d194
mov r14, rax
lea r8, [rdi + rdi]
mov rdx, r12
lea rcx, [r14 + r15*2]
call sub.VCRUNTIME140.dll_memcpy
mov r15, rbx
xor ecx, ecx
lea r8, [r15*2 + 2]
mov word [r14 + r15*2], cx
mov rdx, r14
mov rcx, rsi
call sub.VCRUNTIME140.dll_memcpy
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x14006d194
mov rsi, r15
nop dword [rax + rax]
lea rdx, [0x1400fa5a8]
mov rcx, rsi
call qword [sym.imp.VCRUNTIME140.dll_wcsstr]
mov rbx, rax
test rax, rax
je 0x14006d191
mov rcx, rax
lea rsi, [rax + 2]
sub rcx, r15
lea rdx, [rax + 4]
sar rcx, 1
mov r8, rdi
sub r8, rcx
mov rcx, rsi
lea r8, [r8*2 - 2]
call sub.VCRUNTIME140.dll_memmove
movzx eax, word [reloc.WSOCK32.dll_inet_addr]
dec rdi
mov word [rbx], ax
add ebp, r12d
jne 0x14006d140
mov rbx, rdi
mov r14, qword [rsp + 0x58]
cmp byte [r14 + 0x23], 0
jne 0x14006d1a6
mov rdi, qword [r14 + 0x10]
jmp 0x14006d1a9
mov rdi, r14
cmp byte [rdi + 0x23], 1
jne 0x14006d1d5
test byte [rdi + 0x21], 8
je 0x14006d1bd
mov rcx, rdi
call fcn.140001670
mov r13, qword [rsp + 0xb0]
lea rax, [rbx + rbx]
add rdi, 0x10
mov qword [rdi], rax
jmp 0x14006d28a
mov r13, qword [rsp + 0xb0]
lea rdi, [0x1401195c0]
lea rax, [rbx + rbx]
mov qword [rdi], rax
jmp 0x14006d28a
movzx eax, byte [r14 + 0x23]
test al, al
jne 0x14006d201
mov rax, qword [r14 + 0x10]
movzx eax, byte [rax + 0x23]
cmp al, 2
jne 0x14006d248
mov edx, dword [rsp + 0x40]
mov rcx, rdi
call fcn.1400bed90
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
cmp ebx, 1
jne 0x14006d2be
mov rcx, qword [0x140113a28]
lea rdx, [0x1400da884]
xor r9d, r9d
mov byte [rsp + 0x20], bl
lea r8, [r9 - 1]
call fcn.1400befb0
jmp 0x14006d2ea
mov ecx, dword [rsp + 0x40]
test cl, 1
je 0x14006d257
mov byte [rcx + rdi], 0
inc ecx
xor eax, eax
mov ebx, ecx
mov word [rcx + rdi], ax
mov rcx, r14
call fcn.14002c570
mov qword [rax], rbx
jmp 0x14006d28a
xor ebx, ebx
mov rcx, r14
mov word [rdi], bx
call fcn.14002c570
mov qword [rax], rbx
test sil, sil
jne 0x14006d28a
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
movzx ebx, byte [rsp + 0xb8]
cmp byte [r14 + 0x23], 0
jne 0x14006d29d
mov r14, qword [r14 + 0x10]
cmp byte [r14 + 0x23], 2
jne 0x14006d2c2
cmp qword [0x140117c50], 0
je 0x14006d2c2
lea rcx, [0x140117c38]
call fcn.1400070e0
test eax, eax
jne 0x14006d2d7
xor eax, eax
jmp 0x14006d2ea
movzx eax, byte [r14 + 0x21]
and al, 0x86
mov byte [r14 + 0x21], al
test bl, bl
je 0x14006d2d7
or al, 1
mov byte [r14 + 0x21], al
cmp dword [rsp + 0xc0], 0
sete dl
mov rcx, r13
call fcn.140056d90
add rsp, 0x68
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret