Function at 0x52d450
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x178
mov eax, dword [0x592830]
xor eax, esp
mov dword [esp + 0x174], eax
push ebx
mov ebx, dword [esp + 0x188]
xor eax, eax
cmp dword [ebx + 0xd0], 6
push ebp
sete al
push esi
push edi
mov edi, dword [ebx]
mov dword [esp + 0x18], edx
mov edx, dword [edi + 0x638]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], eax
mov eax, dword [ebx + 0x1b8]
mov dword [esp + 0x24], eax
xor eax, eax
mov ecx, 0x493e0
xor ebp, ebp
mov dword [esp + 0x14], ecx
test edx, edx
jle 0x52d4ad
lea eax, [ebp + 1]
mov ecx, dword [edi + 0x63c]
test ecx, ecx
jle 0x52d4ba
or eax, 2
dec eax
je 0x52d4cb
dec eax
je 0x52d4c7
dec eax
jne 0x52d4d4
cmp edx, ecx
jl 0x52d4cb
mov eax, ecx
jmp 0x52d4cd
mov eax, edx
cdq
mov ebp, edx
mov dword [esp + 0x14], eax
lea eax, [esp + 0x28]
push eax
call fcn.0051f970
mov ecx, dword [edi + 0xb30]
sub esp, 0xc
mov edx, esp
mov esi, eax
mov eax, dword [edi + 0xb3c]
mov dword [edx], ecx
mov ecx, dword [edi + 0xb34]
mov dword [edx + 4], ecx
mov ecx, dword [edi + 0xb38]
mov dword [edx + 8], ecx
mov dword [edx + 0xc], eax
mov eax, dword [esi]
sub esp, 0x10
mov ecx, esp
mov dword [ecx], eax
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
mov eax, dword [esi + 8]
mov dword [ecx + 8], eax
mov eax, dword [esi + 0xc]
mov dword [ecx + 0xc], eax
call fcn.0051fa10
mov ecx, dword [esp + 0x34]
add esp, 0x20
sub ecx, eax
sbb ebp, edx
mov eax, ecx
or eax, ebp
je 0x52d9c2
test ebp, ebp
jg 0x52d54f
jl 0x52d9c2
test ecx, ecx
jb 0x52d9c2
test byte [ebx + 0x2a4], 0x20
je 0x52d588
cmp dword [esp + 0x20], 0
mov eax, 0x56b580
jne 0x52d569
mov eax, 0x5411b4
mov esi, dword [esp + 0x18c]
mov ebp, dword [esp + 0x18]
push esi
push ebp
push eax
push str.SOCKS4_s:_connecting_to_HTTP_proxy__s_port__d_n
push dword [ebx]
call fcn.0051a600
add esp, 0x14
jmp 0x52d593
mov esi, dword [esp + 0x18c]
mov ebp, dword [esp + 0x18]
lea eax, [esp + 0x18]
push eax
push 0x8004667e
push dword [esp + 0x2c]
mov dword [esp + 0x24], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push esi
push ebp
push str.SOCKS4_communication_to__s:_d_n
push edi
call fcn.0051a600
mov ecx, dword [esp + 0x19c]
mov eax, ecx
sar eax, 8
add esp, 0x10
cmp dword [esp + 0x20], 0
mov word [esp + 0x38], 0x104
mov byte [esp + 0x3a], al
mov byte [esp + 0x3b], cl
jne 0x52d6cf
lea eax, [esp + 0x14]
push eax
push 0
push ecx
mov edx, ebp
mov ecx, ebx
call fcn.00520400
add esp, 0xc
cmp eax, 0xffffffff
jne 0x52d608
mov eax, 5
jmp 0x52d9d5
cmp eax, 1
jne 0x52d61c
push eax
lea edx, [esp + 0x18]
mov ecx, ebx
call fcn.00517110
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x52d6b6
mov esi, dword [eax]
test esi, esi
je 0x52d6b6
mov eax, dword [esi + 4]
sub eax, 2
jne 0x52d651
mov ecx, dword [esi + 0x18]
add ecx, 4
push 0x40
lea edx, [esp + 0x144]
call fcn.0052e310
add esp, 4
cmp dword [esi + 4], 2
jne 0x52d68f
mov ecx, dword [esi + 0x18]
movzx eax, byte [ecx + 4]
mov byte [esp + 0x3c], al
movzx eax, byte [ecx + 5]
mov byte [esp + 0x3d], al
movzx eax, byte [ecx + 6]
mov byte [esp + 0x3e], al
movzx eax, byte [ecx + 7]
mov byte [esp + 0x3f], al
lea eax, [esp + 0x140]
push eax
push str.SOCKS4_connect_to_IPv4__s__locally_resolved__n
push edi
call fcn.0051a600
jmp 0x52d6a4
lea eax, [esp + 0x140]
push eax
push str.SOCKS4_connection_to__s_not_supported_n
push edi
xor esi, esi
call fcn.0051a7e0
mov edx, dword [esp + 0x20]
add esp, 0xc
mov ecx, edi
call fcn.005209b0
test esi, esi
jne 0x52d6cf
push ebp
push str.Failed_to_resolve___s__for_SOCKS4_connect.
push edi
call fcn.0051a7e0
add esp, 0xc
mov eax, 6
jmp 0x52d9d5
mov esi, dword [esp + 0x1c]
mov byte [esp + 0x40], 0
test esi, esi
je 0x52d719
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x52d6e1
sub ecx, edx
cmp ecx, 0xfe
jb 0x52d707
push str.Too_long_SOCKS_proxy_name__cant_use__n
push edi
call fcn.0051a7e0
mov eax, 7
jmp 0x52d9d2
lea eax, [ecx + 1]
push eax
lea eax, [esp + 0x44]
push esi
push eax
call fcn.004f0080
add esp, 0xc
lea ecx, [esp + 0x40]
xor esi, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x52d722
sub ecx, edx
lea edx, [ecx + 9]
mov dword [esp + 0x18], edx
cmp dword [esp + 0x20], esi
je 0x52d77b
mov ecx, ebp
mov dword [esp + 0x3c], 0x1000000
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x52d745
sub ecx, esi
lea esi, [ecx + 1]
lea eax, [edx + esi]
cmp eax, 0x106
jg 0x52d779
mov eax, edx
sub eax, ebp
lea edx, [esp + 0x38]
mov ecx, ebp
add edx, eax
mov al, byte [ecx]
mov byte [edx + ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x52d767
mov edx, dword [esp + 0x18]
jmp 0x52d77b
xor esi, esi
mov ecx, dword [esp + 0x24]
xor eax, eax
cmp ecx, dword [ebx + 0x1bc]
lea ecx, [edx + esi]
lea edx, [esp + 0x1c]
push edx
sete al
push ecx
lea ecx, [esp + 0x40]
push ecx
push eax
push ebx
call fcn.0051a3e0
add esp, 0x14
cmp dword [esp + 0x1c], 0
mov ecx, eax
mov dword [esp + 0x14], ecx
jne 0x52d7fb
mov eax, dword [esp + 0x18]
add eax, esi
cmp ecx, eax
jne 0x52d7fb
cmp dword [esp + 0x20], 0
je 0x52d810
test esi, esi
jne 0x52d810
mov ecx, ebp
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x52d7d0
sub ecx, edx
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x14]
lea esi, [ecx + 1]
push eax
push esi
push ebp
mov ecx, ebx
call fcn.0051a260
add esp, 0xc
test eax, eax
jne 0x52d7fb
cmp dword [esp + 0x14], esi
je 0x52d810
push str.Failed_to_send_SOCKS4_connect_request.
push edi
call fcn.0051a7e0
mov eax, 7
jmp 0x52d9d2
mov esi, dword [esp + 0x24]
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x3c]
push 8
push eax
mov edx, esi
mov ecx, ebx
call fcn.0052c950
add esp, 0xc
test eax, eax
jne 0x52d9b0
cmp dword [esp + 0x1c], 8
jne 0x52d9b0
cmp byte [esp + 0x38], al
je 0x52d85a
push str.SOCKS4_reply_has_wrong_version__version_should_be_0.
push edi
call fcn.0051a7e0
mov eax, 7
jmp 0x52d9d2
movzx eax, byte [esp + 0x39]
lea ecx, [eax - 0x5a]
cmp ecx, 3
ja case.default.0x52d86b
jmp dword [ecx*4 + 0x52d9f0]
cmp dword [esp + 0x20], 0
mov eax, 0x56b580
jne 0x52d883
mov eax, 0x5411b4
push eax
push str.SOCKS4_s_request_granted._n
push edi
call fcn.0051a600
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
push 0x8004667e
push esi
mov dword [esp + 0x28], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x52d9d5
movzx ecx, byte [esp + 0x3a]
push eax
movzx eax, byte [esp + 0x3f]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x43]
push ecx
push eax
movzx eax, byte [esp + 0x4a]
push eax
movzx eax, byte [esp + 0x4d]
push eax
movzx eax, byte [esp + 0x50]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_or_failed.
push edi
call fcn.0051a7e0
add esp, 0x20
mov eax, 7
jmp 0x52d9d5
movzx ecx, byte [esp + 0x3a]
push eax
movzx eax, byte [esp + 0x3f]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x43]
push ecx
push eax
movzx eax, byte [esp + 0x4a]
push eax
movzx eax, byte [esp + 0x4d]
push eax
movzx eax, byte [esp + 0x50]
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.
push edi
call fcn.0051a7e0
add esp, 0x20
mov eax, 7
jmp 0x52d9d5
movzx ecx, byte [esp + 0x3a]
push eax
movzx eax, byte [esp + 0x3f]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x43]
push ecx
push eax
movzx eax, byte [esp + 0x4a]
push eax
movzx eax, byte [esp + 0x4d]
push eax
movzx eax, byte [esp + 0x50]
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.
push edi
call fcn.0051a7e0
add esp, 0x20
mov eax, 7
jmp 0x52d9d5
movzx ecx, byte [esp + 0x3a]
push eax
movzx eax, byte [esp + 0x3f]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x43]
push ecx
push eax
movzx eax, byte [esp + 0x4a]
push eax
movzx eax, byte [esp + 0x4d]
push eax
movzx eax, byte [esp + 0x50]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___Unknown.
push edi
call fcn.0051a7e0
add esp, 0x20
mov eax, 7
jmp 0x52d9d5
push str.Failed_to_receive_SOCKS4_connect_request_ack.
push edi
call fcn.0051a7e0
mov eax, 7
jmp 0x52d9d2
push str.Connection_time_out
push edi
call fcn.0051a7e0
mov eax, 0x1c
add esp, 8
mov ecx, dword [esp + 0x184]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004ebb9e
add esp, 0x178
ret