Function at 0x41f130
Capabilities:
Resolve function by parsing pe exports
Set socket configuration

Disassembly:
sub esp, 0x2cc
mov eax, dword [0x751f00]
xor eax, esp
mov dword [esp + 0x2c4], eax
mov eax, dword [esp + 0x2d0]
push ebx
mov ebx, dword [esp + 0x2e0]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x2dc]
mov dword [esp + 0x28], ecx
mov ecx, dword [ebx + eax*4 + 0x1a0]
xor eax, eax
cmp dword [ebx + 0xd8], 5
push ebp
sete al
push esi
mov esi, dword [ebx]
push edi
mov dword [esp + 0x28], edx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x10], esi
mov ebp, eax
mov eax, edx
mov dword [esp + 0x2c], ebp
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x41f191
sub eax, edi
cmp dword [ebx + 0x2b0], 0
mov dword [esp + 0x1c], eax
je 0x41f1bf
mov ecx, dword [esp + 0x2e4]
push ecx
push edx
push str.SOCKS5:_connecting_to_HTTP_proxy__s_port__d_n
mov ecx, esi
call fcn.0040f940
add esp, 0xc
test ebp, ebp
jne 0x41f1e9
cmp dword [esp + 0x1c], 0xff
jbe 0x41f1e9
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebx]
push edx
push str.SOCKS5:_server_resolving_disabled_for_hostnames_of_length___255__actual_len_zu__n
call fcn.0040f940
add esp, 8
mov dword [esp + 0x2c], 1
mov eax, dword [esi + 0x1e0]
xor ecx, ecx
xor ebp, ebp
mov edi, 0x493e0
test eax, eax
jle 0x41f1ff
lea ecx, [ebp + 1]
mov edx, dword [esi + 0x1e4]
test edx, edx
jle 0x41f20c
or ecx, 2
sub ecx, 1
je 0x41f221
sub ecx, 1
je 0x41f21f
sub ecx, 1
jne 0x41f226
cmp eax, edx
jl 0x41f221
mov eax, edx
cdq
mov ebp, edx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
mov esi, edx
mov edx, dword [esp + 0x10]
mov edx, dword [edx + 0x614]
shr esi, 6
mov eax, esi
imul eax, eax, 0x3e8
sub ecx, eax
imul ecx, ecx, 0x3e8
mov eax, ecx
push 0xffffffffffffffff
sub eax, edx
cdq
push 0xfffffc18
push edx
push eax
call fcn.0056a120
mov ecx, eax
mov eax, edx
mov edx, dword [esp + 0x10]
mov dword [esp + 0x14], eax
mov eax, esi
sub eax, dword [edx + 0x610]
imul eax, eax, 0x3e8
cdq
sub ecx, eax
mov eax, dword [esp + 0x14]
sbb eax, edx
add edi, ecx
adc ebp, eax
mov eax, edi
or eax, ebp
je 0x41f29e
test ebp, ebp
jg 0x41f2b6
jl 0x41f29e
test edi, edi
jae 0x41f2b6
mov eax, dword [esp + 0x10]
push str.Connection_time_out
call fcn.0040f9d0
mov eax, 0x1c
jmp 0x41f97e
mov esi, dword [esp + 0x30]
lea ecx, [esp + 0x14]
push ecx
push 0x8004667e
push esi
mov dword [esp + 0x20], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push ebp
push edi
push esi
push 0xffffffffffffffff
push 0xffffffffffffffff
call fcn.0040ef40
add esp, 0x14
cmp eax, 0xffffffff
jne 0x41f2f3
mov eax, dword [ebx]
push str.SOCKS5:_no_connection_here
jmp 0x41f974
test eax, eax
jne 0x41f30d
mov eax, dword [ebx]
push str.SOCKS5:_connection_timeout
call fcn.0040f9d0
mov eax, 0x1c
jmp 0x41f97e
test al, 4
je 0x41f31d
mov eax, dword [ebx]
push str.SOCKS5:_error_occurred_during_connection
jmp 0x41f974
cmp dword [esp + 0x18], 0
lea eax, [esp + 0x14]
push eax
setne dl
push 0x8004667e
inc dl
push esi
mov byte [esp + 0x44], 5
mov byte [esp + 0x45], dl
mov byte [esp + 0x46], 0
mov byte [esp + 0x47], 2
mov dword [esp + 0x20], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, dword [esp + 0x2e4]
mov edx, dword [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x14]
push edx
push str.SOCKS5_communication_to__s:_d_n
call fcn.0040f940
movzx ecx, byte [esp + 0x45]
add esp, 0xc
lea eax, [esp + 0x24]
push eax
add ecx, 2
push ecx
lea edx, [esp + 0x40]
push edx
mov edx, esi
mov eax, ebx
call fcn.0040fc90
add esp, 0xc
test eax, eax
jne 0x41f96b
movzx eax, byte [esp + 0x39]
add eax, 2
cmp dword [esp + 0x24], eax
jne 0x41f96b
lea ecx, [esp + 0x14]
push ecx
push 0x8004667e
push esi
mov dword [esp + 0x20], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push ebp
push edi
push 0xffffffffffffffff
push 0xffffffffffffffff
push esi
call fcn.0040ef40
add esp, 0x14
cmp eax, 0xffffffff
jne 0x41f3e3
mov eax, dword [ebx]
push str.SOCKS5_nothing_to_read
jmp 0x41f974
test eax, eax
jne 0x41f3fd
mov eax, dword [ebx]
push str.SOCKS5_read_timeout
call fcn.0040f9d0
mov eax, 0x1c
jmp 0x41f97e
test al, 4
je 0x41f417
mov eax, dword [ebx]
push str.SOCKS5_read_error_occurred
call fcn.0040f9d0
mov eax, 0x38
jmp 0x41f97e
lea edx, [esp + 0x14]
push edx
push 0x8004667e
push esi
mov dword [esp + 0x20], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea eax, [esp + 0x20]
push eax
push 2
lea ecx, [esp + 0x40]
push ecx
push esi
push ebx
call fcn.0041ea00
add esp, 0x14
test eax, eax
jne 0x41f964
cmp dword [esp + 0x20], 2
jne 0x41f964
cmp byte [esp + 0x38], 5
je 0x41f46a
push str.Received_invalid_version_in_initial_SOCKS5_response.
jmp 0x41f970
mov al, byte [esp + 0x39]
test al, al
je 0x41f598
cmp al, 2
jne 0x41f933
mov edi, dword [esp + 0x18]
test edi, edi
je 0x41f4b2
mov esi, dword [esp + 0x34]
test esi, esi
je 0x41f4b2
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x41f493
sub eax, edx
mov ecx, eax
mov eax, esi
mov dword [esp + 0x18], ecx
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x41f4a7
sub eax, esi
jmp 0x41f4ba
xor ecx, ecx
mov dword [esp + 0x18], ecx
xor eax, eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x38], 1
mov byte [esp + 0x39], cl
test edi, edi
je 0x41f4ea
test ecx, ecx
je 0x41f4ea
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x3e]
push edi
push eax
call fcn.0055f610
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
add esp, 0xc
lea esi, [ecx + 2]
mov ecx, dword [esp + 0x34]
mov byte [esp + esi + 0x38], al
inc esi
test ecx, ecx
je 0x41f511
test eax, eax
je 0x41f511
mov edx, dword [esp + 0x14]
push edx
push ecx
lea eax, [esp + esi + 0x40]
push eax
call fcn.0055f610
add esp, 0xc
add esi, dword [esp + 0x14]
mov edi, dword [esp + 0x30]
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x3c]
push esi
push edx
mov edx, edi
mov eax, ebx
call fcn.0040fc90
add esp, 0xc
test eax, eax
jne 0x41f92c
cmp esi, dword [esp + 0x24]
jne 0x41f92c
lea eax, [esp + 0x20]
push eax
push 2
lea ecx, [esp + 0x40]
push ecx
push edi
push ebx
call fcn.0041ea00
add esp, 0x14
test eax, eax
jne 0x41f925
cmp dword [esp + 0x20], 2
jne 0x41f925
mov al, byte [esp + 0x39]
test al, al
je 0x41f598
movzx edx, al
movzx eax, byte [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0x18]
push str.User_was_rejected_by_the_SOCKS5_server___d__d_.
call fcn.0040f9d0
add esp, 0xc
mov eax, 7
jmp 0x41f981
cmp dword [esp + 0x2c], 0
mov byte [esp + 0x38], 5
mov byte [esp + 0x39], 1
mov byte [esp + 0x3a], 0
mov ebp, 3
jne 0x41f660
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x28]
push eax
push ecx
lea edx, [esp + 0x45]
push edx
mov byte [esp + 0x47], 3
mov byte [esp + 0x48], al
call fcn.0055f610
mov ebp, dword [esp + 0x28]
add esp, 0xc
add ebp, 5
mov eax, dword [esp + 0x2e4]
mov edi, dword [esp + 0x30]
mov ecx, eax
sar ecx, 8
mov byte [esp + ebp + 0x38], cl
inc ebp
mov byte [esp + ebp + 0x38], al
lea edx, [esp + 0x24]
push edx
inc ebp
lea eax, [esp + 0x3c]
push ebp
push eax
mov edx, edi
mov eax, ebx
call fcn.0040fc90
add esp, 0xc
test eax, eax
jne 0x41f91e
cmp ebp, dword [esp + 0x24]
jne 0x41f91e
lea ecx, [esp + 0x20]
push ecx
lea esi, [eax + 0xa]
push esi
lea edx, [esp + 0x40]
push edx
push edi
push ebx
call fcn.0041ea00
add esp, 0x14
test eax, eax
jne 0x41f7a5
cmp dword [esp + 0x20], esi
jne 0x41f7a5
cmp byte [esp + 0x38], 5
je 0x41f76e
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
jmp 0x41f970
mov ecx, dword [esp + 0x2e4]
mov edx, dword [esp + 0x28]
lea eax, [esp + 0x18]
push eax
push ecx
push edx
push ebx
call fcn.0040e140
add esp, 0x10
cmp eax, 0xffffffff
je 0x41f764
cmp eax, 1
jne 0x41f6a0
lea eax, [esp + 0x18]
push eax
mov edi, ebx
call fcn.0040eb50
add esp, 4
test eax, eax
jne 0x41f981
mov eax, dword [esp + 0x18]
test eax, eax
je 0x41f74e
mov eax, dword [eax]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x41f74e
mov edi, eax
push 0x40
lea esi, [esp + 0x294]
mov ecx, edi
call fcn.0040dda0
add esp, 4
cmp dword [edi + 4], 2
jne 0x41f715
mov byte [esp + 0x3b], 1
mov eax, dword [edi + 0x18]
movzx ecx, byte [eax + 4]
mov byte [esp + 0x3c], cl
movzx edx, byte [eax + 5]
mov byte [esp + 0x3d], dl
movzx ecx, byte [eax + 6]
mov byte [esp + 0x3e], cl
movzx edx, byte [eax + 7]
mov ecx, dword [esp + 0x10]
mov eax, esi
push eax
push str.SOCKS5_connect_to_IPv4__s__locally_resolved__n
mov byte [esp + 0x47], dl
mov ebp, 8
call fcn.0040f940
jmp 0x41f733
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x290]
push ecx
push str.SOCKS5_connection_to__s_not_supported_n
mov dword [esp + 0x24], 0
call fcn.0040f9d0
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
add esp, 8
call fcn.0040e2e0
cmp dword [esp + 0x1c], 0
jne 0x41f5de
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x10]
push edx
push str.Failed_to_resolve___s__for_SOCKS5_connect.
call fcn.0040f9d0
add esp, 8
mov eax, 6
jmp 0x41f981
mov al, byte [esp + 0x3b]
cmp al, 3
jne 0x41f7af
movzx esi, byte [esp + 0x3c]
add esi, 7
cmp esi, 0xa
jle 0x41f7be
lea eax, [esp + 0x20]
push eax
lea ebp, [esi - 0xa]
push ebp
lea ecx, [esp + 0x4a]
push ecx
push edi
push ebx
call fcn.0041ea00
add esp, 0x14
test eax, eax
jne 0x41f7a5
cmp ebp, dword [esp + 0x20]
je 0x41f7ba
push str.Failed_to_receive_SOCKS5_connect_request_ack.
jmp 0x41f970
cmp al, 4
jne 0x41f7be
mov esi, 0x16
jmp 0x41f783
mov al, byte [esp + 0x3b]
mov cl, byte [esp + 0x39]
test cl, cl
je 0x41f8f0
cmp al, 1
jne 0x41f815
movzx eax, byte [esp + 0x40]
movzx edx, cl
movzx ecx, byte [esp + 0x41]
push edx
movzx edx, byte [esp + 0x43]
shl eax, 8
or eax, ecx
movzx ecx, byte [esp + 0x41]
push eax
movzx eax, byte [esp + 0x46]
push edx
movzx edx, byte [esp + 0x48]
push eax
mov eax, dword [esp + 0x20]
push ecx
push edx
push str.Cant_complete_SOCKS5_connection_to__d._d._d._d:_d.___d_
call fcn.0040f9d0
add esp, 0x1c
mov eax, 7
jmp 0x41f981
cmp al, 3
jne 0x41f859
mov bl, byte [esp + esi + 0x36]
movzx ecx, byte [esp + esi + 0x37]
lea esi, [esp + esi + 0x38]
mov byte [esi - 2], 0
movzx eax, byte [esp + 0x39]
movzx edx, bl
push eax
shl edx, 8
or ecx, edx
push ecx
lea eax, [esp + 0x45]
push eax
mov eax, dword [esp + 0x1c]
push str.Cant_complete_SOCKS5_connection_to__s:_d.___d_
call fcn.0040f9d0
add esp, 0x10
mov eax, 7
jmp 0x41f981
cmp al, 4
jne 0x41f8e6
movzx edx, byte [esp + 0x4c]
movzx eax, byte [esp + 0x4d]
movzx ecx, cl
push ecx
movzx ecx, byte [esp + 0x4f]
shl edx, 8
or edx, eax
movzx eax, byte [esp + 0x4d]
push edx
movzx edx, byte [esp + 0x52]
push ecx
movzx ecx, byte [esp + 0x54]
push edx
movzx edx, byte [esp + 0x57]
push eax
movzx eax, byte [esp + 0x5a]
push ecx
movzx ecx, byte [esp + 0x5d]
push edx
movzx edx, byte [esp + 0x60]
push eax
movzx eax, byte [esp + 0x63]
push ecx
movzx ecx, byte [esp + 0x66]
push edx
movzx edx, byte [esp + 0x69]
push eax
movzx eax, byte [esp + 0x6c]
push ecx
movzx ecx, byte [esp + 0x6f]
push edx
movzx edx, byte [esp + 0x72]
push eax
movzx eax, byte [esp + 0x75]
push ecx
movzx ecx, byte [esp + 0x78]
push edx
push eax
mov eax, dword [esp + 0x54]
push ecx
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_
call fcn.0040f9d0
add esp, 0x4c
mov eax, 7
jmp 0x41f981
mov ecx, dword [esp + 0x10]
push str.SOCKS5_request_granted._n
call fcn.0040f940
add esp, 4
lea edx, [esp + 0x2c]
push edx
push 0x8004667e
push edi
mov dword [esp + 0x38], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x41f981
push str.Failed_to_send_SOCKS5_connect_request.
jmp 0x41f970
push str.Unable_to_receive_SOCKS5_sub_negotiation_response.
jmp 0x41f970
push str.Failed_to_send_SOCKS5_sub_negotiation_request.
jmp 0x41f970
cmp al, 1
jne 0x41f93e
push str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
jmp 0x41f970
cmp al, 0xff
jne 0x41f95d
mov eax, dword [esp + 0x18]
test eax, eax
je 0x41f956
cmp byte [eax], 0
je 0x41f956
push str.No_authentication_method_was_acceptable.
jmp 0x41f970
push 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._
jmp 0x41f970
push str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
jmp 0x41f970
push str.Unable_to_receive_initial_SOCKS5_response.
jmp 0x41f970
push str.Unable_to_send_initial_SOCKS5_request.
mov eax, dword [esp + 0x14]
call fcn.0040f9d0
mov eax, 7
add esp, 4
mov ecx, dword [esp + 0x2d4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0055e7fd
add esp, 0x2cc
ret