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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28c
mov eax, dword [0x5bc324]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x274], ecx
mov ecx, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [ebp - 0x278], ecx
mov ecx, dword [eax + ecx*4 + 0x154]
push edi
mov edi, dword [eax]
mov dword [ebp - 0x288], edx
mov edx, dword [eax + 0x138]
mov dword [ebp - 0x27c], eax
xor eax, eax
mov dword [ebp - 0x270], ecx
cmp edx, 5
mov ecx, ebx
mov dword [ebp - 0x284], ebx
sete al
mov dword [ebp - 0x264], edi
mov dword [ebp - 0x28c], eax
lea esi, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4afcf0
sub ecx, esi
mov dword [ebp - 0x280], ecx
cmp edx, 5
je 0x4afd25
cmp ecx, 0xff
jbe 0x4afd25
push ecx
push str.SOCKS5:_server_resolving_disabled_for_hostnames_of_length___255__actual_len_zu__n
push edi
call fcn.00490900
add esp, 0xc
mov dword [ebp - 0x28c], 1
mov ecx, dword [edi + 0x220]
mov eax, 0x493e0
mov edx, dword [edi + 0x224]
mov dword [ebp - 0x26c], eax
xor eax, eax
test ecx, ecx
setg al
test edx, edx
jle 0x4afd4a
or eax, 2
sub eax, 1
je 0x4afd70
sub eax, 1
je 0x4afd68
sub eax, 1
jne 0x4afd76
cmp ecx, edx
mov eax, ecx
cmovge eax, edx
mov dword [ebp - 0x26c], eax
jmp 0x4afd76
mov dword [ebp - 0x26c], edx
jmp 0x4afd76
mov dword [ebp - 0x26c], 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 - 0x264]
sub ecx, dword [esi + 0x574]
imul ecx
imul eax, edi, 0x3e8
mov edi, dword [ebp - 0x26c]
sar edx, 6
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
sub eax, ecx
add edi, eax
je 0x4b075e
test edi, edi
js 0x4b075e
mov ebx, dword [ebp - 0x270]
lea eax, [ebp - 0x264]
push eax
push 0x8004667e
push ebx
mov dword [ebp - 0x264], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push edi
push ebx
or edx, 0xffffffff
or ecx, 0xffffffff
call fcn.00492e70
add esp, 8
cmp eax, 0xffffffff
jne 0x4afe3e
mov eax, dword [ebp - 0x27c]
push str.SOCKS5:_no_connection_here
push dword [eax]
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
test eax, eax
jne 0x4afe54
mov eax, dword [ebp - 0x27c]
push str.SOCKS5:_connection_timeout
push dword [eax]
jmp 0x4b0764
test al, 4
je 0x4afe83
mov eax, dword [ebp - 0x27c]
push str.SOCKS5:_error_occurred_during_connection
push dword [eax]
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
cmp dword [ebp - 0x274], 0
mov byte [ebp - 0x260], 5
setne al
mov word [ebp - 0x25e], 0x100
add al, 2
mov byte [ebp - 0x25c], 2
mov byte [ebp - 0x25f], al
lea eax, [ebp - 0x264]
push eax
push 0x8004667e
push ebx
mov dword [ebp - 0x264], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea eax, [ebp - 0x26c]
mov edx, ebx
mov ebx, dword [ebp - 0x27c]
mov ecx, ebx
push eax
movzx eax, byte [ebp - 0x25f]
add eax, 2
push eax
lea eax, [ebp - 0x260]
push eax
call fcn.00490d30
add esp, 0xc
mov dword [ebp - 0x264], eax
test eax, eax
jne 0x4b073a
movzx ecx, byte [ebp - 0x25f]
add ecx, 2
cmp dword [ebp - 0x26c], ecx
jne 0x4b073a
lea eax, [ebp - 0x268]
mov dword [ebp - 0x268], 1
push eax
push 0x8004667e
push dword [ebp - 0x270]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push edi
mov edi, dword [ebp - 0x270]
or edx, 0xffffffff
push 0xffffffffffffffff
mov ecx, edi
call fcn.00492e70
add esp, 8
cmp eax, 0xffffffff
jne 0x4aff7a
push str.SOCKS5_nothing_to_read
push dword [ebx]
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
test eax, eax
jne 0x4aff8a
push str.SOCKS5_read_timeout
push dword [ebx]
jmp 0x4b0764
test al, 4
je 0x4affb3
push str.SOCKS5_read_error_occurred
push dword [ebx]
call fcn.004909c0
mov eax, 0x38
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, [ebp - 0x268]
mov dword [ebp - 0x268], 0
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea eax, [ebp - 0x268]
mov edx, edi
push eax
lea eax, [ebp - 0x260]
mov ecx, ebx
push 2
push eax
call fcn.004af470
add esp, 0xc
test eax, eax
jne 0x4b0716
cmp dword [ebp - 0x268], 2
jne 0x4b0716
cmp byte [ebp - 0x260], 5
je 0x4b002e
push str.Received_invalid_version_in_initial_SOCKS5_response.
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 al, byte [ebp - 0x25f]
test al, al
je 0x4b028a
cmp al, 1
jne 0x4b007f
mov ecx, dword [ebp - 0x278]
mov edx, ebx
call fcn.004cc830
mov dword [ebp - 0x264], eax
test eax, eax
je 0x4b028a
push str.Unable_to_negotiate_SOCKS5_gssapi_context.
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
cmp al, 2
jne 0x4b0229
mov edx, dword [ebp - 0x274]
test edx, edx
je 0x4b00cd
cmp dword [ebp - 0x288], 0
je 0x4b00cd
mov ebx, edx
lea ecx, [ebx + 1]
nop
mov al, byte [ebx]
inc ebx
test al, al
jne 0x4b00a0
sub ebx, ecx
mov ecx, dword [ebp - 0x288]
lea eax, [ecx + 1]
mov dword [ebp - 0x278], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4b00b8
sub ecx, dword [ebp - 0x278]
mov dword [ebp - 0x264], ecx
jmp 0x4b00d5
xor ebx, ebx
mov dword [ebp - 0x264], ebx
mov byte [ebp - 0x260], 1
mov byte [ebp - 0x25f], bl
test edx, edx
je 0x4b00fb
test ebx, ebx
je 0x4b00fb
push ebx
push edx
lea eax, [ebp - 0x25e]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0x288]
mov eax, dword [ebp - 0x264]
mov byte [ebp + ebx - 0x25e], al
test ecx, ecx
je 0x4b012e
test eax, eax
je 0x4b012e
push eax
push ecx
lea eax, [ebp + ebx - 0x25d]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x264]
add esp, 0xc
add ebx, 3
lea ecx, [ebp - 0x26c]
add eax, ebx
mov edx, edi
mov ebx, dword [ebp - 0x27c]
push ecx
push eax
mov dword [ebp - 0x278], eax
mov ecx, ebx
lea eax, [ebp - 0x260]
push eax
call fcn.00490d30
add esp, 0xc
mov dword [ebp - 0x264], eax
test eax, eax
jne 0x4b0205
mov eax, dword [ebp - 0x278]
cmp eax, dword [ebp - 0x26c]
jne 0x4b0205
lea eax, [ebp - 0x268]
mov edx, edi
push eax
lea eax, [ebp - 0x260]
mov ecx, ebx
push 2
push eax
call fcn.004af470
add esp, 0xc
test eax, eax
jne 0x4b01e1
cmp dword [ebp - 0x268], 2
jne 0x4b01e1
mov al, byte [ebp - 0x25f]
test al, al
je 0x4b028a
movzx eax, al
push eax
movzx eax, byte [ebp - 0x260]
push eax
push str.User_was_rejected_by_the_SOCKS5_server___d__d_.
push esi
call fcn.004909c0
add esp, 0x10
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.Unable_to_receive_SOCKS5_sub_negotiation_response.
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.Failed_to_send_SOCKS5_sub_negotiation_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
cmp al, 0xff
jne 0x4b0266
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x4b0241
cmp byte [eax], 0
mov eax, str.No_authentication_method_was_acceptable.
jne 0x4b0246
mov eax, 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._
push eax
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.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
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
cmp dword [ebp - 0x28c], 0
mov edi, 3
mov word [ebp - 0x260], 0x105
mov byte [ebp - 0x25e], 0
jne 0x4b02df
mov eax, dword [ebp - 0x280]
push eax
push dword [ebp - 0x284]
mov byte [ebp - 0x25c], al
lea eax, [ebp - 0x25b]
push eax
mov byte [ebp - 0x25d], 3
call sub.VCRUNTIME140.dll_memcpy
mov edi, dword [ebp - 0x280]
add esp, 0xc
add edi, 5
jmp 0x4b03c2
mov edx, dword [ebp - 0x284]
lea eax, [ebp - 0x274]
push eax
push dword [ebp + 0xc]
mov ecx, ebx
call fcn.00493ab0
add esp, 8
cmp eax, 0xffffffff
je 0x4b0700
cmp eax, 1
jne 0x4b0322
lea edx, [ebp - 0x274]
mov ecx, ebx
call fcn.0049da10
mov dword [ebp - 0x264], eax
test eax, eax
jne 0x4b0771
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x4b06ec
mov eax, dword [eax]
mov dword [ebp - 0x280], eax
test eax, eax
je 0x4b06ec
cmp dword [eax + 4], 2
jne 0x4b039e
mov byte [ebp - 0x25d], 1
lea ecx, [ebp - 0x25c]
mov ebx, dword [eax + 0x18]
mov edi, 4
sub ebx, ecx
lea ecx, [ebp - 0x25d]
add ebx, edi
lea eax, [ebx + edi]
mov al, byte [ebp + eax - 0x260]
mov byte [ebp + edi - 0x260], al
inc edi
movzx eax, byte [ecx + edi - 4]
push eax
push 0x598e1c
push esi
call fcn.00490900
add esp, 0xc
lea ecx, [ebp - 0x25d]
cmp edi, 8
jl 0x4b0365
mov ebx, dword [ebp - 0x27c]
jmp 0x4b03a8
mov dword [ebp - 0x280], 0
mov edx, dword [ebp - 0x274]
mov ecx, esi
call fcn.00493d40
cmp dword [ebp - 0x280], 0
je 0x4b06ec
mov ecx, dword [ebp + 0xc]
mov eax, ecx
sar eax, 8
mov byte [ebp + edi - 0x260], al
mov byte [ebp + edi - 0x25f], cl
add edi, 2
cmp dword [ebx + 0x5a8], 0
je 0x4b03fa
push str.SOCKS5_gssapi_protection_not_yet_implemented.
push esi
call fcn.004909c0
mov eax, dword [ebp - 0x264]
add esp, 8
jmp 0x4b0419
mov edx, dword [ebp - 0x270]
lea eax, [ebp - 0x26c]
push eax
lea eax, [ebp - 0x260]
mov ecx, ebx
push edi
push eax
call fcn.00490d30
add esp, 0xc
test eax, eax
jne 0x4b06c8
cmp edi, dword [ebp - 0x26c]
jne 0x4b06c8
lea edi, [eax + 0xa]
cmp dword [ebx + 0x5a8], eax
je 0x4b046a
push str.SOCKS5_gssapi_protection_not_yet_implemented.
push esi
call fcn.004909c0
add esp, 8
push str.Failed_to_receive_SOCKS5_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
mov edx, dword [ebp - 0x270]
lea eax, [ebp - 0x268]
push eax
lea eax, [ebp - 0x260]
mov ecx, ebx
push 0xa
push eax
call fcn.004af470
add esp, 0xc
test eax, eax
jne 0x4b0446
cmp dword [ebp - 0x268], edi
jne 0x4b0446
cmp byte [ebp - 0x260], 5
je 0x4b04c3
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
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 ah, byte [ebp - 0x25f]
mov al, byte [ebp - 0x25d]
test ah, ah
je 0x4b0635
cmp al, 1
jne 0x4b0537
movzx ecx, byte [ebp - 0x258]
movzx eax, ah
push eax
movzx eax, byte [ebp - 0x257]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x259]
push ecx
push eax
movzx eax, byte [ebp - 0x25a]
push eax
movzx eax, byte [ebp - 0x25b]
push eax
movzx eax, byte [ebp - 0x25c]
push eax
push str.Cant_complete_SOCKS5_connection_to__d._d._d._d:_d.___d_
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
cmp al, 3
jne 0x4b057d
movzx ecx, byte [ebp - 0x258]
movzx eax, ah
push eax
movzx eax, byte [ebp - 0x257]
shl ecx, 8
or ecx, eax
push ecx
push dword [ebp - 0x284]
push str.Cant_complete_SOCKS5_connection_to__s:_d.___d_
push esi
call fcn.004909c0
add esp, 0x14
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
cmp al, 4
jne 0x4b061f
movzx edx, byte [ebp - 0x258]
movzx ecx, byte [ebp - 0x257]
movzx eax, ah
push eax
mov eax, edx
shl eax, 8
or eax, ecx
push eax
movzx eax, byte [ebp - 0x24d]
push eax
movzx eax, byte [ebp - 0x24e]
push eax
movzx eax, byte [ebp - 0x24f]
push eax
movzx eax, byte [ebp - 0x250]
push eax
movzx eax, byte [ebp - 0x251]
push eax
movzx eax, byte [ebp - 0x252]
push eax
movzx eax, byte [ebp - 0x253]
push eax
movzx eax, byte [ebp - 0x254]
push eax
movzx eax, byte [ebp - 0x255]
push eax
movzx eax, byte [ebp - 0x256]
push eax
movzx eax, byte [ebp - 0x259]
push ecx
push edx
push eax
movzx eax, byte [ebp - 0x25a]
push eax
movzx eax, byte [ebp - 0x25b]
push eax
movzx eax, byte [ebp - 0x25c]
push eax
push str.Cant_complete_SOCKS5_connection_to__02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_d.___d_
push esi
call fcn.004909c0
add esp, 0x50
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
cmp al, 3
jne 0x4b0645
movzx edi, byte [ebp - 0x25c]
add edi, 7
jmp 0x4b064f
cmp al, 4
mov ecx, 0x16
cmove edi, ecx
cmp dword [ebx + 0x5a8], 0
jne 0x4b0693
cmp edi, 0xa
jbe 0x4b0693
mov edx, dword [ebp - 0x270]
lea eax, [ebp - 0x268]
push eax
sub edi, 0xa
lea eax, [ebp - 0x256]
push edi
push eax
mov ecx, ebx
call fcn.004af470
add esp, 0xc
test eax, eax
jne 0x4b0446
cmp edi, dword [ebp - 0x268]
jne 0x4b0446
lea eax, [ebp - 0x278]
mov dword [ebp - 0x278], 1
push eax
push 0x8004667e
push dword [ebp - 0x270]
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
push str.Failed_to_send_SOCKS5_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
push dword [ebp - 0x284]
push str.Failed_to_resolve___s__for_SOCKS5_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
push str.Unable_to_receive_initial_SOCKS5_response.
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.Unable_to_send_initial_SOCKS5_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
push str.Connection_time_out
push esi
call fcn.004909c0
mov eax, 0x1c
add esp, 8
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00523a6a
mov esp, ebp
pop ebp
ret