Function at 0x140008070
Capabilities:
Get file size

Disassembly:
push rbx
push rsi
push rdi
push r15
sub rsp, 0x88
mov rax, qword [0x14012a5e8]
xor rax, rsp
mov qword [rsp + 0x78], rax
mov ebx, dword [rcx + 0x168]
xor r15d, r15d
mov rdi, rcx
bt ebx, 0x1d
jae 0x1400080c0
mov eax, ebx
mov dword [rsp + 0x40], ebx
and al, 3
mov qword [rsp + 0x58], r15
cmp al, 1
jne 0x1400080b5
and ebx, 0xfffffffe
or ebx, 2
test bl, 8
je 0x1400080c0
and ebx, 0xfffffff6
or ebx, 2
mov qword [rsp + 0xb8], rbp
xor ecx, ecx
mov qword [rsp + 0xc0], r12
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__umask
mov ecx, eax
mov esi, eax
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__umask
mov edx, ebx
and edx, 3
je 0x140008103
sub edx, 1
je 0x1400080fc
cmp edx, 1
jne 0x14000822f
mov ecx, 0x12019f
jmp 0x140008108
mov ecx, 0x120116
jmp 0x140008108
mov ecx, 0x120089
test bl, 8
je 0x140008113
and ecx, 0xfffffffd
or ecx, 4
bt ebx, 0x1c
mov eax, 7
mov r10d, r15d
mov ebp, 4
cmovae r10d, eax
mov eax, ebx
and eax, 0x700
lea r12d, [rbp - 2]
cmp eax, 0x400
ja 0x140008170
test eax, 0xfffffbff
je 0x140008168
cmp eax, 0x100
je 0x140008163
cmp eax, 0x200
je 0x1400081f4
cmp eax, 0x300
jne 0x14000822f
mov r9d, r12d
jmp 0x14000818f
mov r9d, ebp
jmp 0x14000818f
mov r9d, 3
jmp 0x14000818f
cmp eax, 0x500
je 0x140008189
cmp eax, 0x600
je 0x1400081f4
cmp eax, 0x700
jne 0x14000822f
mov r9d, 1
mov edx, 0x80
bt ebx, 8
jae 0x1400081af
not sil
mov eax, 0x81
and sil, byte [rdi + 0x158]
test dl, sil
cmove edx, eax
mov r8d, ecx
mov eax, ebx
bts r8d, 0x10
and eax, 0x40
cmove r8d, ecx
mov ecx, edx
or ecx, 0x4000100
test eax, eax
mov eax, ebx
cmove ecx, edx
mov edx, ecx
bts edx, 8
and eax, 0x1000
mov eax, ebx
cmove edx, ecx
and eax, 0x30
je 0x140008200
cmp eax, 0x10
je 0x1400081fc
cmp eax, 0x20
jne 0x14000822f
bts edx, 0x1b
jmp 0x140008200
mov r9d, 5
jmp 0x14000818f
bts edx, 0x1c
mov ecx, r8d
bt ebx, 0x19
jae 0x14000821a
test bpl, r8b
je 0x140008216
test r12b, r8b
je 0x14000822f
and ecx, 0xfffffffb
bts edx, 0x1d
mov eax, ebx
and eax, 0xc000000
je 0x14000824d
add eax, 0xfc000000
test eax, 0xfbffffff
je 0x140008249
mov qword [rdi + 0x88], 0xfffffffffffff019
mov dword [rdi + 0x14c], 0x57
jmp 0x1400083cd
bts edx, 0x1f
bts edx, 0x19
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], edx
mov r8d, r10d
mov dword [rsp + 0x20], r9d
mov edx, ecx
mov rcx, qword [rdi + 0x150]
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400082db
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
jne 0x1400082b6
and ebx, 0x500
cmp ebx, 0x100
jne 0x1400082b6
mov r8d, 0x50
mov rax, 0xfffffffffffff01c
mov dword [rdi + 0x14c], r8d
mov qword [rdi + 0x88], rax
jmp 0x1400083cd
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov r8d, eax
call fcn.140016510
cdqe
mov dword [rdi + 0x14c], r8d
mov qword [rdi + 0x88], rax
jmp 0x1400083cd
mov edx, ebx
mov qword [rsp + 0x80], r14
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__open_osfhandle]
movsxd r14, eax
test eax, eax
jns 0x14000834d
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [rax], 0x18
jne 0x140008309
mov rax, 0xfffffffffffff01e
jmp 0x140008335
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x140008324
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov ebp, eax
call fcn.140016510
jmp 0x140008333
mov ecx, 0xfffff002
call fcn.140016510
mov ebp, 0xfffff002
cdqe
mov dword [rdi + 0x14c], ebp
mov rcx, rsi
mov qword [rdi + 0x88], rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1400083c5
bt ebx, 0x1d
jae 0x14000839b
mov r9d, 0x18
lea r8, [rsp + 0x60]
mov rcx, rsi
lea edx, [r9 - 0x17]
call qword [sym.imp.KERNEL32.dll_GetFileInformationByHandleEx]
test eax, eax
je 0x14000844b
movzx eax, byte [rsp + 0x75]
mov byte [rsp + 0x44], al
test al, al
je 0x1400083f7
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x48], 0xffffffffffffffff
lea rdx, [rsp + 0x40]
mov ecx, r14d
call fcn.1400077f0
mov qword [rdi + 0x88], r14
cmp r14, 0xffffffffffffffff
jne 0x1400083c5
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll___doserrno]
mov ecx, dword [rax]
mov dword [rdi + 0x14c], ecx
call fcn.140016510
movsxd rcx, eax
mov qword [rdi + 0x88], rcx
mov r14, qword [rsp + 0x80]
mov r12, qword [rsp + 0xc0]
mov rbp, qword [rsp + 0xb8]
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.1400f3170
add rsp, 0x88
pop r15
pop rdi
pop rsi
pop rbx
ret
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x14000844b
cmp qword [rsp + 0x50], r15
je 0x140008385
test byte [rsp + 0x40], 3
mov rcx, rsi
mov eax, dword [rsp + 0x50]
mov r9d, dword [rsp + 0x54]
cmove ebp, r12d
mov r8d, ebp
mov qword [rsp + 0x28], r15
xor edx, edx
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x14000838e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov dword [rdi + 0x14c], eax
call fcn.140016510
movsxd rcx, eax
mov qword [rdi + 0x88], rcx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1400083c5