Function at 0x50c22a
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28c
mov eax, dword [0x5b31c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x14]
mov ebx, ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x278], edx
mov dword [ebp - 0x288], ebx
mov eax, dword [edi + eax*4 + 0x130]
mov esi, dword [edi]
lea edx, [ecx + 1]
mov dword [ebp - 0x264], eax
xor eax, eax
cmp dword [edi + 0x114], 5
mov dword [ebp - 0x27c], ecx
sete al
mov dword [ebp - 0x280], edi
mov dword [ebp - 0x274], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x50c287
sub ecx, edx
cmp dword [ebp - 0x274], 0
mov dword [ebp - 0x284], ecx
jne 0x50c2c0
cmp ecx, 0xff
jbe 0x50c2c0
push ecx
push str.SOCKS5:_server_resolving_disabled_for_hostnames_of_length___255__actual_len_zu__n
push esi
call fcn.00500cc1
add esp, 0xc
mov dword [ebp - 0x274], 1
push 1
xor edx, edx
mov ecx, esi
call fcn.004ff1e0
mov dword [ebp - 0x268], eax
pop ecx
test eax, eax
jns 0x50c2ea
push str.Connection_time_out
push esi
call fcn.00500d35
pop ecx
pop ecx
push 0x1c
jmp 0x50c9dd
lea eax, [ebp - 0x26c]
mov dword [ebp - 0x26c], 1
push eax
push 0x8004667e
push dword [ebp - 0x264]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebp - 0x268]
or edx, 0xffffffff
or ecx, 0xffffffff
push dword [ebp - 0x264]
call fcn.00507d77
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x50c336
push str.SOCKS5:_no_connection_here
push dword [edi]
jmp 0x50c9d4
test eax, eax
jne 0x50c343
push str.SOCKS5:_connection_timeout
push dword [edi]
jmp 0x50c2dc
test al, 4
je 0x50c34e
push str.SOCKS5:_error_occurred_during_connection
jmp 0x50c32f
test ebx, ebx
mov byte [ebp - 0x260], 5
mov word [ebp - 0x25e], 0x200
setne al
and dword [ebp - 0x26c], 0
inc al
mov byte [ebp - 0x25f], al
lea eax, [ebp - 0x26c]
push eax
push 0x8004667e
push dword [ebp - 0x264]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov edx, dword [ebp - 0x264]
lea eax, [ebp - 0x26c]
push eax
movzx eax, byte [ebp - 0x25f]
mov ecx, edi
add eax, 2
push eax
lea eax, [ebp - 0x260]
push eax
call fcn.00500f52
add esp, 0xc
test eax, eax
jne 0x50c9ce
movzx eax, byte [ebp - 0x25f]
add eax, 2
cmp dword [ebp - 0x26c], eax
jne 0x50c9ce
lea eax, [ebp - 0x270]
mov dword [ebp - 0x270], 1
push eax
push 0x8004667e
push dword [ebp - 0x264]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebp - 0x268]
mov ecx, dword [ebp - 0x264]
or edx, 0xffffffff
push 0xffffffffffffffff
call fcn.00507d77
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x50c41a
push str.SOCKS5_nothing_to_read
jmp 0x50c32f
test eax, eax
jne 0x50c428
push str.SOCKS5_read_timeout
jmp 0x50c33f
test al, 4
je 0x50c441
push str.SOCKS5_read_error_occurred
push dword [edi]
call fcn.00500d35
pop ecx
pop ecx
push 0x38
jmp 0x50c9dd
and dword [ebp - 0x268], 0
lea eax, [ebp - 0x268]
push eax
push 0x8004667e
push dword [ebp - 0x264]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov edx, dword [ebp - 0x264]
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0x260]
mov ecx, edi
push 2
push eax
call fcn.0050bd1e
add esp, 0xc
test eax, eax
jne 0x50c9c7
cmp dword [ebp - 0x270], 2
jne 0x50c9c7
cmp byte [ebp - 0x260], 5
je 0x50c4a8
push str.Received_invalid_version_in_initial_SOCKS5_response.
jmp 0x50c9d3
mov al, byte [ebp - 0x25f]
test al, al
je 0x50c639
cmp al, 2
jne 0x50c600
test ebx, ebx
je 0x50c4ee
mov edx, dword [ebp - 0x278]
test edx, edx
je 0x50c4ee
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x50c4cf
sub ebx, ecx
mov ecx, edx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x50c4dd
sub ecx, edx
mov dword [ebp - 0x268], ecx
jmp 0x50c4f6
xor ebx, ebx
and dword [ebp - 0x268], ebx
mov eax, dword [ebp - 0x288]
mov byte [ebp - 0x260], 1
mov byte [ebp - 0x25f], bl
test eax, eax
je 0x50c522
test ebx, ebx
je 0x50c522
push ebx
push eax
lea eax, [ebp - 0x25e]
push eax
call sub.MSVCR120.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0x278]
lea eax, [ebx + 2]
mov ebx, dword [ebp - 0x268]
mov byte [ebp + eax - 0x260], bl
inc eax
mov dword [ebp - 0x268], eax
test ecx, ecx
je 0x50c55f
test ebx, ebx
je 0x50c55f
push ebx
push ecx
lea eax, [ebp + eax - 0x260]
push eax
call sub.MSVCR120.dll_memcpy
mov eax, dword [ebp - 0x268]
add esp, 0xc
add eax, ebx
lea ecx, [ebp - 0x26c]
mov ebx, dword [ebp - 0x264]
mov edx, ebx
push ecx
push eax
mov dword [ebp - 0x268], eax
mov ecx, edi
lea eax, [ebp - 0x260]
push eax
call fcn.00500f52
add esp, 0xc
test eax, eax
jne 0x50c5f6
mov eax, dword [ebp - 0x268]
cmp eax, dword [ebp - 0x26c]
jne 0x50c5f6
lea eax, [ebp - 0x270]
mov edx, ebx
push eax
lea eax, [ebp - 0x260]
mov ecx, edi
push 2
push eax
call fcn.0050bd1e
add esp, 0xc
test eax, eax
jne 0x50c5ec
cmp dword [ebp - 0x270], 2
jne 0x50c5ec
mov al, byte [ebp - 0x25f]
test al, al
je 0x50c639
movzx eax, al
push eax
movzx eax, byte [ebp - 0x260]
push eax
push str.User_was_rejected_by_the_SOCKS5_server___d__d_.
push esi
call fcn.00500d35
add esp, 0x10
jmp 0x50c9db
push str.Unable_to_receive_SOCKS5_sub_negotiation_response.
jmp 0x50c9d3
push str.Failed_to_send_SOCKS5_sub_negotiation_request.
jmp 0x50c9d3
cmp al, 1
jne 0x50c60e
push str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
jmp 0x50c9d3
cmp al, 0xff
jne 0x50c62f
test ebx, ebx
je 0x50c625
cmp byte [ebx], 0
je 0x50c625
push str.No_authentication_method_was_acceptable.
jmp 0x50c9d3
push str.No_authentication_method_was_acceptable.__It_is_quite_likely_that_the_SOCKS5_server_wanted_a_username_password__since_none_was_supplied_to_the_server_on_this_connection._
jmp 0x50c9d3
push str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
jmp 0x50c9d3
cmp dword [ebp - 0x274], 0
push 3
mov word [ebp - 0x260], 0x105
pop ebx
mov byte [ebp - 0x25e], 0
jne 0x50c685
mov byte [ebp - 0x25d], bl
lea eax, [ebp - 0x25b]
mov ebx, dword [ebp - 0x284]
push ebx
push dword [ebp - 0x27c]
mov byte [ebp - 0x25c], bl
push eax
call sub.MSVCR120.dll_memcpy
add esp, 0xc
add ebx, 5
jmp 0x50c75d
mov edx, dword [ebp - 0x27c]
lea eax, [ebp - 0x274]
push eax
push dword [ebp + 0xc]
mov ecx, edi
call fcn.0050036f
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x50c6aa
push 6
jmp 0x50c9dd
cmp eax, 1
jne 0x50c6c4
lea edx, [ebp - 0x274]
mov ecx, edi
call fcn.00500a48
test eax, eax
jne 0x50c9de
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x50c9ae
mov eax, dword [eax]
mov dword [ebp - 0x278], eax
test eax, eax
je 0x50c9ae
cmp dword [eax + 4], 2
jne 0x50c73c
mov byte [ebp - 0x25d], 1
lea ecx, [ebp - 0x25d]
mov edi, dword [eax + 0x18]
lea eax, [ebp - 0x25c]
push 4
pop ebx
sub edi, eax
lea eax, [ebx + edi]
mov al, byte [ebp + eax - 0x25c]
mov byte [ebp + ebx - 0x260], al
inc ebx
movzx eax, byte [ebx + ecx - 4]
push eax
push 0x58ac9c
push esi
call fcn.00500cc1
add esp, 0xc
lea ecx, [ebp - 0x25d]
cmp ebx, 8
jl 0x50c703
mov edi, dword [ebp - 0x280]
jmp 0x50c743
and dword [ebp - 0x278], 0
mov edx, dword [ebp - 0x274]
mov ecx, esi
call fcn.005004ce
cmp dword [ebp - 0x278], 0
je 0x50c9ae
mov ecx, dword [ebp + 0xc]
mov eax, ecx
mov edx, dword [ebp - 0x264]
sar eax, 8
mov byte [ebp + ebx - 0x260], al
lea eax, [ebp - 0x26c]
mov byte [ebp + ebx - 0x25f], cl
add ebx, 2
push eax
lea eax, [ebp - 0x260]
mov ecx, edi
push ebx
push eax
call fcn.00500f52
add esp, 0xc
test eax, eax
jne 0x50c9a7
cmp ebx, dword [ebp - 0x26c]
jne 0x50c9a7
mov edx, dword [ebp - 0x264]
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0x260]
mov ecx, edi
push 0xa
push eax
call fcn.0050bd1e
add esp, 0xc
test eax, eax
jne 0x50c97a
cmp dword [ebp - 0x270], 0xa
jne 0x50c97a
cmp byte [ebp - 0x260], 5
je 0x50c7f1
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
jmp 0x50c9d3
mov bl, byte [ebp - 0x25f]
mov al, byte [ebp - 0x25d]
test bl, bl
je 0x50c930
cmp al, 1
jne 0x50c854
movzx ecx, byte [ebp - 0x258]
movzx eax, bl
push eax
movzx eax, byte [ebp - 0x257]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x259]
push ecx
push eax
movzx eax, byte [ebp - 0x25a]
push eax
movzx eax, byte [ebp - 0x25b]
push eax
movzx eax, byte [ebp - 0x25c]
push eax
push str.Cant_complete_SOCKS5_connection_to__d._d._d._d:_d.___d_
push esi
call fcn.00500d35
add esp, 0x20
jmp 0x50c9db
cmp al, 3
jne 0x50c889
movzx ecx, byte [ebp - 0x258]
movzx eax, bl
push eax
movzx eax, byte [ebp - 0x257]
shl ecx, 8
or ecx, eax
push ecx
push dword [ebp - 0x27c]
push str.Cant_complete_SOCKS5_connection_to__s:_d.___d_
push esi
call fcn.00500d35
add esp, 0x14
jmp 0x50c9db
cmp al, 4
jne 0x50c9db
movzx edx, byte [ebp - 0x258]
movzx ecx, byte [ebp - 0x257]
movzx eax, bl
push eax
mov eax, edx
shl eax, 8
or eax, ecx
push eax
movzx eax, byte [ebp - 0x24d]
push eax
movzx eax, byte [ebp - 0x24e]
push eax
movzx eax, byte [ebp - 0x24f]
push eax
movzx eax, byte [ebp - 0x250]
push eax
movzx eax, byte [ebp - 0x251]
push eax
movzx eax, byte [ebp - 0x252]
push eax
movzx eax, byte [ebp - 0x253]
push eax
movzx eax, byte [ebp - 0x254]
push eax
movzx eax, byte [ebp - 0x255]
push eax
movzx eax, byte [ebp - 0x256]
push eax
movzx eax, byte [ebp - 0x259]
push ecx
push edx
push eax
movzx eax, byte [ebp - 0x25a]
push eax
movzx eax, byte [ebp - 0x25b]
push eax
movzx eax, byte [ebp - 0x25c]
push eax
push str.Cant_complete_SOCKS5_connection_to__02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_d.___d_
push esi
call fcn.00500d35
add esp, 0x50
jmp 0x50c9db
cmp al, 3
jne 0x50c940
movzx ebx, byte [ebp - 0x25c]
add ebx, 7
jmp 0x50c947
cmp al, 4
jne 0x50c981
push 0x16
pop ebx
cmp ebx, 0xa
jle 0x50c981
mov edx, dword [ebp - 0x264]
lea eax, [ebp - 0x270]
push eax
sub ebx, 0xa
lea eax, [ebp - 0x256]
push ebx
push eax
mov ecx, edi
call fcn.0050bd1e
add esp, 0xc
test eax, eax
jne 0x50c97a
cmp ebx, dword [ebp - 0x270]
je 0x50c981
push str.Failed_to_receive_SOCKS5_connect_request_ack.
jmp 0x50c9d3
lea eax, [ebp - 0x280]
mov dword [ebp - 0x280], 1
push eax
push 0x8004667e
push dword [ebp - 0x264]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x50c9de
push str.Failed_to_send_SOCKS5_connect_request.
jmp 0x50c9d3
push dword [ebp - 0x27c]
push str.Failed_to_resolve___s__for_SOCKS5_connect.
push esi
call fcn.00500d35
add esp, 0xc
jmp 0x50c6a3
push str.Unable_to_receive_initial_SOCKS5_response.
jmp 0x50c9d3
push str.Unable_to_send_initial_SOCKS5_request.
push esi
call fcn.00500d35
pop ecx
pop ecx
push 7
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0054e63c
mov esp, ebp
pop ebp
ret