Function at 0x4be760
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x170
mov eax, dword [0x7c0ab4]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x16c], ebx
mov dword [ebp - 0x15c], ecx
mov dword [ebp - 0x160], edx
mov eax, dword [ebx + 0xd0]
mov dword [ebp - 0x164], eax
mov eax, dword [ebx + 0x19c]
mov ebx, dword [ebx]
mov dword [ebp - 0x168], eax
xor eax, eax
push esi
push edi
mov ecx, dword [ebx + 0x1e8]
test ecx, ecx
mov edx, dword [ebx + 0x1ec]
setg al
mov dword [ebp - 0x170], 0x493e0
mov dword [ebp - 0x158], 0
test edx, edx
jle 0x4be7d3
or eax, 2
sub eax, 1
je 0x4be7eb
sub eax, 1
je 0x4be941
sub eax, 1
jne 0x4be7fa
cmp ecx, edx
cmovge ecx, edx
mov eax, ecx
cdq
mov dword [ebp - 0x170], eax
mov dword [ebp - 0x158], edx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
push 0
mov edi, edx
shr edi, 6
imul eax, edi, 0x3e8
push 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
sub eax, dword [ebx + 0x5a4]
cdq
push edx
push eax
call fcn.00702460
sub edi, dword [ebx + 0x5a0]
mov ecx, eax
imul eax, edi, 0x3e8
mov esi, edx
cdq
mov edi, eax
neg edi
adc edx, 0
neg edx
sub edi, ecx
sbb edx, esi
add edi, dword [ebp - 0x170]
mov eax, edi
adc edx, dword [ebp - 0x158]
or eax, edx
je 0x4bee1e
test edx, edx
jl 0x4bee1e
jg 0x4be877
test edi, edi
jb 0x4bee1e
mov esi, dword [ebp - 0x16c]
mov ecx, 0x78c138
mov edi, dword [ebp - 0x160]
cmp byte [esi + 0x292], 0
je 0x4be8b4
push dword [ebp + 8]
cmp dword [ebp - 0x164], 6
mov eax, 0x79671c
push edi
cmovne eax, ecx
push eax
push str.SOCKS4_s:_connecting_to_HTTP_proxy__s_port__d_n
push dword [esi]
call fcn.004aee40
add esp, 0x14
lea eax, [ebp - 0x16c]
mov dword [ebp - 0x16c], 0
push eax
push 0x8004667e
push dword [ebp - 0x168]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebp + 8]
push edi
push str.SOCKS4_communication_to__s:_d_n
push ebx
call fcn.004aee40
mov ecx, dword [ebp + 8]
add esp, 0x10
mov eax, ecx
mov word [ebp - 0x114], 0x104
sar eax, 8
cmp dword [ebp - 0x164], 6
mov byte [ebp - 0x112], al
mov byte [ebp - 0x111], cl
je 0x4bea31
lea eax, [ebp - 0x158]
mov edx, edi
push eax
push ecx
mov ecx, esi
call fcn.004b1a00
add esp, 8
cmp eax, 0xffffffff
jne 0x4be948
mov eax, 5
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
mov eax, edx
jmp 0x4be7ed
cmp eax, 1
jne 0x4be95a
lea edx, [ebp - 0x158]
mov ecx, esi
call fcn.004b2620
mov eax, dword [ebp - 0x158]
test eax, eax
je 0x4bea07
mov edi, dword [eax]
test edi, edi
je 0x4bea07
mov ecx, dword [edi + 4]
mov eax, ecx
sub eax, 2
jne 0x4be99b
mov edx, dword [edi + 0x18]
lea eax, [ebp - 0x154]
push 0x40
push eax
add edx, 4
mov ecx, 2
call fcn.004bb7e0
mov ecx, dword [edi + 4]
add esp, 8
cmp ecx, 2
jne 0x4be9df
mov ecx, dword [edi + 0x18]
movzx eax, byte [ecx + 4]
mov byte [ebp - 0x110], al
movzx eax, byte [ecx + 5]
mov byte [ebp - 0x10f], al
movzx eax, byte [ecx + 6]
mov byte [ebp - 0x10e], al
movzx eax, byte [ecx + 7]
mov byte [ebp - 0x10d], al
lea eax, [ebp - 0x154]
push eax
push str.SOCKS4_connect_to_IPv4__s__locally_resolved__n
push ebx
call fcn.004aee40
jmp 0x4be9f3
lea eax, [ebp - 0x154]
xor edi, edi
push eax
push str.SOCKS4_connection_to__s_not_supported_n
push ebx
call fcn.004aef10
mov edx, dword [ebp - 0x158]
add esp, 0xc
mov ecx, ebx
call fcn.004b1b90
test edi, edi
jne 0x4bea31
push dword [ebp - 0x160]
push str.Failed_to_resolve___s__for_SOCKS4_connect.
push ebx
call fcn.004aef10
add esp, 0xc
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x15c]
mov byte [ebp - 0x10c], 0
test edi, edi
je 0x4bea88
push edi
call fcn.006e5360
add esp, 4
cmp eax, 0xfe
jb 0x4bea76
push str.Too_long_SOCKS_proxy_name__cant_use__n
push ebx
call fcn.004aef10
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
inc eax
push eax
lea eax, [ebp - 0x10c]
push edi
push eax
call fcn.006d2cf0
add esp, 0xc
lea eax, [ebp - 0x10c]
xor edi, edi
push eax
call fcn.006e5360
add eax, 9
add esp, 4
cmp dword [ebp - 0x164], 6
mov dword [ebp - 0x158], eax
jne 0x4beaf2
push dword [ebp - 0x160]
mov dword [ebp - 0x110], 0x1000000
call fcn.006e5360
add esp, 4
lea edi, [eax + 1]
mov eax, dword [ebp - 0x158]
lea ecx, [eax + edi]
cmp ecx, 0x106
jg 0x4beaf0
push dword [ebp - 0x160]
lea ecx, [ebp - 0x114]
add ecx, eax
push ecx
call fcn.006e6d10
add esp, 8
jmp 0x4beaf2
xor edi, edi
mov ecx, dword [ebp - 0x168]
lea edx, [ebp - 0x15c]
xor eax, eax
cmp ecx, dword [esi + 0x19c]
mov ecx, dword [ebp - 0x158]
push edx
sete al
add ecx, edi
push ecx
mov dword [ebp - 0x16c], ecx
lea ecx, [ebp - 0x114]
push ecx
push eax
push esi
call fcn.004af280
add esp, 0x14
mov dword [ebp - 0x158], eax
cmp dword [ebp - 0x15c], 0
jne 0x4bedfa
cmp eax, dword [ebp - 0x16c]
jne 0x4bedfa
cmp dword [ebp - 0x164], 6
jne 0x4beb9f
test edi, edi
jne 0x4beb9f
mov edi, dword [ebp - 0x160]
push edi
call fcn.006e5360
mov edx, dword [ebp - 0x168]
lea ecx, [ebp - 0x158]
add esp, 4
inc eax
mov dword [ebp - 0x15c], eax
push ecx
push eax
push edi
mov ecx, esi
call fcn.004af3c0
add esp, 0xc
test eax, eax
jne 0x4bedfa
mov eax, dword [ebp - 0x15c]
cmp dword [ebp - 0x158], eax
jne 0x4bedfa
mov edx, dword [ebp - 0x168]
lea eax, [ebp - 0x15c]
push eax
lea eax, [ebp - 0x114]
mov ecx, esi
push 8
push eax
call fcn.004be5e0
add esp, 0xc
test eax, eax
jne 0x4bedd6
cmp dword [ebp - 0x15c], 8
jne 0x4bedd6
cmp byte [ebp - 0x114], al
je 0x4bec00
push str.SOCKS4_reply_has_wrong_version__version_should_be_4.
push ebx
call fcn.004aef10
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
movzx eax, byte [ebp - 0x113]
lea ecx, [eax - 0x5a]
cmp ecx, 3
ja case.default.0x4bec13
jmp dword [ecx*4 + 0x4bee44]
cmp dword [ebp - 0x164], 6
mov ecx, 0x78c138
mov eax, 0x79671c
cmovne eax, ecx
push eax
push str.SOCKS4_s_request_granted._n
push ebx
call fcn.004aee40
add esp, 0xc
mov dword [ebp - 0x15c], 1
lea eax, [ebp - 0x15c]
push eax
push 0x8004667e
push dword [ebp - 0x168]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x10c]
push eax
movzx eax, byte [ebp - 0x10b]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x10d]
push ecx
push eax
movzx eax, byte [ebp - 0x10e]
push eax
movzx eax, byte [ebp - 0x10f]
push eax
movzx eax, byte [ebp - 0x110]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_or_failed.
push ebx
call fcn.004aef10
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x10c]
push eax
movzx eax, byte [ebp - 0x10b]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x10d]
push ecx
push eax
movzx eax, byte [ebp - 0x10e]
push eax
movzx eax, byte [ebp - 0x10f]
push eax
movzx eax, byte [ebp - 0x110]
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 ebx
call fcn.004aef10
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x10c]
push eax
movzx eax, byte [ebp - 0x10b]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x10d]
push ecx
push eax
movzx eax, byte [ebp - 0x10e]
push eax
movzx eax, byte [ebp - 0x10f]
push eax
movzx eax, byte [ebp - 0x110]
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 ebx
call fcn.004aef10
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x10c]
push eax
movzx eax, byte [ebp - 0x10b]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x10d]
push ecx
push eax
movzx eax, byte [ebp - 0x10e]
push eax
movzx eax, byte [ebp - 0x10f]
push eax
movzx eax, byte [ebp - 0x110]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___Unknown.
push ebx
call fcn.004aef10
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
push str.Failed_to_receive_SOCKS4_connect_request_ack.
push ebx
call fcn.004aef10
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
push str.Failed_to_send_SOCKS4_connect_request.
push ebx
call fcn.004aef10
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.006d0856
mov esp, ebp
pop ebp
ret
push str.Connection_time_out
push ebx
call fcn.004aef10
mov ecx, dword [ebp - 8]
add esp, 8
xor ecx, ebp
mov eax, 0x1c
pop edi
pop esi
pop ebx
call fcn.006d0856
mov esp, ebp
pop ebp
ret