Function at 0x4a1b10
Capabilities:
Get file size
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1ac
mov esi, dword [esp + 0x1c0]
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
cmp dword [esi + 0x358], 2
mov ebx, dword [esi]
je 0x4a1d40
mov eax, dword [esi + 0x304]
mov dword [esp + 0x30], eax
mov edi, dword [esp + 0x1c4]
lea eax, [esp + 0x54]
mov dword [esp + 4], 0x53
mov dword [esp + 8], eax
shl edi, 4
add edi, esi
mov eax, dword [edi + 0x458]
mov eax, dword [eax + 4]
mov dword [esp], eax
mov eax, dword [0x743284]
call dword [eax + 0x2c]
sub esp, 0xc
test eax, eax
jne 0x4a1d00
mov edx, dword [esp + 0x54]
test edx, edx
je 0x4a1d00
cmp dword [esi + 0x358], 2
je 0x4a1d80
mov ecx, dword [esi + 0x4a0]
test ecx, ecx
setne al
test al, al
je 0x4a1d70
mov eax, dword [edi + 0x458]
xor ebp, ebp
lea ecx, [esp + 0x70]
mov dword [esp + 0x34], ecx
cmp byte [eax + 0x47], 0
jne 0x4a1df0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
lea ecx, [esp + 0x58]
mov dword [esp + 0x7c], 0
mov dword [esp + 0x70], 0x10
movzx eax, byte [ebx + 0x868]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], 0
and eax, 8
cmp al, 1
sbb eax, eax
and eax, 0x20000000
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [edx + 0x10]
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x5c]
mov dword [esp], eax
call dword [sym.imp.CRYPT32.dll_CertGetCertificateChain]
sub esp, 0x20
test eax, eax
je 0x4a1fc0
mov eax, dword [esp + 0x58]
mov eax, dword [eax + 0x10]
mov eax, dword [eax]
mov eax, dword [eax + 4]
mov edx, eax
and eax, 0xfeffffbd
and edx, 0xfffffffd
test byte [ebx + 0x868], 0x20
cmove eax, edx
test eax, eax
jne 0x4a1db0
cmp dword [esi + 0x358], 2
je 0x4a1f90
movzx eax, byte [esi + 0x4bc]
shr al, 1
and eax, 1
xor ebx, ebx
test al, al
jne 0x4a1f50
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x4a1cac
mov dword [esp], eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChainEngine]
sub esp, 4
test ebp, ebp
je 0x4a1cc4
mov dword [esp + 4], 0
mov dword [esp], ebp
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
sub esp, 8
mov eax, dword [esp + 0x58]
test eax, eax
je 0x4a1cd8
mov dword [esp], eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChain]
sub esp, 4
mov eax, dword [esp + 0x54]
test eax, eax
je 0x4a1cec
mov dword [esp], eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
sub esp, 4
add esp, 0x1ac
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
xor ebp, ebp
mov dword [esp + 4], edx
call sym._Curl_sspi_strerror
mov dword [esp], ebx
mov dword [esp + 8], eax
mov ebx, 0x3c
mov dword [esp + 4], str.schannel:_Failed_to_read_remote_certificate_context:__s
call sym._Curl_failf
jmp 0x4a1c98
xor eax, eax
cmp dword [esi + 0x40c], 0xffffffff
setne al
add eax, 0x47
shl eax, 4
cmp dword [esi + eax], 2
je 0x4a1b48
mov eax, dword [esi + 0x34c]
mov dword [esp + 0x30], eax
jmp 0x4a1b52
lea eax, [esp + 0x70]
xor ebp, ebp
mov dword [esp + 0x34], eax
jmp 0x4a1bd3
xor eax, eax
cmp dword [esi + 0x40c], 0xffffffff
setne al
add eax, 0x47
shl eax, 4
cmp dword [esi + eax], 2
je 0x4a1ba6
mov ebp, dword [esi + 0x4cc]
test ebp, ebp
setne al
jmp 0x4a1bb1
test al, 4
jne 0x4a2150
test eax, 0x10000
jne 0x4a2030
test al, 0x20
jne 0x4a2165
test al, 1
jne 0x4a2269
test al, 0x40
je 0x4a21a5
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_REVOCATION_STATUS_UNKNOWN
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a1ffd
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], 6
call sym._Curl_verify_windows_version
test al, al
jne 0x4a2010
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x2000
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 2
call dword [sym.imp.CRYPT32.dll_CertOpenStore]
sub esp, 0x14
test eax, eax
mov ebp, eax
je 0x4a25bd
cmp dword [esi + 0x358], 2
je 0x4a217a
mov eax, dword [esi + 0x4a0]
mov dword [esp + 0x34], eax
mov eax, dword [esi]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x34]
test eax, eax
je 0x4a21be
mov eax, dword [esp + 0x34]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [esp + 0x38], eax
je 0x4a229b
lea eax, [esp + 0x68]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x4a2216
cmp dword [esp + 0x6c], 0
mov eax, dword [esp + 0x68]
mov dword [esp + 0x48], eax
jl 0x4a22ec
jle 0x4a22e1
mov eax, dword [esp + 0x40]
mov dword [esp + 8], 0x100000
mov ebx, 0x4d
mov dword [esp + 4], str.schannel:_CA_file_exceeds_max_size_of__u_bytes
mov dword [esp], eax
call sym._Curl_failf
mov dword [esp + 0x3c], 0
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call dword [0x5bcc2c]
jmp 0x4a1c98
mov eax, dword [esp + 0x54]
mov esi, dword [esi]
xor ecx, ecx
mov dword [esp], 0
mov dword [esp + 0x34], eax
mov edx, eax
mov eax, esi
call sym._cert_get_name_string
test eax, eax
mov edi, eax
jne 0x4a2042
mov dword [esp + 4], str.schannel:_CertGetNameString___returned_no_certificate_name_information
mov dword [esp], esi
mov ebx, 0x3c
call sym._Curl_failf
jmp 0x4a1c98
xor eax, eax
cmp dword [esi + 0x40c], 0xffffffff
setne al
add eax, 0x47
shl eax, 4
cmp dword [esi + eax], 2
je 0x4a1c82
movzx eax, byte [esi + 0x4e8]
shr al, 1
and eax, 1
jmp 0x4a1c8e
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_failed:__s
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._Curl_failf
mov dword [esp + 0x58], 0
mov ebx, 0x3c
jmp 0x4a1c98
mov dword [esp + 4], str.schannel:_this_version_of_Windows_is_too_old_to_support_certificate_verification_via_CA_bundle_file.
mov dword [esp], ebx
call sym._Curl_failf
xor ebp, ebp
mov ebx, 0x4d
jmp 0x4a1c98
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_PARTIAL_CHAIN
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a1ffd
mov dword [esp], eax
mov ebx, 0x1b
call dword [0x5bcc30]
test eax, eax
mov dword [esp + 0x38], eax
je 0x4a1c98
mov edx, dword [esp + 0x34]
mov ecx, eax
mov dword [esp], edi
mov eax, esi
call sym._cert_get_name_string
cmp edi, eax
je 0x4a208a
mov dword [esp + 4], str.schannel:_CertGetNameString___returned_certificate_name_information_of_unexpected_size
mov dword [esp], esi
mov ebx, 0x3c
call sym._Curl_failf
jmp 0x4a1c98
mov eax, dword [esp + 0x38]
xor edx, edx
cmp byte [eax], 0
mov ecx, eax
jne 0x4a20fa
jmp 0x4a259b
mov eax, dword [esp + 0x30]
mov dword [esp + 0xc], ecx
mov ebx, 0x3c
mov dword [esp + 4], str.schannel:_connection_hostname___s__did_not_match_against_certificate_name___s__n
mov dword [esp], esi
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], ecx
mov dword [esp + 8], eax
call sym._Curl_infof
mov ecx, dword [esp + 0x34]
mov dword [esp], ecx
call sym._strlen
mov edx, dword [esp + 0x3c]
lea edx, [edx + eax + 1]
cmp edi, edx
jbe 0x4a2592
mov eax, dword [esp + 0x38]
lea ecx, [eax + edx]
cmp byte [ecx], 0
je 0x4a2592
cmp ebx, 0x3c
jne 0x4a227e
mov eax, dword [esp + 0x30]
mov dword [esp], ecx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], ecx
mov dword [esp + 4], eax
call sym._Curl_cert_hostcheck
cmp eax, 1
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
jne 0x4a209c
mov eax, dword [esp + 0x30]
mov dword [esp + 0xc], ecx
xor ebx, ebx
mov dword [esp + 4], str.schannel:_connection_hostname___s__validated_against_certificate_name___s__n
mov dword [esp], esi
mov dword [esp + 0x34], edx
mov dword [esp + 8], eax
call sym._Curl_infof
mov edx, dword [esp + 0x34]
jmp 0x4a20d9
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_REVOKED
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a1ffd
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_UNTRUSTED_ROOT
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a1ffd
xor eax, eax
cmp dword [esi + 0x40c], 0xffffffff
setne al
add eax, 0x47
shl eax, 4
cmp dword [esi + eax], 2
je 0x4a1e63
mov eax, dword [esi + 0x4cc]
mov dword [esp + 0x34], eax
jmp 0x4a1e6d
mov dword [esp + 8], eax
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_error_mask:_0x_08x
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a1ffd
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 8], 0
mov dword [esp + 4], str.schannel:_invalid_path_name_for_CA_file__s:__s
mov dword [esp], eax
call sym._Curl_failf
mov dword [esp], 0
mov ebx, 0x4d
call dword [0x5bcc2c]
jmp 0x4a1c98
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov ebx, 0x4d
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], str.schannel:_failed_to_determine_size_of_CA_file__s:__s
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_failf
mov dword [esp + 0x3c], 0
jmp 0x4a1f2e
mov dword [esp + 4], str.schannel:_CertGetCertificateChain_trust_error_CERT_TRUST_IS_NOT_TIME_VALID
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a1ffd
test ebx, ebx
je 0x4a1c98
mov dword [esp + 4], str.schannel:_server_certificate_name_verification_failed
mov dword [esp], esi
call sym._Curl_failf
jmp 0x4a1c98
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], str.schannel:_failed_to_open_CA_file__s:__s
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_failf
jmp 0x4a21ff
cmp eax, 0x100000
ja 0x4a1f05
mov edi, dword [esp + 0x48]
mov eax, edi
add eax, 1
mov dword [esp], eax
call dword [0x5bcc30]
test eax, eax
mov dword [esp + 0x3c], eax
je 0x4a2705
test edi, edi
je 0x4a277f
lea ecx, [esp + 0x70]
xor edx, edx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x1c0], esi
mov ebx, edx
mov dword [esp + 0x44], ebp
mov esi, ecx
nop
lea esi, [esi]
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x70], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
lea ebp, [eax + ebx]
mov eax, edi
sub eax, ebx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 4], ebp
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x4a26b6
mov eax, dword [esp + 0x70]
test eax, eax
je 0x4a23a0
add ebx, eax
cmp edi, ebx
ja 0x4a2330
mov edi, dword [esp + 0x48]
mov ebx, dword [esp + 0x4c]
mov ebp, dword [esp + 0x44]
mov esi, dword [esp + 0x1c0]
add edi, dword [esp + 0x3c]
jmp 0x4a23b1
mov edi, ebp
mov ebx, dword [esp + 0x4c]
mov ebp, dword [esp + 0x44]
mov esi, dword [esp + 0x1c0]
mov byte [edi], 0
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], ebx
cmp byte [edi], 0
je 0x4a23f3
mov dword [esp + 4], 0x5df26b
mov dword [esp], edi
call sym._strstr
test eax, eax
mov ebx, eax
je 0x4a23f3
movzx eax, byte [eax + 0x1b]
cmp al, 0xd
je 0x4a24bc
cmp al, 0xa
je 0x4a24bc
cmp dword [esp + 0x44], 0
mov ebx, dword [esp + 0x48]
mov eax, dword [esp + 0x34]
jne 0x4a275a
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 4], str.schannel:_did_not_add_any_certificates_from_CA_file__s_n
mov dword [esp], eax
call sym._Curl_infof
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [esp + 0x3c]
lea edi, [esp + 0x70]
mov dword [esp], eax
call dword [0x5bcc2c]
xor eax, eax
mov ecx, 0xc
mov edx, edi
mov dword [esp + 0x34], edi
rep stosd dword es:[edi], eax
lea eax, [esp + 0x5c]
mov dword [esp], edx
mov dword [esp + 0x70], 0x30
mov dword [esp + 0x98], ebp
mov dword [esp + 4], eax
call dword [sym.imp.CRYPT32.dll_CertCreateCertificateChainEngine]
sub esp, 8
test eax, eax
mov edx, dword [esp + 0x54]
jne 0x4a1bd3
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp], ebx
mov dword [esp + 8], eax
mov ebx, 0x4d
mov dword [esp + 4], str.schannel:_failed_to_create_certificate_chain_engine:__s
call sym._Curl_failf
jmp 0x4a1c98
mov dword [esp + 4], str._n_____END_CERTIFICATE_____
mov dword [esp], ebx
call sym._strstr
test eax, eax
je 0x4a2690
lea edi, [eax + 0x1a]
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x74], ebx
mov dword [esp + 0x24], 0
mov eax, edi
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
sub eax, ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x70], eax
lea eax, [esp + 0x60]
mov dword [esp + 0xc], 0xe
mov dword [esp + 8], 2
mov dword [esp], 2
mov dword [esp + 0x28], eax
lea eax, [esp + 0x64]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x70]
mov dword [esp + 4], eax
call dword [sym.imp.CRYPT32.dll_CryptQueryObject]
sub esp, 0x2c
test eax, eax
je 0x4a25f7
mov eax, dword [esp + 0x64]
cmp eax, 1
je 0x4a2642
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], eax
mov ebx, 0x4d
mov eax, dword [esp + 0x40]
mov dword [esp + 4], str.schannel:_unexpected_content_type__d_when_extracting_certificate_from_CA_file__s
mov dword [esp + 0xc], ecx
mov dword [esp], eax
call sym._Curl_failf
jmp 0x4a1f2e
cmp ebx, 0x3c
jne 0x4a227e
mov eax, dword [esp + 0x30]
mov dword [esp + 4], str.schannel:_CertGetNameString___failed_to_match_connection_hostname___s__against_server_certificate_names
mov ebx, 0x3c
mov dword [esp], esi
mov dword [esp + 8], eax
call sym._Curl_failf
jmp 0x4a1c98
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 4], str.schannel:_failed_to_create_certificate_store:__s
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._Curl_failf
jmp 0x4a2020
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov ebx, 0x4d
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], str.schannel:_failed_to_extract_certificate_from_CA_file__s:__s
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_failf
jmp 0x4a1f2e
mov eax, dword [esp + 0x60]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
mov dword [esp], ebp
mov dword [esp + 4], eax
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
sub esp, 0x10
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
sub esp, 4
mov edx, dword [esp + 0x4c]
test edx, edx
je 0x4a270f
add dword [esp + 0x44], 1
jmp 0x4a23c4
mov eax, dword [esp + 0x34]
mov dword [esp + 4], str.schannel:_CA_file__s_is_not_correctly_formatted
mov ebx, 0x4d
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_failf
jmp 0x4a1f2e
mov ebp, dword [esp + 0x44]
mov ebx, 0x4d
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], str.schannel:_failed_to_read_from_CA_file__s:__s
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_failf
jmp 0x4a1f2e
mov ebx, 0x1b
jmp 0x4a1f2e
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [esp + 0xa0]
mov dword [esp + 8], 0x100
mov dword [esp], eax
mov ebx, 0x4d
mov dword [esp + 4], edx
call sym._Curl_winapi_strerror
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 4], str.schannel:_failed_to_add_certificate_from_CA_file__s_to_certificate_store:__s
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_failf
jmp 0x4a1f2e
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x44]
mov dword [esp + 4], str.schannel:_added__d_certificate_s__from_CA_file__s_n
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._Curl_infof
jmp 0x4a241e
mov edi, dword [esp + 0x3c]
jmp 0x4a23b1