Function at 0x4f1b40
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x5b86f8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push ebp
push esi
push edi
mov ebx, ecx
push 0x636620
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor edi, edi
lea ecx, [esp + 0x10]
mov dword [esp + 0x18], edi
call sub.MFC42.DLL_CString::CString_1
mov dword [esp + 0x38], edi
mov dword [esp + 0x1c], 1
mov dword [esp + 0x14], edi
call sub.SSLEAY32.dll_Ordinal_183
mov eax, dword [esp + 0x40]
push eax
call sub.SSLEAY32.dll_Ordinal_12
add esp, 4
cmp eax, edi
mov dword [ebx + 0x1c], eax
jne 0x4f1bd5
mov edi, str.Create_ctx_error
or ecx, 0xffffffff
xor eax, eax
push 0x636620
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x68]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4f1df4
push edi
push 0xfff
push 0x20
push eax
call sub.SSLEAY32.dll_Ordinal_6
mov ebp, dword [esp + 0x74]
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x5c]
add esp, 0x10
push ebp
push edi
push eax
push ecx
mov ecx, ebx
call sym.ETermProxy.exe_protected:_struct_evp_pkey_st____thiscall_CSslClientSocket::LoadKey_char___int__char___char__
cmp eax, edi
mov dword [esp + 0x40], eax
jne 0x4f1c1c
push str.unable_to_load_CA_private_key_n
push ebp
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 8
mov dword [ebx + 0x1c], edi
jmp 0x4f1dcb
mov edx, dword [ebx + 0x1c]
push eax
push edx
call sub.SSLEAY32.dll_Ordinal_22
add esp, 8
test eax, eax
jne 0x4f1c65
mov edi, str.adds_private_key_to_ctx_error
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x1c]
push ecx
call sub.SSLEAY32.dll_Ordinal_8
add esp, 4
mov dword [ebx + 0x1c], 0
jmp 0x4f1dcb
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x44]
push ebp
push edx
push eax
mov ecx, ebx
call sym.ETermProxy.exe_protected:_struct_x509_st____thiscall_CSslClientSocket::LoadCert_char___int__char__
cmp eax, edi
mov dword [esp + 0x18], eax
jne 0x4f1c9f
push str.unable_to_load_CA_certificate_n
push ebp
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ecx, dword [ebx + 0x1c]
push ecx
call sub.SSLEAY32.dll_Ordinal_8
add esp, 0xc
mov dword [ebx + 0x1c], edi
jmp 0x4f1dcb
mov edx, dword [ebx + 0x1c]
push eax
push edx
call sub.SSLEAY32.dll_Ordinal_28
add esp, 8
test eax, eax
jne 0x4f1ce8
mov edi, str.loads_certificate_into_ctx_error
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x1c]
push ecx
call sub.SSLEAY32.dll_Ordinal_8
add esp, 4
mov dword [ebx + 0x1c], 0
jmp 0x4f1dcb
mov edx, dword [ebx + 0x1c]
push edx
call sub.SSLEAY32.dll_Ordinal_5
add esp, 4
test eax, eax
jne 0x4f1d30
mov edi, str.Private_key_does_not_match_the_certificate_public_key
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x1c]
push ecx
call sub.SSLEAY32.dll_Ordinal_8
add esp, 4
mov dword [ebx + 0x1c], 0
jmp 0x4f1dcb
mov esi, dword [esp + 0x54]
mov edx, dword [ebx + 0x1c]
push edi
push esi
push edx
call sub.SSLEAY32.dll_Ordinal_141
add esp, 0xc
test eax, eax
jne 0x4f1d7b
mov edi, str.Couldnt_read_CA_list
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x1c]
push ecx
call sub.SSLEAY32.dll_Ordinal_8
add esp, 4
mov dword [ebx + 0x1c], 0
jmp 0x4f1dcb
mov edx, dword [ebx + 0x1c]
push 1
push edx
call sub.SSLEAY32.dll_Ordinal_225
push esi
call sub.SSLEAY32.dll_Ordinal_73
push eax
mov eax, dword [ebx + 0x1c]
push eax
call sub.SSLEAY32.dll_Ordinal_16
mov ecx, dword [ebx + 0x1c]
push ecx
call sub.SSLEAY32.dll_Ordinal_75
add esp, 0x18
cmp eax, edi
mov dword [ebx + 0x14], eax
jne 0x4f1e0c
mov edi, str.Make_SSL_Error
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x636620
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x40]
push eax
call sub.LIBEAY32.dll_Ordinal_281
mov ecx, dword [esp + 0x1c]
push ecx
call sub.LIBEAY32.dll_Ordinal_641
add esp, 8
mov ecx, ebx
call sym.ETermProxy.exe_public:_void___thiscall_CSslClientSocket::SSlShouDown_void_
lea ecx, [esp + 0x10]
mov dword [esp + 0x38], 0xffffffff
call sub.MFC42.DLL_CString::CString
xor eax, eax
jmp 0x4f1fd4
push 0x636620
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esp + 0x5c]
push edx
call sub.WSOCK32.dll_gethostbyname
cmp eax, edi
jne 0x4f1e49
mov edi, str.Couldnt_resolve_host
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4f1df4
xor ecx, ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], ecx
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov edx, dword [esp + 0x60]
push edx
mov ecx, dword [eax]
mov word [esp + 0x24], 2
mov dword [esp + 0x28], ecx
call sub.WSOCK32.dll_htons
push 6
push 1
push 2
mov word [esp + 0x2e], ax
call sub.WSOCK32.dll_socket
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x4f1eb6
or ecx, eax
mov edi, str.create_socket_error
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x64]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4f1df4
mov eax, dword [ebx + 0x18]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x4f1efd
push eax
push 0
push ebp
call fcn.004f1ad0
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
jge 0x4f1efd
mov edi, str.bind_error
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x64]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4f1df4
lea eax, [esp + 0x14]
push 4
push eax
push 8
push 0xffff
push ebp
call sub.WSOCK32.dll_setsockopt
test eax, eax
mov dword [esp + 0x14], eax
jge 0x4f1f20
mov edi, str.setsockopt_error
jmp 0x4f1ed9
lea eax, [esp + 0x20]
push 0x10
push eax
push ebp
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x4f1f47
push 2
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
mov edi, str.connect_error
jmp 0x4f1ed9
lea eax, [esp + 0x1c]
push eax
push 0x8004667e
push ebp
call sub.LIBEAY32.dll_Ordinal_108_1
add esp, 0xc
test eax, eax
jge 0x4f1f95
mov edi, str.io_set_error
or ecx, 0xffffffff
xor eax, eax
push 2
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebp
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x6c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
jmp 0x4f1ded
push 0
push ebp
call sub.LIBEAY32.dll_Ordinal_84
push eax
push eax
mov eax, dword [ebx + 0x14]
push eax
call sub.SSLEAY32.dll_Ordinal_83
mov ecx, dword [ebx + 0x14]
push ecx
call sub.SSLEAY32.dll_Ordinal_86
add esp, 0x18
mov ecx, ebx
push 0x20
push ebp
call sub.MFC42.DLL_CAsyncSocket::Attach
lea ecx, [esp + 0x10]
mov dword [esp + 0x38], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, 1
mov ecx, dword [esp + 0x30]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2c
ret 0x28