Function at 0x4050a1
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c0
mov eax, dword [0x581d10]
xor eax, ebp
mov dword [ebp - 8], eax
and dword [ebp - 0x2b8], 0
lea eax, [ebp - 0x2b8]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push eax
push 0x8004667e
mov ebx, dword [esi + 0xa0]
mov edi, ecx
push ebx
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x2c0], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test edi, edi
mov byte [ebp - 0x26c], 5
lea ecx, [ebp - 0x2b0]
mov word [ebp - 0x26a], 0x200
setne al
mov edx, ebx
inc al
mov byte [ebp - 0x26b], al
movzx eax, al
push ecx
add eax, 2
mov ecx, esi
push eax
lea eax, [ebp - 0x26c]
push eax
call fcn.00401977
add esp, 0xc
test eax, eax
jne 0x4054c7
movzx eax, byte [ebp - 0x26b]
add eax, 2
cmp dword [ebp - 0x2b0], eax
jne 0x4054c7
lea eax, [ebp - 0x2b4]
mov edx, ebx
push eax
lea eax, [ebp - 0x26c]
mov ecx, esi
push 2
push eax
call fcn.00401a77
add esp, 0xc
test eax, eax
jne 0x4054c0
cmp dword [ebp - 0x2b4], 2
jne 0x4054c0
cmp byte [ebp - 0x26c], 5
je 0x405185
push str.Received_invalid_version_in_initial_SOCKS5_response.
jmp 0x4054cc
mov al, byte [ebp - 0x26b]
test al, al
je 0x4052e4
cmp al, 2
jne 0x4052ab
push edi
call fcn.004f9020
pop ecx
mov ecx, eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x2b8], ecx
test eax, eax
je 0x4051c0
push eax
call fcn.004f9020
pop ecx
mov ecx, dword [ebp - 0x2b8]
jmp 0x4051c2
xor eax, eax
push ecx
mov dword [ebp - 0x2bc], eax
lea eax, [ebp - 0x26a]
push edi
push eax
mov byte [ebp - 0x26c], 1
mov byte [ebp - 0x26b], cl
call fcn.004f2260
mov edi, dword [ebp - 0x2b8]
add esp, 0xc
mov eax, dword [ebp - 0x2bc]
mov edx, dword [ebp - 0xc]
push eax
mov byte [ebp + edi - 0x26a], al
add edi, 3
lea eax, [ebp - 0x26c]
push edx
add eax, edi
push eax
call fcn.004f2260
add edi, dword [ebp - 0x2bc]
lea eax, [ebp - 0x2b0]
add esp, 0xc
mov edx, ebx
mov ecx, esi
push eax
lea eax, [ebp - 0x26c]
push edi
push eax
call fcn.00401977
add esp, 0xc
test eax, eax
jne 0x4052a1
cmp edi, dword [ebp - 0x2b0]
jne 0x4052a1
lea eax, [ebp - 0x2b4]
mov edx, ebx
push eax
lea eax, [ebp - 0x26c]
mov ecx, esi
push 2
push eax
call fcn.00401a77
add esp, 0xc
test eax, eax
jne 0x405297
cmp dword [ebp - 0x2b4], 2
jne 0x405297
mov al, byte [ebp - 0x26b]
test al, al
je 0x4052e4
movzx eax, al
push eax
movzx eax, byte [ebp - 0x26c]
push eax
push str.User_was_rejected_by_the_SOCKS5_server___d__d_.
push dword [esi]
call fcn.00401832
add esp, 0x10
mov eax, 0x468
jmp 0x4054d8
push str.Unable_to_receive_SOCKS5_sub_negotiation_response.
jmp 0x4054cc
push str.Failed_to_send_SOCKS5_sub_negotiation_request.
jmp 0x4054cc
cmp al, 1
jne 0x4052b9
push str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
jmp 0x4054cc
cmp al, 0xff
jne 0x4052da
test edi, edi
je 0x4052d0
cmp byte [edi], 0
je 0x4052d0
push str.No_authentication_method_was_acceptable.
jmp 0x4054cc
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 0x4054cc
push str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
jmp 0x4054cc
mov edx, dword [esi + 0x34]
lea eax, [ebp - 0xc]
push eax
movzx eax, word [esi + 0x58]
mov ecx, esi
push eax
mov dword [ebp - 0x26c], 0x1000105
call fcn.00406ddb
pop ecx
pop ecx
cmp eax, 0xffffffff
je 0x4054d5
cmp eax, 1
jne 0x40531b
lea edx, [ebp - 0xc]
mov ecx, esi
call fcn.0040a922
mov ebx, dword [ebp - 0xc]
test ebx, ebx
je 0x4054ac
mov edi, dword [ebx]
test edi, edi
je 0x4054ac
push 0x40
lea edx, [ebp - 0x2ac]
mov ecx, edi
call fcn.00406ca3
pop ecx
lea eax, [ebp - 0xa]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0xe]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x2ac]
push str._hu._hu._hu._hu
push eax
call fcn.004f774c
add esp, 0x18
cmp eax, 4
jne 0x40538f
mov al, byte [ebp - 0x10]
mov byte [ebp - 0x268], al
mov al, byte [ebp - 0xe]
mov byte [ebp - 0x267], al
mov al, byte [ebp - 0xc]
mov byte [ebp - 0x266], al
mov al, byte [ebp - 0xa]
mov byte [ebp - 0x265], al
jmp 0x405391
xor edi, edi
mov ecx, dword [esi]
mov edx, ebx
call fcn.00406f2b
test edi, edi
je 0x4054ac
movzx eax, word [esi + 0x58]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov edi, dword [ebp - 0x2c0]
mov ecx, esi
mov word [ebp - 0x264], ax
mov edx, edi
lea eax, [ebp - 0x2b0]
push eax
push 0xa
pop ebx
lea eax, [ebp - 0x26c]
push ebx
push eax
call fcn.00401977
add esp, 0xc
test eax, eax
jne 0x4054a5
cmp dword [ebp - 0x2b0], ebx
jne 0x4054a5
lea eax, [ebp - 0x2b4]
mov edx, edi
push eax
lea eax, [ebp - 0x26c]
mov ecx, esi
push ebx
push eax
call fcn.00401a77
add esp, 0xc
test eax, eax
jne 0x40549e
cmp dword [ebp - 0x2b4], ebx
jne 0x40549e
cmp byte [ebp - 0x26c], 5
je 0x40542e
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
jmp 0x4054cc
mov al, byte [ebp - 0x26b]
test al, al
je 0x40547d
movzx eax, al
push eax
push dword [ebp - 0x264]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
movzx eax, byte [ebp - 0x265]
push eax
movzx eax, byte [ebp - 0x266]
push eax
movzx eax, byte [ebp - 0x267]
push eax
movzx eax, byte [ebp - 0x268]
push eax
push str.Cant_complete_SOCKS5_connection_to__d._d._d._d:_d.___d_
push dword [esi]
call fcn.00401832
add esp, 0x20
jmp 0x4054d5
lea eax, [ebp - 0x2c0]
mov dword [ebp - 0x2c0], 1
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x4054d8
push str.Failed_to_receive_SOCKS5_connect_request_ack.
jmp 0x4054cc
push str.Failed_to_send_SOCKS5_connect_request.
jmp 0x4054cc
push dword [esi + 0x34]
push str.Failed_to_resolve___s__for_SOCKS5_connect.
push dword [esi]
call fcn.00401832
add esp, 0xc
jmp 0x4054d5
push str.Unable_to_receive_initial_SOCKS5_response.
jmp 0x4054cc
push str.Unable_to_send_initial_SOCKS5_request.
push dword [esi]
call fcn.00401832
pop ecx
pop ecx
xor eax, eax
inc eax
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004f1cdb
mov esp, ebp
pop ebp
ret