Function at 0x509990
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x180
mov eax, dword [0x6c45ac]
xor eax, esp
mov dword [esp + 0x17c], eax
push ebx
mov ebx, dword [esp + 0x190]
lea eax, [esp + 0x34]
push ebp
push esi
mov esi, dword [esp + 0x194]
push edi
mov edi, dword [esp + 0x194]
lea ebx, [ebx + 0x19]
push 0x38
shl ebx, 4
push 0
add ebx, esi
mov dword [esp + 0x20], 0
push eax
mov dword [esp + 0x40], ebx
call fcn.005a88e0
add esp, 0xc
mov dword [esp + 0x40], 4
cmp byte [esi + 0x210], 0
mov ebp, 0x1b0
je 0x509a81
mov eax, dword [ebx + 8]
mov edx, 8
mov ecx, 0x20
lea ebx, [ebp + 0x10]
cmp byte [eax + 0x47], 0
cmovne ecx, edx
mov edx, dword [esi + 0xb8]
cmp edx, 2
jne 0x509a37
cmp dword [esi + 0x14c], 0xffffffff
mov eax, ebp
cmovne eax, ebx
cmp dword [eax + esi], edx
je 0x509a37
mov al, byte [edi + 0x4d3]
jmp 0x509a3d
mov al, byte [edi + 0x467]
test al, al
je 0x509a49
or ecx, 0x1800
jmp 0x509a8c
cmp edx, 2
jne 0x509a67
cmp dword [esi + 0x14c], 0xffffffff
mov eax, ebp
cmovne eax, ebx
cmp dword [eax + esi], edx
je 0x509a67
mov al, byte [edi + 0x4d5]
jmp 0x509a6d
mov al, byte [edi + 0x469]
test al, al
je 0x509a79
or ecx, 0x1a00
jmp 0x509a8c
or ecx, 0x200
jmp 0x509a8c
mov edx, dword [esi + 0xb8]
mov ecx, 0x1808
cmp byte [esi + 0x211], 0
mov dword [esp + 0x70], ecx
jne 0x509aa0
or ecx, 4
mov dword [esp + 0x70], ecx
mov ebx, 0x1c0
cmp edx, 2
jne 0x509ac3
cmp dword [esi + 0x14c], 0xffffffff
mov eax, ebp
cmovne eax, ebx
cmp dword [eax + esi], edx
je 0x509ac3
mov al, byte [edi + 0x4d7]
jmp 0x509ac9
mov al, byte [edi + 0x46b]
test al, al
jne 0x509ade
and ecx, 0xffffffbf
mov eax, str.schannel:_disabled_automatic_use_of_client_certificate
or ecx, 0x10
mov dword [esp + 0x70], ecx
jmp 0x509ae3
mov eax, str.schannel:_enabled_automatic_use_of_client_certificate
push eax
push edi
call fcn.004f3f50
mov edx, dword [esi + 0x1d4]
add esp, 8
cmp edx, 7
ja case.default.0x509b03
movzx eax, byte [edx + 0x50a368]
jmp dword [eax*4 + 0x50a360]
mov ecx, dword [esi + 0xb8]
cmp ecx, 2
jne 0x509b4d
cmp dword [esi + 0x14c], 0xffffffff
mov eax, ebp
cmovne eax, ebx
cmp dword [eax + esi], ecx
je 0x509b2e
mov edx, dword [esi + 0x214]
jmp 0x509b33
cmp ecx, 2
jne 0x509b4d
cmp dword [esi + 0x14c], 0xffffffff
mov eax, ebp
cmovne eax, ebx
cmp dword [eax + esi], 2
je 0x509b4d
mov ebx, dword [esi + 0x218]
jmp 0x509b53
mov ebx, dword [esi + 0x1d8]
test ebx, ebx
je 0x509b5f
cmp ebx, 0x10000
jne 0x509b64
mov ebx, 0x60000
sar ebx, 0x10
cmp edx, ebx
jg 0x509ba6
mov ecx, dword [esp + 0x60]
add edx, 0xfffffffc
cmp edx, 3
ja case.default.0x509b77
jmp dword [edx*4 + 0x50a370]
or ecx, 0x80
jmp 0x509b94
or ecx, 0x200
jmp 0x509b94
or ecx, 0x800
mov dword [esp + 0x60], ecx
inc edx
lea eax, [edx + 4]
cmp eax, ebx
jle 0x509b72
mov ecx, dword [esi + 0xb8]
mov ebx, 0x1c0
cmp ecx, 2
jne 0x509be1
cmp dword [esi + 0x14c], 0xffffffff
mov eax, ebp
cmovne eax, ebx
cmp dword [eax + esi], ecx
je 0x509be1
mov eax, dword [esi + 0x234]
jmp 0x509be7
push str.schannel:_TLS_1.3_is_not_yet_supported
push edi
call fcn.004f3e80
add esp, 8
mov eax, 0x23
jmp 0x50a347
mov eax, dword [esi + 0x1f4]
test eax, eax
je 0x509c9e
cmp ecx, 2
jne 0x509c0b
cmp dword [esi + 0x14c], 0xffffffff
cmovne ebp, ebx
cmp dword [esi + ebp], ecx
je 0x509c0b
mov esi, dword [esi + 0x234]
jmp 0x509c11
mov esi, dword [esi + 0x1f4]
mov ebp, dword [esp + 0x34]
xor ebx, ebx
mov ebp, dword [ebp + 8]
add ebp, 0x48
test esi, esi
je 0x509c96
cmp byte [esi], 0
je 0x509c96
cmp ebx, 0x2d
jge 0x509c96
push 0
push 0
push esi
call fcn.005bc5f7
add esp, 0xc
test eax, eax
jne 0x509c7b
push esi
call fcn.00508d60
add esp, 4
test eax, eax
jne 0x509c7b
push 0x11
push str.USE_STRONG_CRYPTO
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
je 0x509c71
push 0x15
push str.SCH_USE_STRONG_CRYPTO
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509cea
or dword [esp + 0x70], 0x400000
jmp 0x509c80
mov dword [ebp + ebx*4], eax
inc ebx
push 0x3a
push esi
call fcn.005a95f0
mov esi, eax
add esp, 8
test esi, esi
je 0x509c96
add esi, 1
jne 0x509c21
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x58], ebx
mov eax, dword [edi + 0x414]
test eax, eax
jne 0x509cb4
cmp dword [edi + 0x42c], eax
je 0x50a24b
mov ecx, dword [edi + 0x42c]
xor ebp, ebp
xor ebx, ebx
mov dword [esp + 0x10], ebp
xor esi, esi
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ecx
test ecx, ecx
je 0x509cff
mov eax, dword [ecx]
mov dword [esp + 0x24], eax
mov eax, dword [ecx + 4]
mov dword [esp + 0x20], eax
jmp 0x509ebc
push str.Unable_to_set_ciphers_to_passed_via_SSL_CONN_CONFIG
push edi
call fcn.004f3e80
mov eax, 0x3b
jmp 0x50a344
push eax
call fcn.005c3967
mov esi, eax
add esp, 4
test esi, esi
je 0x50a287
push 0x5c
push esi
call fcn.005a95f0
add esp, 8
mov dword [esp + 0x20], eax
test eax, eax
je 0x509e5f
mov ebx, eax
sub ebx, esi
push ebx
push str.CurrentUser
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509d4a
mov ebp, 0x10000
jmp 0x509e04
push ebx
push str.LocalMachine
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509d67
mov ebp, 0x20000
jmp 0x509e04
push ebx
push str.CurrentService
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509d84
mov ebp, 0x40000
jmp 0x509e04
push ebx
push str.Services
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509d9e
mov ebp, 0x50000
jmp 0x509e04
push ebx
push str.Users
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509db8
mov ebp, 0x60000
jmp 0x509e04
push ebx
push str.CurrentUserGroupPolicy
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509dd2
mov ebp, 0x70000
jmp 0x509e04
push ebx
push str.LocalMachineGroupPolicy
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509dec
mov ebp, 0x80000
jmp 0x509e04
push ebx
push str.LocalMachineEnterprise
push esi
call fcn.005bce70
add esp, 0xc
test eax, eax
jne 0x509e5f
mov ebp, 0x90000
mov eax, dword [esp + 0x20]
inc eax
push 0x5c
push eax
mov dword [esp + 0x28], eax
call fcn.005a95f0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x509e5f
lea eax, [ebx + 1]
mov ecx, eax
mov dword [esp + 0x2c], eax
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x509e30
sub ecx, edx
cmp ecx, 0x28
jne 0x509e5f
push dword [esp + 0x20]
mov byte [ebx], al
call dword [0x6c400c]
mov edx, eax
mov byte [ebx], 0x5c
add esp, 4
mov dword [esp + 0x10], edx
test edx, edx
jne 0x509ea8
lea ebx, [eax + 0x1b]
jmp 0x509e64
mov ebx, 0x3a
mov eax, dword [edi + 0x414]
cmp byte [eax], 0
je 0x509e87
push 0x62b8e8
push eax
call fcn.005072a0
mov ecx, eax
add esp, 8
mov dword [esp + 0x1c], ecx
test ecx, ecx
jne 0x509eaa
push dword [edi + 0x414]
push str.schannel:_Failed_to_get_certificate_location_or_file_for__s
push edi
call fcn.004f3e80
push esi
call fcn.005b77f1
add esp, 0x10
mov eax, ebx
jmp 0x50a347
xor ecx, ecx
xor eax, eax
mov dword [esp + 0x20], eax
test ecx, ecx
je 0x50a140
mov ebx, dword [esp + 0x1c]
mov eax, dword [edi + 0x450]
test eax, eax
je 0x509efd
push 0x5f9f8c
push eax
call fcn.004f82a0
add esp, 8
test eax, eax
jne 0x509efd
cmp dword [esp + 0x28], eax
mov eax, str._memory_blob_
jne 0x509ee9
mov eax, dword [edi + 0x414]
push eax
push str.schannel:_certificate_format_compatibility_error__for__s
push edi
call fcn.004f3e80
add esp, 0xc
jmp 0x50a180
mov eax, dword [esp + 0x28]
test ebx, ebx
jne 0x509f0d
test eax, eax
je 0x50a140
xor ebx, ebx
test eax, eax
je 0x509f1d
mov dword [esp + 0x10], str._memory_blob_
jmp 0x509f27
mov eax, dword [edi + 0x414]
mov dword [esp + 0x10], eax
test esi, esi
je 0x509f34
push esi
call fcn.005b77f1
add esp, 4
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x50a009
push 2
push 0
push esi
call fcn.005b9e8b
add esp, 0xc
test eax, eax
sete cl
mov byte [esp + 0x17], cl
test eax, eax
jne 0x509f6b
push esi
call fcn.005ba484
mov cl, byte [esp + 0x1b]
add esp, 4
mov edx, eax
jmp 0x509f6d
xor edx, edx
mov ebp, dword [esp + 0x20]
xor eax, eax
test edx, edx
movzx ecx, cl
cmovns eax, ecx
cmovns ebp, edx
mov dword [esp + 0x1c], eax
test al, al
je 0x509fb3
push 0
push 0
push esi
call fcn.005b9e8b
add esp, 0xc
test eax, eax
sete al
mov dword [esp + 0x1c], eax
test al, al
je 0x509fb3
lea eax, [ebp + 1]
push eax
call dword [section..data]
add esp, 4
mov dword [esp + 0x24], eax
jmp 0x509fb7
mov eax, dword [esp + 0x24]
test eax, eax
je 0x509fcd
push esi
push 1
push ebp
push eax
call fcn.005ba65b
add esp, 0x10
cmp eax, 1
je 0x509fd1
mov byte [esp + 0x1c], bl
push esi
call fcn.005b90c0
add esp, 4
cmp byte [esp + 0x1c], bl
jne 0x50a00d
push dword [edi + 0x414]
push str.schannel:_Failed_to_read_cert_file__s
push edi
call fcn.004f3e80
mov eax, dword [esp + 0x30]
push eax
call dword [0x6c4004]
add esp, 0x10
mov eax, 0x3a
jmp 0x50a347
mov ebp, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x30], eax
mov eax, dword [edi + 0x460]
mov dword [esp + 0x2c], ebp
test eax, eax
je 0x50a031
mov ebx, eax
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x50a028
sub ebx, ecx
lea eax, [ebx*2 + 2]
push eax
call dword [section..data]
mov esi, eax
add esp, 4
test esi, esi
je 0x50a098
test ebx, ebx
je 0x50a08a
lea ecx, [ebx + 1]
push ecx
push esi
push ebx
push dword [edi + 0x460]
push 8
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jns 0x50a08c
xor eax, eax
mov word [esi], ax
push 0
push esi
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.CRYPT32.dll_PFXImportCertStore]
push esi
mov ebx, eax
call dword [0x6c4004]
add esp, 4
jmp 0x50a09a
xor eax, eax
cmp eax, ebx
jg 0x50a069
xor ecx, ecx
mov word [esi + eax*2], cx
jmp 0x50a06e
xor ebx, ebx
cmp dword [esp + 0x28], 0
jne 0x50a0ae
push dword [esp + 0x24]
call dword [0x6c4004]
add esp, 4
test ebx, ebx
jne 0x50a0f4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x56
jne 0x50a0d7
push dword [esp + 0x10]
push str.schannel:_Failed_to_import_cert_file__s__password_is_bad
push edi
call fcn.004f3e80
add esp, 0xc
lea eax, [ebx + 0x3a]
jmp 0x50a347
push eax
push dword [esp + 0x14]
push str.schannel:_Failed_to_import_cert_file__s__last_error_is_0x_x
push edi
call fcn.004f3e80
add esp, 0x10
mov eax, 0x3a
jmp 0x50a347
push 0
push 0
push 0
push 0
push 0x10001
push ebx
call dword [sym.imp.CRYPT32.dll_CertFindCertificateInStore]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x50a232
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [esp + 0x14]
push str.schannel:_Failed_to_get_certificate_from_file__s__last_error_is_0x_x
push edi
call fcn.004f3e80
add esp, 0x10
push 0
push ebx
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
mov eax, 0x3a
jmp 0x50a347
push dword [esp + 0x10]
mov eax, ebp
or eax, 0x4000
push eax
push 0
push 0
push 9
call dword [sym.imp.CRYPT32.dll_CertOpenStore]
mov ebx, eax
test ebx, ebx
jne 0x50a197
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [esp + 0x10]
push eax
push ebx
push ebp
push str.schannel:_Failed_to_open_cert_store__x__s__last_error_is_0x_x
push edi
call fcn.004f3e80
push ebx
call dword [0x6c4004]
add esp, 0x18
test esi, esi
je 0x50a18d
push esi
call fcn.005b77f1
add esp, 4
mov eax, 0x3a
jmp 0x50a347
push dword [esp + 0x10]
call dword [0x6c4004]
add esp, 4
mov dword [esp + 0x38], 0x14
lea eax, [esp + 0x78]
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x38]
push 0
push 0
push eax
lea eax, [esp + 0x84]
push eax
push 4
push 0x28
push dword [esp + 0x44]
call dword [sym.imp.CRYPT32.dll_CryptStringToBinaryA]
test eax, eax
jne 0x50a1fb
test esi, esi
je 0x50a12d
push esi
call fcn.005b77f1
add esp, 4
push 0
push ebx
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
mov eax, 0x3a
jmp 0x50a347
push 0
lea eax, [esp + 0x3c]
push eax
push 0x10000
push 0
push 0x10001
push ebx
call dword [sym.imp.CRYPT32.dll_CertFindCertificateInStore]
mov dword [esp + 0x18], eax
test esi, esi
je 0x50a22a
push esi
call fcn.005b77f1
mov eax, dword [esp + 0x1c]
add esp, 4
test eax, eax
je 0x50a12d
push 0
lea eax, [esp + 0x1c]
mov dword [esp + 0x48], 1
push ebx
mov dword [esp + 0x50], eax
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
push 0x18
push 1
call dword [0x6c4010]
mov ebx, dword [esp + 0x3c]
add esp, 8
mov ecx, dword [ebx + 8]
mov dword [ecx], eax
mov eax, dword [ebx + 8]
mov eax, dword [eax]
test eax, eax
jne 0x50a291
push str.schannel:_unable_to_allocate_memory
push edi
call fcn.004f3e80
mov eax, dword [esp + 0x20]
add esp, 8
test eax, eax
je 0x50a287
push eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
mov eax, 0x1b
jmp 0x50a347
mov dword [eax + 0x10], 1
mov eax, dword [ebx + 8]
mov ecx, dword [eax]
lea eax, [ecx + 8]
push eax
push ecx
push 0
push 0
lea eax, [esp + 0x50]
push eax
mov eax, dword [0x6ca554]
push 0
push 2
push str.Microsoft_Unified_Security_Protocol_Provider
mov eax, dword [eax + 0xc]
push 0
call eax
mov ecx, dword [esp + 0x18]
mov esi, eax
test ecx, ecx
je 0x50a2d1
push ecx
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test esi, esi
je 0x50a31e
push 0x100
lea eax, [esp + 0x90]
push eax
push esi
call fcn.005062f0
push eax
push str.schannel:_AcquireCredentialsHandle_failed:__s
push edi
call fcn.004f3e80
mov eax, dword [ebx + 8]
push dword [eax]
call dword [0x6c4004]
mov eax, dword [ebx + 8]
add esp, 0x1c
mov dword [eax], 0
cmp esi, 0x80090300
je 0x50a287
mov eax, 0x23
jmp 0x50a347
xor eax, eax
jmp 0x50a347
push str.SSL_versions_not_supported
push edi
call fcn.004f3e80
mov eax, 4
jmp 0x50a344
push str.Unrecognized_parameter_passed_via_CURLOPT_SSLVERSION
push edi
call fcn.004f3e80
mov eax, 0x23
add esp, 8
mov ecx, dword [esp + 0x18c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00590be8
add esp, 0x180
ret