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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x1d8
mov rdi, qword [rcx + 0x10]
mov qword [rsp + 0x220], rcx
mov rbx, rdx
call fcn.140334ad0
mov rcx, qword [rsp + 0x220]
mov rdx, rbx
mov r12, rax
call fcn.140334ab0
lea r8, [rsp + 0x68]
mov edx, 0x53
mov r14, rax
xor eax, eax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
mov rax, qword [rdi + 0x20]
mov rcx, qword [rax + 8]
mov rax, qword [0x140626fe0]
mov rax, qword [rax]
call qword [rax + 0x58]
mov ecx, eax
test eax, eax
jne 0x1403369c5
cmp qword [rsp + 0x68], 0
je 0x1403369c5
cmp qword [r12 + 8], 0
jne 0x140336a13
jmp 0x140336a05
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
call fcn.140335570
mov rcx, rbx
lea rdx, str.schannel:_Failed_to_read_remote_certificate_context:__s
mov r8, rax
call fcn.140324010
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x1403369fa
call qword [sym.imp.crypt32.dll_CertFreeCertificateChainEngine]
mov r13d, 0x3c
jmp 0x140336f5b
mov rsi, qword [r12 + 0x48]
test rsi, rsi
je 0x140336de1
mov rax, qword [rdi + 0x20]
xor esi, esi
cmp byte [rax + 0x6c], 0
je 0x140336de1
xor eax, eax
xor r8d, r8d
mov r9d, 2
mov edx, 1
mov dword [rsp + 0x20], eax
mov ecx, 6
call fcn.1403d2e80
test al, al
je 0x140336a56
lea rdx, str.schannel:_this_version_of_Windows_is_too_old_to_support_certificate_verification_via_CA_bundle_file.
mov rcx, rbx
call fcn.140324010
jmp 0x140336aa8
xor eax, eax
mov r9d, 0x2000
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x20], rax
mov ecx, 2
call qword [sym.imp.crypt32.dll_CertOpenStore]
mov rsi, rax
test rax, rax
jne 0x140336ac3
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov ecx, eax
call fcn.1403394f0
lea rdx, str.schannel:_failed_to_create_certificate_store:__s
mov rcx, rbx
mov r8, rax
call fcn.140324010
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140336ab8
call qword [sym.imp.crypt32.dll_CertFreeCertificateChainEngine]
mov r13d, 0x4d
jmp 0x140336f5b
mov rdi, qword [r12 + 0x48]
test rdi, rdi
je 0x140336af0
mov r8, qword [rdi + 8]
mov qword [rsp + 0x20], rbx
lea r9, str._memory_blob_
mov rcx, rax
mov rdx, qword [rdi]
call fcn.1403ba710
mov r13d, eax
jmp 0x140336d39
mov rax, qword [r12 + 8]
mov rcx, rax
mov qword [rsp + 0x40], rax
call sub.msvcrt.dll__strdup
mov r15, rax
test rax, rax
jne 0x140336b52
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov r13d, 0x4d
mov ecx, eax
call fcn.1403394f0
mov r8, qword [rsp + 0x40]
lea rdx, str.schannel:_invalid_path_name_for_CA_file__s:__s
mov rcx, rbx
mov r9, rax
call fcn.140324010
mov rax, qword [str.0ZJ_]
xor ecx, ecx
call qword [rax]
jmp 0x140336d3e
xor eax, eax
xor r9d, r9d
mov dword [rsp + 0x28], pe_nt_image_headers64
mov rcx, r15
mov qword [rsp + 0x30], rax
mov r8d, 1
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x48], rax
inc rax
jne 0x140336bd2
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov r13d, 0x4d
mov ecx, eax
call fcn.1403394f0
mov r8, qword [rsp + 0x40]
lea rdx, str.schannel:_failed_to_open_CA_file__s:__s
mov rcx, rbx
mov r9, rax
call fcn.140324010
mov rax, qword [str.0ZJ_]
xor ecx, ecx
call qword [rax]
jmp 0x140336d31
mov rcx, qword [rsp + 0x48]
lea rdx, [rsp + 0x80]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x140336c18
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov ecx, eax
call fcn.1403394f0
mov r8, qword [rsp + 0x40]
lea rdx, str.schannel:_failed_to_determine_size_of_CA_file__s:__s
mov r9, rax
jmp 0x140336ceb
mov rbp, qword [rsp + 0x80]
cmp rbp, 0x100000
jle 0x140336c43
mov r8d, 0x100000
lea rdx, str.schannel:_CA_file_exceeds_max_size_of__u_bytes
mov rcx, rbx
call fcn.140324010
jmp 0x140336cf3
mov rax, qword [0x140626c80]
lea rcx, [rbp + 1]
mov r13d, 0x1b
call qword [rax]
mov rdi, rax
test rax, rax
je 0x140336d1a
xor r11d, r11d
lea r9, [rsp + 0x64]
jmp 0x140336c7d
mov eax, dword [rsp + 0x64]
test eax, eax
je 0x140336c7a
add r11d, eax
mov r13, rbp
mov rbp, r13
mov r13d, r11d
cmp r13, rbp
jae 0x140336cfb
xor r10d, r10d
xor eax, eax
mov r8d, ebp
mov qword [rsp + 0x58], r9
sub r8d, r11d
mov dword [rsp + 0x54], r11d
mov rcx, qword [rsp + 0x48]
lea rdx, [rdi + r13]
mov dword [rsp + 0x64], r10d
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov r11d, dword [rsp + 0x54]
mov r9, qword [rsp + 0x58]
test eax, eax
jne 0x140336c6c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov ecx, eax
call fcn.1403394f0
mov r8, qword [rsp + 0x40]
lea rdx, str.schannel:_failed_to_read_from_CA_file__s:__s
mov r9, rax
mov rcx, rbx
call fcn.140324010
mov r13d, 0x4d
jmp 0x140336d1a
mov byte [rdi + rbp], 0
mov r9, qword [rsp + 0x40]
mov r8, rbp
mov rdx, rdi
mov qword [rsp + 0x20], rbx
mov rcx, rsi
call fcn.1403ba710
mov r13d, eax
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [str.0ZJ_]
mov rcx, rdi
call qword [rax]
mov rcx, r15
call sub.msvcrt.dll_free
test r13d, r13d
je 0x140336d57
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140336f50
call qword [sym.imp.crypt32.dll_CertFreeCertificateChainEngine]
jmp 0x140336f50
lea rdx, [rsp + 0x84]
mov ecx, 0x13
mov eax, r13d
mov rdi, rdx
lea r9, [rsp + 0x80]
lea rdx, [rsp + 0x78]
rep stosd dword [rdi], eax
mov qword [rsp + 0xc0], rsi
mov rcx, r9
mov dword [rsp + 0x80], 0x50
call qword [sym.imp.crypt32.dll_CertCreateCertificateChainEngine]
test eax, eax
jne 0x140336de1
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov ecx, eax
call fcn.1403394f0
mov rcx, rbx
lea rdx, str.schannel:_failed_to_create_certificate_chain_engine:__s
mov r8, rax
call fcn.140324010
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140336dd6
call qword [sym.imp.crypt32.dll_CertFreeCertificateChainEngine]
mov r13d, 0x4d
jmp 0x140336f50
lea r8, [rsp + 0x84]
xor eax, eax
mov ecx, 7
mov rdi, r8
xor r8d, r8d
lea rdx, [rsp + 0x80]
rep stosd dword [rdi], eax
mov rcx, qword [rsp + 0x68]
lea rax, [rsp + 0x70]
mov dword [rsp + 0x80], 0x20
mov r9, qword [rcx + 0x20]
mov qword [rsp + 0x30], r8
xor r8d, r8d
mov qword [rsp + 0x38], rax
mov al, byte [r14 + 0xb0]
mov qword [rsp + 0x20], rdx
mov rdx, rcx
mov rcx, qword [rsp + 0x78]
shr al, 3
xor eax, 1
and eax, 1
shl eax, 0x1d
mov dword [rsp + 0x28], eax
call qword [sym.imp.crypt32.dll_CertGetCertificateChain]
test eax, eax
jne 0x140336e8d
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0xd0]
mov r8d, 0x100
mov ecx, eax
call fcn.1403394f0
lea rdx, str.schannel:_CertGetCertificateChain_failed:__s
mov rcx, rbx
mov r8, rax
call fcn.140324010
xor eax, eax
mov qword [rsp + 0x70], rax
jmp 0x140336f18
mov rax, qword [rsp + 0x70]
mov rax, qword [rax + 0x10]
mov rax, qword [rax]
mov eax, dword [rax + 4]
mov r13d, eax
and r13d, 0xfeffffbd
test byte [rbx + 0x5d0], 0x20
jne 0x140336eb5
and eax, 0xfffffffd
mov r13d, eax
test r13d, r13d
je 0x140336f20
lea rdx, str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_REVOKED
test r13b, 4
jne 0x140336efc
bt r13d, 0x10
lea rdx, str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_PARTIAL_CHAIN
jb 0x140336efc
lea rdx, str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_UNTRUSTED_ROOT
test r13b, 0x20
jne 0x140336efc
lea rdx, str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_NOT_TIME_VALID
test r13b, 1
jne 0x140336efc
test r13b, 0x40
je 0x140336f06
lea rdx, str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_REVOCATION_STATUS_UNKNOWN
mov rcx, rbx
call fcn.140324010
jmp 0x140336f18
mov r8d, r13d
lea rdx, str.schannel:_CertGetCertificateChain_error_mask:_0x_08x
mov rcx, rbx
call fcn.140324010
mov r13d, 0x3c
jmp 0x140336f3b
test byte [r12 + 0x6c], 2
je 0x140336f3b
mov rcx, qword [rsp + 0x220]
mov rdx, rbx
call fcn.140336fa0
mov r13d, eax
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140336f4b
call qword [sym.imp.crypt32.dll_CertFreeCertificateChainEngine]
test rsi, rsi
je 0x140336f5b
xor edx, edx
mov rcx, rsi
call qword [sym.imp.crypt32.dll_CertCloseStore]
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140336f6b
call qword [sym.imp.crypt32.dll_CertFreeCertificateChain]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140336f7b
call qword [sym.imp.crypt32.dll_CertFreeCertificateContext]
mov eax, r13d
add rsp, 0x1d8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret