Function at 0x1400407f0
Capabilities:
Get file size

Disassembly:
push rdi
sub rsp, 0x1b0
mov rax, qword [0x1400d1608]
xor rax, rsp
mov qword [rsp + 0x1a0], rax
mov r8d, edx
mov rdi, rcx
test rcx, rcx
je 0x140040862
mov r9d, dword [rcx]
mov r10, qword [rcx + 0x10]
cmp r9d, 3
jne 0x14004086c
movabs rax, 0x7fffffffffffffff
cmp r10, rax
jae 0x140040851
mov rdx, qword [rcx + 0x18]
cmp rdx, rax
jae 0x140040851
mov r11, qword [rcx + 0x20]
cmp r11, rax
jae 0x140040851
sub rax, rdx
cmp r10, rax
jae 0x140040851
cmp r11, rax
jb 0x14004088c
lea rdx, str.Delivery_target_exceeds_max_file_size
mov ecx, 1
call fcn.140042680
mov eax, 1
jmp 0x140040a9b
mov rdx, qword [rcx + 0x18]
mov rax, rdx
not rax
cmp r10, rax
ja 0x140040ac0
mov r11, qword [rcx + 0x20]
cmp r11, rax
ja 0x140040ac0
lea eax, [r9 - 1]
mov qword [rsp + 0x1c8], rbx
cmp eax, 6
ja case.default.0x1400408b4
lea rbx, [0x140000000]
cdqe
mov ecx, dword [rbx + rax*4 + 0x40ad8]
add rcx, rbx
jmp rcx
test rdx, rdx
je 0x1400408df
cmp qword [rdi + 8], 0
je 0x1400408df
test r10, r10
je 0x1400408d8
lea rdx, str.Ignoring_non_zero_offset
mov ecx, 1
call fcn.140042680
xor eax, eax
jmp 0x140040a93
test r8d, r8d
je 0x1400408f4
test rdx, rdx
jne 0x1400408f4
cmp qword [rdi + 8], rdx
jne 0x1400408f4
test r11, r11
je 0x1400408d8
lea rdx, str.Data_buffer_must_exist
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
test r8d, r8d
je 0x140040925
lea rdx, str.Cannot_allocate_buffer_for_send
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
test rdx, rdx
jne 0x140040940
lea rdx, str.Cannot_allocate_a_zero_sized_buffer
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
test r10, r10
je 0x1400408d8
lea rdx, str.Cannot_allocate_non_zero_offset
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
test r8d, r8d
jne case.0x1400408b4.3
lea rdx, str.Memory_map_not_supported_for_incoming_data
lea ecx, [r8 + 1]
call fcn.140042680
jmp 0x140040a8e
mov rcx, qword [rdi + 8]
test rcx, rcx
jne 0x140040994
lea rdx, str.Invalid_file_handle
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
xor r9d, r9d
test r8d, r8d
je 0x1400409eb
xor r8d, r8d
mov rdx, r10
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
xor ebx, ebx
test eax, eax
sete bl
test eax, eax
je 0x1400409fd
mov rcx, qword [rdi + 8]
lea rdx, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x1400409d5
mov rax, qword [rdi + 0x10]
add rax, qword [rdi + 0x18]
cmp qword [rsp + 0x20], rax
jae 0x1400409fd
lea rdx, str.File_smaller_than_offset__bound
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
xor ebx, ebx
xor r8d, r8d
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
sete bl
test ebx, ebx
je 0x1400408d8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, 0x100
lea rdx, [rsp + 0xa0]
mov ecx, eax
call fcn.140044d90
mov r8, rax
lea rdx, str.Cannot_seek_on_file_handle:__s
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
mov rcx, qword [rdi + 8]
lea rdx, [rsp + 0x28]
call fcn.14004bf40
test eax, eax
jns 0x1400408d8
mov r9d, 0x40
lea r8, [rsp + 0x60]
neg eax
mov edx, eax
lea ecx, [r9 - 0x44]
call fcn.1400446f0
mov r8, rax
lea rdx, str.Invalid_MTP_Stream:__s
mov ecx, 1
call fcn.140042680
jmp 0x140040a8e
mov r8d, r9d
lea rdx, str.Error_delivery_type__d_given_for_non_error_data
mov ecx, 1
call fcn.140042680
mov eax, 1
mov rbx, qword [rsp + 0x1c8]
mov rcx, qword [rsp + 0x1a0]
xor rcx, rsp
call fcn.14006f1f0
add rsp, 0x1b0
pop rdi
ret
mov r8d, r9d
lea rdx, str.Unknown_Delivery_Type__d
jmp 0x140040a84
lea rdx, str.Delivery_target_exceeds_max_document_size
mov ecx, 1
call fcn.140042680
mov eax, 1
jmp 0x140040a9b