Function at 0x50bdb8
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x174
mov eax, dword [0x5b31c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov ebx, edx
mov dword [ebp - 0x160], ecx
xor edx, edx
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x168], ecx
mov esi, dword [edi]
mov ecx, esi
mov eax, dword [edi + eax*4 + 0x130]
push 1
mov dword [ebp - 0x170], ebx
mov dword [ebp - 0x16c], edi
mov dword [ebp - 0x164], eax
call fcn.004ff1e0
pop ecx
test eax, eax
jns 0x50be24
push str.Connection_time_out
push esi
call fcn.00500d35
pop ecx
pop ecx
push 0x1c
jmp 0x50c218
and dword [ebp - 0x15c], 0
lea eax, [ebp - 0x15c]
push eax
push 0x8004667e
push dword [ebp - 0x164]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, dword [ebp + 8]
mov eax, ecx
sar eax, 8
cmp dword [ebp - 0x168], 0
mov word [ebp - 0x118], 0x104
mov byte [ebp - 0x116], al
mov byte [ebp - 0x115], cl
jne 0x50bf37
lea eax, [ebp - 0x15c]
mov edx, ebx
push eax
push ecx
mov ecx, edi
call fcn.0050036f
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x50be8c
push 5
jmp 0x50c218
cmp eax, 1
jne 0x50be9e
lea edx, [ebp - 0x15c]
mov ecx, edi
call fcn.00500a48
mov eax, dword [ebp - 0x15c]
test eax, eax
je 0x50bf21
mov edi, dword [eax]
test edi, edi
je 0x50bf21
push 0x40
lea edx, [ebp - 0x158]
mov ecx, edi
call fcn.0050012a
pop ecx
lea eax, [ebp - 6]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xa]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x158]
push str._hu._hu._hu._hu
push eax
call dword [sym.imp.MSVCR120.dll_sscanf]
add esp, 0x18
cmp eax, 4
jne 0x50bf0e
mov al, byte [ebp - 0xc]
mov byte [ebp - 0x114], al
mov al, byte [ebp - 0xa]
mov byte [ebp - 0x113], al
mov al, byte [ebp - 8]
mov byte [ebp - 0x112], al
mov al, byte [ebp - 6]
mov byte [ebp - 0x111], al
jmp 0x50bf10
xor edi, edi
mov edx, dword [ebp - 0x15c]
mov ecx, esi
call fcn.005004ce
test edi, edi
jne 0x50bf37
push ebx
push str.Failed_to_resolve___s__for_SOCKS4_connect.
push esi
call fcn.00500d35
add esp, 0xc
push 6
jmp 0x50c218
mov eax, dword [ebp - 0x160]
mov byte [ebp - 0x110], 0
test eax, eax
je 0x50bf57
push ecx
mov edx, eax
lea ecx, [ebp - 0x110]
call fcn.00510068
pop ecx
lea ecx, [ebp - 0x110]
xor edi, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x50bf62
sub ecx, edx
cmp dword [ebp - 0x168], edi
je 0x50bfb9
mov edx, ebx
mov dword [ebp - 0x114], 0x1000000
lea edi, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x50bf82
sub edx, edi
lea edi, [edx + 1]
lea eax, [edi + 9]
add eax, ecx
cmp eax, 0x106
jg 0x50bfb7
mov edx, ebx
lea ebx, [ebp + ecx - 0x10f]
sub ebx, edx
mov al, byte [edx]
mov byte [ebx + edx], al
inc edx
test al, al
jne 0x50bfa5
mov ebx, dword [ebp - 0x170]
jmp 0x50bfb9
xor edi, edi
mov edx, dword [ebp - 0x164]
lea eax, [ecx + 9]
add eax, edi
lea ecx, [ebp - 0x15c]
push ecx
mov ecx, dword [ebp - 0x16c]
push eax
mov dword [ebp - 0x160], eax
lea eax, [ebp - 0x118]
push eax
call fcn.00500f52
add esp, 0xc
test eax, eax
jne 0x50c209
mov eax, dword [ebp - 0x160]
cmp dword [ebp - 0x15c], eax
jne 0x50c209
cmp dword [ebp - 0x168], 0
je 0x50c050
test edi, edi
jne 0x50c050
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x50c013
sub ecx, edx
lea eax, [ebp - 0x15c]
mov edx, dword [ebp - 0x164]
push eax
lea edi, [ecx + 1]
mov ecx, dword [ebp - 0x16c]
push edi
push ebx
call fcn.00500f52
add esp, 0xc
test eax, eax
jne 0x50c209
cmp dword [ebp - 0x15c], edi
jne 0x50c209
mov edi, dword [ebp - 0x164]
lea eax, [ebp - 0x160]
mov ecx, dword [ebp - 0x16c]
mov edx, edi
push eax
lea eax, [ebp - 0x118]
push 8
push eax
call fcn.0050bd1e
add esp, 0xc
test eax, eax
jne 0x50c202
cmp dword [ebp - 0x160], 8
jne 0x50c202
cmp byte [ebp - 0x118], al
je 0x50c09d
push str.SOCKS4_reply_has_wrong_version__version_should_be_4.
jmp 0x50c20e
movzx ecx, byte [ebp - 0x117]
mov eax, ecx
sub eax, 0x5a
je 0x50c1be
dec eax
je 0x50c17e
dec eax
je 0x50c13e
dec eax
movzx eax, byte [ebp - 0x10f]
je 0x50c108
push ecx
movzx ecx, byte [ebp - 0x110]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___Unknown.
push esi
call fcn.00500d35
add esp, 0x20
jmp 0x50c216
movzx ecx, byte [ebp - 0x110]
push 0x5d
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_because_the_client_program_and_identd_report_different_user_ids.
jmp 0x50c0fa
movzx ecx, byte [ebp - 0x110]
movzx eax, byte [ebp - 0x10f]
push 0x5c
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_because_SOCKS_server_cannot_connect_to_identd_on_the_client.
jmp 0x50c0fa
movzx ecx, byte [ebp - 0x110]
movzx eax, byte [ebp - 0x10f]
push 0x5b
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_or_failed.
jmp 0x50c0fa
cmp dword [ebp - 0x168], 0
mov ecx, 0x5708be
mov eax, 0x58a910
cmove eax, ecx
push eax
push str.SOCKS4_s_request_granted._n
push esi
call fcn.00500cc1
add esp, 0xc
mov dword [ebp - 0x160], 1
lea eax, [ebp - 0x160]
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x50c219
push str.Failed_to_receive_SOCKS4_connect_request_ack.
jmp 0x50c20e
push str.Failed_to_send_SOCKS4_connect_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