Function at 0x4af5c0
Capabilities:
Check for time delay via gettickcount
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x174
mov eax, dword [0x5bc324]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x160], ecx
mov ecx, dword [ebp + 0x10]
push ebx
push esi
push edi
mov eax, dword [ecx + eax*4 + 0x154]
mov edi, dword [ecx]
mov dword [ebp - 0x168], eax
mov eax, 0x493e0
mov dword [ebp - 0x15c], eax
xor eax, eax
mov dword [ebp - 0x164], ecx
mov ecx, dword [edi + 0x220]
test ecx, ecx
mov dword [ebp - 8], edx
mov edx, dword [ebp + 0x14]
setg al
mov dword [ebp - 0x16c], edx
mov edx, dword [edi + 0x224]
mov dword [ebp - 0x174], edi
test edx, edx
jle 0x4af62e
or eax, 2
sub eax, 1
je 0x4af654
sub eax, 1
je 0x4af64c
sub eax, 1
jne 0x4af65a
cmp ecx, edx
mov eax, ecx
cmovge eax, edx
mov dword [ebp - 0x15c], eax
jmp 0x4af65a
mov dword [ebp - 0x15c], edx
jmp 0x4af65a
mov dword [ebp - 0x15c], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, eax
mov edi, dword [edi + 0x570]
mov eax, 0x10624dd3
mul esi
mov eax, 0x10624dd3
mov ebx, edx
shr ebx, 6
imul ecx, ebx, 0x3e8
sub edi, ebx
sub esi, ecx
imul ecx, esi, 0x3e8
mov esi, dword [ebp - 0x174]
sub ecx, dword [esi + 0x574]
imul ecx
imul eax, edi, 0x3e8
sar edx, 6
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
sub eax, ecx
mov ecx, dword [ebp - 0x15c]
add ecx, eax
je 0x4afc4a
test ecx, ecx
js 0x4afc4a
lea eax, [ebp - 0x170]
mov dword [ebp - 0x170], 0
push eax
push 0x8004667e
push dword [ebp - 0x168]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebp + 8]
mov ebx, dword [ebp - 8]
push ebx
push str.SOCKS4_communication_to__s:_d_n
push esi
call fcn.00490900
mov ecx, dword [ebp + 8]
add esp, 0x10
mov eax, ecx
mov word [ebp - 0x118], 0x104
sar eax, 8
cmp dword [ebp - 0x16c], 0
mov byte [ebp - 0x116], al
mov byte [ebp - 0x115], cl
jne 0x4af843
mov edi, dword [ebp - 0x164]
lea eax, [ebp - 0x15c]
push eax
push ecx
mov edx, ebx
mov ecx, edi
call fcn.00493ab0
add esp, 8
cmp eax, 0xffffffff
jne 0x4af755
mov eax, 5
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
cmp eax, 1
jne 0x4af767
lea edx, [ebp - 0x15c]
mov ecx, edi
call fcn.0049da10
mov eax, dword [ebp - 0x15c]
test eax, eax
je 0x4af81e
mov edi, dword [eax]
test edi, edi
je 0x4af81e
mov eax, dword [edi + 4]
sub eax, 2
jne 0x4af7a3
mov edx, dword [edi + 0x18]
lea eax, [ebp - 0x158]
push 0x40
push eax
add edx, 4
mov ecx, 2
call fcn.004aa740
add esp, 8
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 fcn.004727e0
add esp, 0x18
cmp eax, 4
jne 0x4af7f6
movzx eax, byte [ebp - 0xc]
mov byte [ebp - 0x114], al
movzx eax, byte [ebp - 0xa]
mov byte [ebp - 0x113], al
movzx eax, byte [ebp - 8]
mov byte [ebp - 0x112], al
movzx eax, byte [ebp - 6]
mov byte [ebp - 0x111], al
jmp 0x4af7f8
xor edi, edi
lea eax, [ebp - 0x158]
push eax
push str.SOCKS4_connect_to__s__locally_resolved__n
push esi
call fcn.00490900
mov edx, dword [ebp - 0x15c]
add esp, 0xc
mov ecx, esi
call fcn.00493d40
test edi, edi
jne 0x4af843
push ebx
push str.Failed_to_resolve___s__for_SOCKS4_connect.
push esi
call fcn.004909c0
add esp, 0xc
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x160]
mov byte [ebp - 0x110], 0
test edx, edx
je 0x4af8a9
mov ecx, edx
lea edi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4af860
sub ecx, edi
cmp ecx, 0xfe
jb 0x4af895
push str.Too_long_SOCKS_proxy_name__cant_use__n
push esi
call fcn.004909c0
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
lea eax, [ecx + 1]
push eax
push edx
lea eax, [ebp - 0x110]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
lea ecx, [ebp - 0x110]
xor edi, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4af8b4
sub ecx, edx
lea edx, [ecx + 9]
mov dword [ebp - 0x15c], edx
cmp dword [ebp - 0x16c], edi
je 0x4af91b
mov ecx, ebx
mov dword [ebp - 0x114], 0x1000000
lea edi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4af8e0
sub ecx, edi
lea edi, [ecx + 1]
lea eax, [edx + edi]
cmp eax, 0x106
jg 0x4af919
mov eax, edx
mov ecx, ebx
sub eax, ebx
lea edx, [ebp - 0x118]
add edx, eax
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x4af904
mov edx, dword [ebp - 0x15c]
jmp 0x4af91b
xor edi, edi
mov ecx, dword [ebp - 0x164]
xor eax, eax
mov esi, dword [ebp - 0x168]
cmp esi, dword [ecx + 0x158]
lea esi, [ebp - 0x160]
push esi
sete al
add edx, edi
push edx
lea edx, [ebp - 0x118]
push edx
push eax
push ecx
call fcn.00490ca0
mov esi, dword [ebp - 0x174]
add esp, 0x14
cmp dword [ebp - 0x160], 0
mov ecx, eax
mov dword [ebp - 0x170], ecx
jne 0x4af9c5
mov eax, dword [ebp - 0x15c]
add eax, edi
cmp ecx, eax
jne 0x4af9c5
cmp dword [ebp - 0x16c], 0
je 0x4af9e9
test edi, edi
jne 0x4af9e9
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4af982
mov edi, dword [ebp - 0x164]
sub ecx, edx
mov edx, dword [ebp - 0x168]
lea eax, [ecx + 1]
lea ecx, [ebp - 0x170]
mov dword [ebp - 0x160], eax
push ecx
push eax
push ebx
mov ecx, edi
call fcn.00490d30
add esp, 0xc
test eax, eax
jne 0x4af9c5
mov eax, dword [ebp - 0x160]
cmp dword [ebp - 0x170], eax
je 0x4af9ef
push str.Failed_to_send_SOCKS4_connect_request.
push esi
call fcn.004909c0
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x164]
mov edx, dword [ebp - 0x168]
lea eax, [ebp - 0x160]
push eax
lea eax, [ebp - 0x118]
mov ecx, edi
push 8
push eax
call fcn.004af470
add esp, 0xc
test eax, eax
jne 0x4afc26
cmp dword [ebp - 0x160], 8
jne 0x4afc26
cmp byte [ebp - 0x118], al
je 0x4afa50
push str.SOCKS4_reply_has_wrong_version__version_should_be_4.
push esi
call fcn.004909c0
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
movzx eax, byte [ebp - 0x117]
lea ecx, [eax - 0x5a]
cmp ecx, 3
ja case.default.0x4afa63
jmp dword [ecx*4 + 0x4afc70]
cmp dword [ebp - 0x16c], 0
mov ecx, 0x590df6
mov eax, 0x5988e0
cmove eax, ecx
push eax
push str.SOCKS4_s_request_granted._n
push esi
call fcn.00490900
add esp, 0xc
mov dword [ebp - 0x160], 1
lea eax, [ebp - 0x160]
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 - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x110]
push eax
movzx eax, byte [ebp - 0x10f]
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.
push esi
call fcn.004909c0
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x110]
push eax
movzx eax, byte [ebp - 0x10f]
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.
push esi
call fcn.004909c0
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x110]
push eax
movzx eax, byte [ebp - 0x10f]
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.
push esi
call fcn.004909c0
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
movzx ecx, byte [ebp - 0x110]
push eax
movzx eax, byte [ebp - 0x10f]
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.004909c0
add esp, 0x20
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
push str.Failed_to_receive_SOCKS4_connect_request_ack.
push esi
call fcn.004909c0
mov eax, 7
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00523a6a
mov esp, ebp
pop ebp
ret
push str.Connection_time_out
push esi
call fcn.004909c0
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
mov eax, 0x1c
pop edi
pop esi
pop ebx
call fcn.00523a6a
mov esp, ebp
pop ebp
ret