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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xbc
mov eax, dword [0x4e40d8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp + 0x10]
push edi
push esi
mov dword [ebp - 0x8c], esi
mov edi, dword [eax]
mov dword [ebp - 0x9c], ebx
mov dword [ebp - 0x94], ebx
mov dword [ebp - 0xa0], ebx
call fcn.004a9d53
mov dword [ebp - 0xac], eax
pop ecx
test eax, eax
jne 0x4a9883
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0047524a
push eax
push esi
push str.schannel:_invalid_path_name_for_CA_file__s:__s
push edi
call fcn.00486746
add esp, 0x1c
push 0x4d
pop ebx
jmp 0x4a9bad
push ebx
push 0x80
push 3
push ebx
push ebx
push accept
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0xa4], eax
cmp eax, 0xffffffff
jne 0x4a98c5
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0047524a
push eax
push esi
push str.schannel:_failed_to_open_CA_file__s:__s
jmp 0x4a9872
lea ecx, [ebp - 0xb4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4a9907
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0047524a
push eax
push esi
push str.schannel:_failed_to_determine_size_of_CA_file__s:__s
push edi
call fcn.00486746
add esp, 0x1c
push 0x4d
pop ebx
jmp 0x4a9ba1
mov eax, dword [ebp - 0xb4]
mov dword [ebp - 0x98], eax
cmp dword [ebp - 0xb0], ebx
jl 0x4a9937
mov ecx, 0x100000
jg 0x4a9926
cmp eax, ecx
jbe 0x4a9937
push ecx
push str.schannel:_CA_file_exceeds_max_size_of__u_bytes
push edi
call fcn.00486746
add esp, 0xc
jmp 0x4a98ff
inc eax
push eax
call dword [0x4e4990]
mov edx, eax
mov dword [ebp - 0x9c], edx
pop ecx
test edx, edx
jne 0x4a9950
push 0x1b
jmp 0x4a9901
mov eax, dword [ebp - 0x98]
test eax, eax
je 0x4a99b9
mov ecx, ebx
push ebx
lea esi, [ebp - 0x90]
mov dword [ebp - 0x90], ebx
push esi
sub eax, ecx
push eax
lea eax, [ecx + edx]
push eax
push dword [ebp - 0xa4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, dword [ebp - 0x8c]
test eax, eax
je 0x4a9ab2
mov edx, dword [ebp - 0x9c]
cmp dword [ebp - 0x90], ebx
je 0x4a9aa7
mov ecx, dword [ebp - 0x94]
add ecx, dword [ebp - 0x90]
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x94], ecx
cmp ecx, eax
jb 0x4a995c
mov byte [eax + edx], bl
mov eax, edx
mov byte [ebp - 0x85], 1
mov dword [ebp - 0x98], eax
cmp byte [eax], bl
je 0x4a9b72
push str._____BEGIN_CERTIFICATE_____
push eax
call fcn.004b2a80
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x4a9ad6
mov al, byte [esi + 0x1b]
cmp al, 0xd
je 0x4a99f9
cmp al, 0xa
jne 0x4a9ad6
push str._n_____END_CERTIFICATE_____
push esi
call fcn.004b2a80
pop ecx
pop ecx
test eax, eax
je 0x4a9b62
sub eax, esi
mov dword [ebp - 0x94], ebx
add eax, 0x1a
mov dword [ebp - 0x90], ebx
mov dword [ebp - 0x98], eax
mov dword [ebp - 0xbc], eax
lea eax, [ebp - 0x94]
push eax
push ebx
push ebx
push ebx
lea eax, [ebp - 0x90]
mov dword [ebp - 0xb8], esi
push eax
push ebx
push ebx
push 0xe
push 2
lea eax, [ebp - 0xbc]
push eax
push 2
call dword [sym.imp.CRYPT32.dll_CryptQueryObject]
test eax, eax
je 0x4a9b39
add dword [ebp - 0x98], esi
cmp dword [ebp - 0x90], 1
jne 0x4a9b1a
push ebx
push 4
push dword [ebp - 0x94]
push dword [ebp - 0xa8]
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
push dword [ebp - 0x94]
mov esi, eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test esi, esi
je 0x4a9af1
inc dword [ebp - 0xa0]
mov cl, byte [ebp - 0x85]
jmp 0x4a9ade
mov eax, dword [ebp - 0x94]
jmp 0x4a99b9
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0047524a
push eax
push esi
push str.schannel:_failed_to_read_from_CA_file__s:__s
jmp 0x4a98f6
mov cl, bl
mov byte [ebp - 0x85], cl
test cl, cl
je 0x4a9b72
mov eax, dword [ebp - 0x98]
jmp 0x4a99cb
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0047524a
push eax
push dword [ebp - 0x8c]
push str.schannel:_failed_to_add_certificate_from_CA_file__s_to_certificate_store:__s
jmp 0x4a98f6
push dword [ebp - 0x8c]
push dword [ebp - 0x90]
push str.schannel:_unexpected_content_type__d_when_extracting_certificate_from_CA_file__s
push edi
call fcn.00486746
add esp, 0x10
jmp 0x4a98ff
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0047524a
push eax
push dword [ebp - 0x8c]
push str.schannel:_failed_to_extract_certificate_from_CA_file__s:__s
jmp 0x4a98f6
push dword [ebp - 0x8c]
push str.schannel:_CA_file__s_is_not_correctly_formatted
jmp 0x4a992c
mov eax, dword [ebp - 0xa0]
push dword [ebp - 0x8c]
test eax, eax
jne 0x4a9b92
push str.schannel:_did_not_add_any_certificates_from_CA_file__s_n
push edi
call fcn.0048681c
add esp, 0xc
jmp 0x4a9ba1
push eax
push str.schannel:_added__d_certificate_s__from_CA_file__s_n
push edi
call fcn.0048681c
add esp, 0x10
push dword [ebp - 0xa4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x9c]
call dword [0x4e4994]
mov eax, dword [ebp - 0xac]
pop ecx
test eax, eax
je 0x4a9bcc
push eax
call dword [0x4e4994]
pop ecx
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00451fe7
mov esp, ebp
pop ebp
ret