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

Disassembly:
sub esp, 0xa4
mov eax, dword [esp + 0xb0]
xor ecx, ecx
push ebx
mov ebx, dword [esp + 0xb0]
push ebp
mov ebp, dword [eax]
push esi
push edi
xor edi, edi
mov dword [esp + 0x18], ecx
xor esi, esi
test ebx, ebx
jne 0x51f626
push pe_nt_image_headers32
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00512d90
push eax
push ebx
push str.schannel:_invalid_path_name_for_CA_file__s:__s
push ebp
call fcn.004f8bb0
add esp, 0x1c
lea ebx, [edi + 0x4d]
jmp 0x51f93d
push 0
push pe_nt_image_headers32
push 3
push 0
push 1
push accept
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x20], eax
cmp eax, 0xffffffff
jne 0x51f678
push pe_nt_image_headers32
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00512d90
push eax
push ebx
push str.schannel:_failed_to_open_CA_file__s:__s
push ebp
call fcn.004f8bb0
add esp, 0x1c
mov ebx, 0x4d
jmp 0x51f93d
lea ecx, [esp + 0x24]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x51f6b8
push pe_nt_image_headers32
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00512d90
push eax
push ebx
push str.schannel:_failed_to_determine_size_of_CA_file__s:__s
push ebp
call fcn.004f8bb0
add esp, 0x1c
mov ebx, 0x4d
jmp 0x51f933
mov edi, dword [esp + 0x24]
cmp dword [esp + 0x28], esi
jl 0x51f6eb
jg 0x51f6cc
cmp edi, 0x100000
jbe 0x51f6eb
push 0x100000
push str.schannel:_CA_file_exceeds_max_size_of__u_bytes
push ebp
call fcn.004f8bb0
add esp, 0xc
mov ebx, 0x4d
xor edi, edi
jmp 0x51f933
lea eax, [edi + 1]
push eax
call dword [0xa5e0b8]
mov ecx, eax
add esp, 4
mov dword [esp + 0x10], ecx
test ecx, ecx
jne 0x51f70c
lea ebx, [eax + 0x1b]
mov edi, eax
jmp 0x51f933
xor ebx, ebx
test edi, edi
je 0x51f74e
push 0
lea eax, [esp + 0x18]
mov dword [esp + 0x18], ebx
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [esi + ecx]
push eax
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x51f823
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
test eax, eax
je 0x51f81b
add esi, eax
cmp esi, edi
jb 0x51f712
mov byte [edi + ecx], bl
mov edi, ecx
cmp byte [edi], bl
je 0x51f900
push str._____BEGIN_CERTIFICATE_____
push edi
call dword [sym.imp.MSVCRT.dll_strstr]
mov esi, eax
add esp, 8
test esi, esi
je 0x51f900
mov al, byte [esi + 0x1b]
cmp al, 0xd
je 0x51f783
cmp al, 0xa
jne 0x51f900
push str._n_____END_CERTIFICATE_____
push esi
call dword [sym.imp.MSVCRT.dll_strstr]
mov edi, eax
add esp, 8
test edi, edi
je 0x51f8e3
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
push eax
push 0
push 0
push 0
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], ebx
push eax
push 0
push 0
push 0xe
push 2
lea eax, [esp + 0x50]
mov dword [esp + 0x54], esi
sub edi, esi
push eax
add edi, 0x1a
push 2
mov dword [esp + 0x58], edi
call dword [sym.imp.CRYPT32.dll_CryptQueryObject]
test eax, eax
je 0x51f8af
mov ecx, dword [esp + 0x1c]
add edi, esi
cmp ecx, 1
jne 0x51f891
push 0
push 4
push dword [esp + 0x1c]
push dword [esp + 0xc4]
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
push dword [esp + 0x14]
mov esi, eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test esi, esi
je 0x51f85a
inc dword [esp + 0x18]
jmp 0x51f753
mov byte [esi + ecx], bl
jmp 0x51f751
push pe_nt_image_headers32
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00512d90
push eax
mov eax, dword [esp + 0xcc]
push eax
push str.schannel:_failed_to_read_from_CA_file__s:__s
push ebp
call fcn.004f8bb0
add esp, 0x1c
mov ebx, 0x4d
jmp 0x51f92f
push pe_nt_image_headers32
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00512d90
push eax
mov eax, dword [esp + 0xcc]
push eax
push str.schannel:_failed_to_add_certificate_from_CA_file__s_to_certificate_store:__s
push ebp
call fcn.004f8bb0
add esp, 0x1c
mov ebx, 0x4d
jmp 0x51f92f
mov eax, dword [esp + 0xbc]
push eax
push ecx
push str.schannel:_unexpected_content_type__d_when_extracting_certificate_from_CA_file__s
push ebp
call fcn.004f8bb0
mov ebx, 0x4d
jmp 0x51f92c
push pe_nt_image_headers32
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00512d90
push eax
mov eax, dword [esp + 0xcc]
push eax
push str.schannel:_failed_to_extract_certificate_from_CA_file__s:__s
push ebp
call fcn.004f8bb0
add esp, 0x1c
mov ebx, 0x4d
jmp 0x51f92f
mov eax, dword [esp + 0xbc]
push eax
push str.schannel:_CA_file__s_is_not_correctly_formatted
push ebp
call fcn.004f8bb0
add esp, 0xc
mov ebx, 0x4d
jmp 0x51f92f
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0xbc]
push eax
test ecx, ecx
jne 0x51f920
push str.schannel:_did_not_add_any_certificates_from_CA_file__s_n
push ebp
call fcn.004f8c70
add esp, 0xc
jmp 0x51f92f
push ecx
push str.schannel:_added__d_certificate_s__from_CA_file__s_n
push ebp
call fcn.004f8c70
add esp, 0x10
mov edi, dword [esp + 0x10]
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call dword [0xa5e0bc]
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa4
ret