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

Disassembly:
push rbp
push rbx
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x30]
sub rsp, 0x130
mov rax, qword [0x1401fbf28]
xor rax, rsp
mov qword [rbp + 0x20], rax
mov r15, qword [r8]
xor ebx, ebx
mov qword [rsp + 0x70], rcx
mov r12, rdx
mov r14d, ebx
mov edi, ebx
mov r13d, ebx
test rdx, rdx
jne 0x140051e86
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, pe_nt_image_headers64
lea rdx, [rbp - 0x60]
mov ecx, eax
call fcn.14004eb70
mov r9, rax
lea rdx, str.schannel:_invalid_path_name_for_CA_file__s:__s
xor r8d, r8d
mov rcx, r15
call fcn.140022cd0
lea ebx, [r12 + 0x4d]
jmp 0x1400521e8
mov qword [rsp + 0x30], rbx
xor r9d, r9d
mov dword [rsp + 0x28], pe_nt_image_headers64
xor r8d, r8d
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x78], rax
cmp rax, 0xffffffffffffffff
jne 0x140051ef0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, pe_nt_image_headers64
lea rdx, [rbp - 0x60]
mov ecx, eax
call fcn.14004eb70
mov r9, rax
lea rdx, str.schannel:_failed_to_open_CA_file__s:__s
mov r8, r12
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521e8
lea rdx, [rbp - 0x80]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x140051f37
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, pe_nt_image_headers64
lea rdx, [rbp - 0x60]
mov ecx, eax
call fcn.14004eb70
mov r9, rax
lea rdx, str.schannel:_failed_to_determine_size_of_CA_file__s:__s
mov r8, r12
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521dd
mov qword [rsp + 0x188], rsi
mov rsi, qword [rbp - 0x80]
cmp rsi, 0x100000
jle 0x140051f6b
mov r8d, 0x100000
lea rdx, str.schannel:_CA_file_exceeds_max_size_of__u_bytes
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521d5
lea rcx, [rsi + 1]
call qword [fcn.140065f00]
mov qword [rsp + 0x68], rax
test rax, rax
jne 0x140051f8a
lea ebx, [rax + 0x1b]
mov r14, rax
jmp 0x1400521d5
test rsi, rsi
je 0x140051fd9
nop
mov rcx, qword [rsp + 0x78]
lea r9, [rsp + 0x60]
mov r8d, esi
mov r14d, edi
sub r8d, edi
mov dword [rsp + 0x60], ebx
mov qword [rsp + 0x20], rbx
lea rdx, [r14 + rax]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1400520d4
mov eax, dword [rsp + 0x60]
test eax, eax
jne 0x140051fcb
mov esi, r14d
jmp 0x140051fcd
add edi, eax
mov eax, edi
cmp rax, rsi
mov rax, qword [rsp + 0x68]
jb 0x140051f90
mov r14, qword [rsp + 0x70]
mov byte [rsi + rax], bl
mov rsi, rax
cmp byte [rsi], bl
je 0x1400521a5
lea rdx, str._____BEGIN_CERTIFICATE_____
mov rcx, rsi
call fcn.14005ccd8
mov rdi, rax
test rax, rax
je 0x1400521a5
movzx eax, byte [rax + 0x1b]
cmp al, 0xd
je 0x140052017
cmp al, 0xa
jne 0x1400521a5
lea rdx, str._n_____END_CERTIFICATE_____
mov rcx, rdi
call fcn.14005ccd8
mov rsi, rax
test rax, rax
je 0x14005218c
lea rax, [rsp + 0x70]
mov qword [rsp + 0x70], rbx
mov qword [rsp + 0x50], rax
lea rdx, [rbp - 0x78]
mov qword [rsp + 0x48], rbx
lea rax, [rsp + 0x60]
mov qword [rsp + 0x40], rbx
mov r8d, 2
mov qword [rsp + 0x38], rbx
sub esi, edi
mov qword [rsp + 0x30], rax
add esi, 0x1a
mov qword [rsp + 0x28], rbx
mov r9d, reloc.WS2_32.dll_ntohl
mov ecx, r8d
mov dword [rsp + 0x20], ebx
mov dword [rsp + 0x60], ebx
mov qword [rbp - 0x70], rdi
mov dword [rbp - 0x78], esi
call qword [sym.imp.CRYPT32.dll_CryptQueryObject]
test eax, eax
je 0x140052159
mov r8d, dword [rsp + 0x60]
add rsi, rdi
cmp r8d, 1
jne 0x140052140
mov rdx, qword [rsp + 0x70]
xor r9d, r9d
mov rcx, r14
lea r8d, [r9 + 4]
call qword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
mov rcx, qword [rsp + 0x70]
mov edi, eax
call qword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test edi, edi
je 0x14005210a
inc r13d
jmp 0x140051fe4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, pe_nt_image_headers64
lea rdx, [rbp - 0x60]
mov ecx, eax
call fcn.14004eb70
mov r9, rax
lea rdx, str.schannel:_failed_to_read_from_CA_file__s:__s
mov r8, r12
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, pe_nt_image_headers64
lea rdx, [rbp - 0x60]
mov ecx, eax
call fcn.14004eb70
mov r9, rax
lea rdx, str.schannel:_failed_to_add_certificate_from_CA_file__s_to_certificate_store:__s
mov r8, r12
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521d0
mov r9, r12
lea rdx, str.schannel:_unexpected_content_type__d_when_extracting_certificate_from_CA_file__s
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, pe_nt_image_headers64
lea rdx, [rbp - 0x60]
mov ecx, eax
call fcn.14004eb70
mov r9, rax
lea rdx, str.schannel:_failed_to_extract_certificate_from_CA_file__s:__s
mov r8, r12
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521d0
mov r8, r12
lea rdx, str.schannel:_CA_file__s_is_not_correctly_formatted
mov rcx, r15
call fcn.140022cd0
mov ebx, Ordinal_79
jmp 0x1400521d0
mov rcx, r15
test r13d, r13d
jne 0x1400521be
mov r8, r12
lea rdx, str.schannel:_did_not_add_any_certificates_from_CA_file__s_n
call fcn.140022e50
jmp 0x1400521d0
mov r9, r12
lea rdx, str.schannel:_added__d_certificate_s__from_CA_file__s_n
mov r8d, r13d
call fcn.140022e50
mov r14, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x188]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r14
call qword [fcn.140060adc]
mov eax, ebx
mov rcx, qword [rbp + 0x20]
xor rcx, rsp
call fcn.14000e6b0
add rsp, 0x130
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rbx
pop rbp
ret