Function at 0x51e482
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28c
mov eax, dword [0x5ca1c8]
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 0x51e4df
sub ecx, edx
cmp dword [ebp - 0x274], 0
mov dword [ebp - 0x284], ecx
jne 0x51e518
cmp ecx, 0xff
jbe 0x51e518
push ecx
push str.SOCKS5:_server_resolving_disabled_for_hostnames_of_length___255__actual_len_zu__n
push esi
call fcn.00512948
add esp, 0xc
mov dword [ebp - 0x274], 1
push 1
xor edx, edx
mov ecx, esi
call fcn.00510e54
mov dword [ebp - 0x268], eax
pop ecx
test eax, eax
jns 0x51e542
push str.Connection_time_out
push esi
call fcn.005129bc
pop ecx
pop ecx
push 0x1c
jmp 0x51ec35
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.0051a064
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x51e58e
push str.SOCKS5:_no_connection_here
push dword [edi]
jmp 0x51ec2c
test eax, eax
jne 0x51e59b
push str.SOCKS5:_connection_timeout
push dword [edi]
jmp 0x51e534
test al, 4
je 0x51e5a6
push str.SOCKS5:_error_occurred_during_connection
jmp 0x51e587
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.00512bd9
add esp, 0xc
test eax, eax
jne 0x51ec26
movzx eax, byte [ebp - 0x25f]
add eax, 2
cmp dword [ebp - 0x26c], eax
jne 0x51ec26
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.0051a064
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x51e672
push str.SOCKS5_nothing_to_read
jmp 0x51e587
test eax, eax
jne 0x51e680
push str.SOCKS5_read_timeout
jmp 0x51e597
test al, 4
je 0x51e699
push str.SOCKS5_read_error_occurred
push dword [edi]
call fcn.005129bc
pop ecx
pop ecx
push 0x38
jmp 0x51ec35
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.0051df76
add esp, 0xc
test eax, eax
jne 0x51ec1f
cmp dword [ebp - 0x270], 2
jne 0x51ec1f
cmp byte [ebp - 0x260], 5
je 0x51e700
push str.Received_invalid_version_in_initial_SOCKS5_response.
jmp 0x51ec2b
mov al, byte [ebp - 0x25f]
test al, al
je 0x51e891
cmp al, 2
jne 0x51e858
test ebx, ebx
je 0x51e746
mov edx, dword [ebp - 0x278]
test edx, edx
je 0x51e746
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x51e727
sub ebx, ecx
mov ecx, edx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x51e735
sub ecx, edx
mov dword [ebp - 0x268], ecx
jmp 0x51e74e
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 0x51e77a
test ebx, ebx
je 0x51e77a
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 0x51e7b7
test ebx, ebx
je 0x51e7b7
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.00512bd9
add esp, 0xc
test eax, eax
jne 0x51e84e
mov eax, dword [ebp - 0x268]
cmp eax, dword [ebp - 0x26c]
jne 0x51e84e
lea eax, [ebp - 0x270]
mov edx, ebx
push eax
lea eax, [ebp - 0x260]
mov ecx, edi
push 2
push eax
call fcn.0051df76
add esp, 0xc
test eax, eax
jne 0x51e844
cmp dword [ebp - 0x270], 2
jne 0x51e844
mov al, byte [ebp - 0x25f]
test al, al
je 0x51e891
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.005129bc
add esp, 0x10
jmp 0x51ec33
push str.Unable_to_receive_SOCKS5_sub_negotiation_response.
jmp 0x51ec2b
push str.Failed_to_send_SOCKS5_sub_negotiation_request.
jmp 0x51ec2b
cmp al, 1
jne 0x51e866
push str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
jmp 0x51ec2b
cmp al, 0xff
jne 0x51e887
test ebx, ebx
je 0x51e87d
cmp byte [ebx], 0
je 0x51e87d
push str.No_authentication_method_was_acceptable.
jmp 0x51ec2b
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 0x51ec2b
push str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
jmp 0x51ec2b
cmp dword [ebp - 0x274], 0
push 3
mov word [ebp - 0x260], 0x105
pop ebx
mov byte [ebp - 0x25e], 0
jne 0x51e8dd
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 0x51e9b5
mov edx, dword [ebp - 0x27c]
lea eax, [ebp - 0x274]
push eax
push dword [ebp + 0xc]
mov ecx, edi
call fcn.00511ff6
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x51e902
push 6
jmp 0x51ec35
cmp eax, 1
jne 0x51e91c
lea edx, [ebp - 0x274]
mov ecx, edi
call fcn.005126cf
test eax, eax
jne 0x51ec36
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x51ec06
mov eax, dword [eax]
mov dword [ebp - 0x278], eax
test eax, eax
je 0x51ec06
cmp dword [eax + 4], 2
jne 0x51e994
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 0x59fd9c
push esi
call fcn.00512948
add esp, 0xc
lea ecx, [ebp - 0x25d]
cmp ebx, 8
jl 0x51e95b
mov edi, dword [ebp - 0x280]
jmp 0x51e99b
and dword [ebp - 0x278], 0
mov edx, dword [ebp - 0x274]
mov ecx, esi
call fcn.00512155
cmp dword [ebp - 0x278], 0
je 0x51ec06
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.00512bd9
add esp, 0xc
test eax, eax
jne 0x51ebff
cmp ebx, dword [ebp - 0x26c]
jne 0x51ebff
mov edx, dword [ebp - 0x264]
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0x260]
mov ecx, edi
push 0xa
push eax
call fcn.0051df76
add esp, 0xc
test eax, eax
jne 0x51ebd2
cmp dword [ebp - 0x270], 0xa
jne 0x51ebd2
cmp byte [ebp - 0x260], 5
je 0x51ea49
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
jmp 0x51ec2b
mov bl, byte [ebp - 0x25f]
mov al, byte [ebp - 0x25d]
test bl, bl
je 0x51eb88
cmp al, 1
jne 0x51eaac
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.005129bc
add esp, 0x20
jmp 0x51ec33
cmp al, 3
jne 0x51eae1
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.005129bc
add esp, 0x14
jmp 0x51ec33
cmp al, 4
jne 0x51ec33
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.005129bc
add esp, 0x50
jmp 0x51ec33
cmp al, 3
jne 0x51eb98
movzx ebx, byte [ebp - 0x25c]
add ebx, 7
jmp 0x51eb9f
cmp al, 4
jne 0x51ebd9
push 0x16
pop ebx
cmp ebx, 0xa
jle 0x51ebd9
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.0051df76
add esp, 0xc
test eax, eax
jne 0x51ebd2
cmp ebx, dword [ebp - 0x270]
je 0x51ebd9
push str.Failed_to_receive_SOCKS5_connect_request_ack.
jmp 0x51ec2b
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 0x51ec36
push str.Failed_to_send_SOCKS5_connect_request.
jmp 0x51ec2b
push dword [ebp - 0x27c]
push str.Failed_to_resolve___s__for_SOCKS5_connect.
push esi
call fcn.005129bc
add esp, 0xc
jmp 0x51e8fb
push str.Unable_to_receive_initial_SOCKS5_response.
jmp 0x51ec2b
push str.Unable_to_send_initial_SOCKS5_request.
push esi
call fcn.005129bc
pop ecx
pop ecx
push 7
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055fedc
mov esp, ebp
pop ebp
ret