Function at 0x510220
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Set socket configuration

Disassembly:
mov eax, 4
call fcn.0058b100
push ebx
push ebp
mov ebp, dword [esp + 0x10]
or ebx, 0xffffffff
push esi
push edi
mov edi, dword [esp + 0x1c]
xor esi, esi
mov eax, dword [edi + 0x28]
test eax, eax
cmovne esi, eax
mov dword [esp + 0x10], esi
mov eax, dword [edi]
dec eax
cmp eax, 7
ja case.default.0x510258
mov ecx, 2
jmp dword [eax*4 + 0x510660]
mov esi, dword [edi + 4]
test esi, esi
je 0x510502
cmp byte [esi], 0
je 0x510280
nop
mov al, byte [esi]
cmp al, 0x3a
je 0x510280
cmp al, 0x2f
je 0x510280
inc esi
cmp byte [esi], 0
jne 0x510270
movsx eax, byte [esi]
mov dword [esp + 0x1c], eax
cmp eax, 0x3a
je 0x510291
cmp eax, 0x2f
jne 0x5102cf
mov byte [esi], 0
inc esi
cmp dword [esp + 0x1c], 0x3a
jne 0x5102cf
cmp byte [esi], 0
mov eax, esi
je 0x5102b3
cmp byte [eax], 0x2f
je 0x5102b0
inc eax
cmp byte [eax], 0
jne 0x5102a3
jmp 0x5102b3
mov byte [eax], 0
mov eax, dword [edi + 8]
test eax, eax
je 0x5102c3
push eax
call fcn.004d51b0
add esp, 4
push esi
call fcn.00504910
add esp, 4
mov dword [edi + 8], eax
cmp dword [edi + 8], 0
je 0x5104d2
mov esi, dword [esp + 0x10]
mov dword [edi], 2
jmp 0x5104af
lea eax, [edi + 0x10]
push eax
push dword [edi + 4]
call fcn.00543ae0
add esp, 8
test eax, eax
jle case.default.0x510258
mov dword [edi], 3
jmp 0x5104af
mov ecx, dword [edi + 8]
test ecx, ecx
je case.default.0x510258
lea eax, [edi + 0x14]
push eax
push ecx
call fcn.00543c00
add esp, 8
test eax, eax
jle case.default.0x510258
mov dword [edi], 4
jmp 0x5104af
xorps xmm0, xmm0
movups xmmword [edi + 0x18], xmm0
movzx eax, word [edi + 0x14]
push eax
mov word [edi + 0x18], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [edi + 0x1a], ax
movzx ecx, byte [edi + 0x10]
movzx eax, byte [edi + 0x11]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 0x12]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 0x13]
shl ecx, 8
or ecx, eax
push ecx
call dword [sym.imp.WS2_32.dll_htonl]
push 6
push 1
push 2
mov dword [edi + 0x1c], eax
mov dword [edi], 4
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x510523
mov dword [ebp + 0x1c], ebx
mov dword [edi], 8
jmp 0x5104af
cmp dword [edi + 0xc], 0
je 0x5103be
push 1
push dword [ebp + 0x1c]
call fcn.00543f50
add esp, 8
test eax, eax
je 0x510571
push 4
lea eax, [esp + 0x20]
mov dword [edi], 5
push eax
push 8
push 0xffff
push dword [ebp + 0x1c]
mov dword [esp + 0x30], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [esp + 0x1c], eax
test eax, eax
jns 0x5104af
push 0xe2
push str..crypto_bio_bss_conn.c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 4
push 2
call fcn.004ee870
push dword [edi + 8]
push str.:_
push dword [edi + 4]
push str.host
push 4
call fcn.004edeb0
push 0xe5
push str..crypto_bio_bss_conn.c
push 0x6d
push 0x73
push 0x20
call fcn.004ee870
add esp, 0x3c
jmp case.default.0x510258
push 0xf
push ebp
call fcn.004d54d0
add esp, 8
lea eax, [edi + 0x18]
push 0x10
push eax
push dword [ebp + 0x1c]
call dword [sym.imp.WS2_32.dll_connect]
mov ebx, eax
mov dword [ebp + 0x18], 0
test ebx, ebx
jns 0x5104a9
push ebx
call fcn.00504e90
add esp, 4
test eax, eax
je 0x5105a5
push 0xc
push ebp
call fcn.004d5bc0
mov dword [edi], 7
add esp, 8
mov dword [ebp + 0x18], 2
jmp case.default.0x510258
push dword [ebp + 0x1c]
call fcn.00543e80
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x5105f0
mov dword [edi], 6
test esi, esi
je 0x510247
push ebx
push dword [edi]
push ebp
call esi
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x510247
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
push 0xa4
push str..crypto_bio_bss_conn.c
push 0x72
push 0x73
push 0x20
call fcn.004ee870
push dword [edi + 4]
push str.host
push 2
call fcn.004edeb0
mov esi, dword [esp + 0x30]
add esp, 0x20
jmp case.default.0x510258
push 0x8b
push str..crypto_bio_bss_conn.c
push 0x70
push 0x73
push 0x20
call fcn.004ee870
mov esi, dword [esp + 0x24]
add esp, 0x14
jmp case.default.0x510258
push 0xc8
push str..crypto_bio_bss_conn.c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 4
push 2
call fcn.004ee870
push dword [edi + 8]
push str.:_
push dword [edi + 4]
push str.host
push 4
call fcn.004edeb0
push 0xcb
push str..crypto_bio_bss_conn.c
push 0x76
push 0x73
push 0x20
call fcn.004ee870
add esp, 0x3c
jmp case.default.0x510258
push 0xd5
push str..crypto_bio_bss_conn.c
push 0x68
push 0x73
push 0x20
call fcn.004ee870
push dword [edi + 8]
push str.:_
push dword [edi + 4]
push str.host
push 4
call fcn.004edeb0
add esp, 0x28
jmp case.default.0x510258
push 0xf6
push str..crypto_bio_bss_conn.c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 2
push 2
call fcn.004ee870
push dword [edi + 8]
push str.:_
push dword [edi + 4]
push str.host
push 4
call fcn.004edeb0
push 0xf9
push str..crypto_bio_bss_conn.c
push 0x67
push 0x73
push 0x20
call fcn.004ee870
add esp, 0x3c
jmp case.default.0x510258
push 0xf
push ebp
call fcn.004d54d0
push 0x104
push str..crypto_bio_bss_conn.c
push dword [esp + 0x2c]
push 2
push 2
call fcn.004ee870
push dword [edi + 8]
push str.:_
push dword [edi + 4]
push str.host
push 4
call fcn.004edeb0
push 0x107
push str..crypto_bio_bss_conn.c
push 0x6e
push 0x73
push 0x20
call fcn.004ee870
add esp, 0x44
xor ebx, ebx
jmp case.default.0x510258
mov ebx, 1
test esi, esi
je 0x5104ca
push ebx
push dword [edi]
push ebp
call esi
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret