Function at 0x41c920
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x260
mov eax, dword [0x4af890]
xor eax, ebp
mov dword [ebp - 4], eax
push str.Opening_connection_to_SOCKS_server._n
mov dword [0x5fa83c], 0
call fcn.0040cbe0
add esp, 4
push 6
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov dword [0x4ae1e8], eax
cmp eax, 0xffffffff
jne 0x41c981
call fcn.0041b5f0
push eax
push str.WARNING:_NET_OpenSocks:_socket:__s_n
call fcn.0040cbe0
add esp, 8
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
push 1
push 2
push 0x10
lea eax, [ebp - 0x25c]
push eax
mov eax, dword [0x5fa84c]
push dword [eax + 4]
call fcn.0041d3c0
add esp, 0x14
test eax, eax
jne 0x41c9c2
push str.NET_OpenSocks
push str.WARNING:__s_failed_n
call fcn.0040cbe0
add esp, 8
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
mov eax, dword [0x5fa850]
movzx eax, word [eax + 0x20]
push eax
call dword [sym.imp.WSOCK32.dll_htons]
mov word [ebp - 0x25a], ax
lea eax, [ebp - 0x25c]
push 0x10
push eax
push dword [0x4ae1e8]
call dword [sym.imp.WSOCK32.dll_connect]
cmp eax, 0xffffffff
jne 0x41ca19
call fcn.0041b5f0
push eax
push str.NET_OpenSocks
push str._s:_connect:__s_n
call fcn.0040cbe0
add esp, 0xc
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
mov eax, dword [0x5fa854]
mov byte [ebp - 0x208], 5
mov eax, dword [eax + 4]
cmp byte [eax], 0
jne 0x41ca4a
mov eax, dword [0x5fa858]
mov eax, dword [eax + 4]
cmp byte [eax], 0
jne 0x41ca4a
mov word [ebp - 0x207], 1
mov eax, 3
jmp 0x41ca5f
mov word [ebp - 0x207], 2
mov eax, 4
mov byte [ebp - 0x205], 2
push edi
mov edi, dword [sym.imp.WSOCK32.dll_send]
push 0
push eax
lea eax, [ebp - 0x208]
push eax
push dword [0x4ae1e8]
call edi
cmp eax, 0xffffffff
jne 0x41caa4
call fcn.0041b5f0
push eax
push str.NET_OpenSocks
push str._s:_send:__s_n
call fcn.0040cbe0
add esp, 0xc
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [sym.imp.WSOCK32.dll_recv]
lea eax, [ebp - 0x208]
push 0
push 0x20
push eax
push dword [0x4ae1e8]
call esi
cmp eax, 0xffffffff
je 0x41cc89
cmp eax, 2
jne 0x41cd81
cmp byte [ebp - 0x208], 5
jne 0x41cd81
mov cl, byte [ebp - 0x207]
movzx eax, cl
sub eax, 0
je 0x41caff
sub eax, 2
je 0x41caff
push str.NET_OpenSocks
push str._s:_unsupported_auth.method_n
jmp 0x41cd8b
cmp cl, 2
jne 0x41cc0d
mov edx, dword [0x5fa854]
push ebx
mov ebx, dword [edx + 4]
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x41cb15
sub ebx, ecx
mov ecx, dword [0x5fa858]
mov ecx, dword [ecx + 4]
lea eax, [ecx + 1]
mov dword [ebp - 0x260], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x41cb30
sub ecx, dword [ebp - 0x260]
mov dword [ebp - 0x260], ecx
cmp ebx, 0xff
jle 0x41cb50
mov ebx, 0xff
cmp ecx, 0xff
jle 0x41cb62
mov dword [ebp - 0x260], 0xff
mov byte [ebp - 0x208], 1
mov byte [ebp - 0x207], bl
test ebx, ebx
je 0x41cb86
push ebx
push dword [edx + 4]
lea eax, [ebp - 0x206]
push eax
call fcn.0046dbd0
add esp, 0xc
mov eax, dword [ebp - 0x260]
mov byte [ebp + ebx - 0x206], al
test eax, eax
je 0x41cbb7
push eax
mov eax, dword [0x5fa858]
push dword [eax + 4]
lea eax, [ebp - 0x205]
add eax, ebx
push eax
call fcn.0046dbd0
mov eax, dword [ebp - 0x260]
add esp, 0xc
push 0
add ebx, 3
add eax, ebx
push eax
lea eax, [ebp - 0x208]
push eax
push dword [0x4ae1e8]
call edi
pop ebx
cmp eax, 0xffffffff
je 0x41cc49
push 0
push 0x40
lea eax, [ebp - 0x208]
push eax
push dword [0x4ae1e8]
call esi
cmp eax, 0xffffffff
je 0x41cc89
cmp eax, 2
jne 0x41cbfe
cmp byte [ebp - 0x208], 1
je 0x41cc0d
push str.NET_OpenSocks
push str._s:_bad_auth_response_n
jmp 0x41cd8b
push dword [ebp + 8]
mov dword [ebp - 0x24c], 0x1000305
mov dword [ebp - 0x248], 0
call dword [sym.imp.WSOCK32.dll_htons]
push 0
mov word [ebp - 0x244], ax
lea eax, [ebp - 0x24c]
push 0xa
push eax
push dword [0x4ae1e8]
call edi
cmp eax, 0xffffffff
jne 0x41cc71
call fcn.0041b5f0
push eax
push str.NET_OpenSocks
push str._s:_send:__s_n
call fcn.0040cbe0
add esp, 0xc
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
push 0
push 0x44
lea eax, [ebp - 0x24c]
push eax
push dword [0x4ae1e8]
call esi
cmp eax, 0xffffffff
jne 0x41ccb1
call fcn.0041b5f0
push eax
push str.NET_OpenSocks
push str._s:_recv:__s_n
call fcn.0040cbe0
add esp, 0xc
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
cmp eax, 0xa
jl 0x41cd75
cmp byte [ebp - 0x24c], 5
jne 0x41cd75
mov al, byte [ebp - 0x24b]
test al, al
je 0x41ccf7
movzx eax, al
push eax
push str.NET_OpenSocks
push str._s:_request_denied:__i_n
call fcn.0040cbe0
add esp, 0xc
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
mov al, byte [ebp - 0x249]
cmp al, 1
je 0x41cd27
movzx eax, al
push eax
push str.NET_OpenSocks
push str._s:_relay_address_is_not_IPV4:__i_n
call fcn.0040cbe0
add esp, 0xc
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
push 0x78
push 0
push 0x5fa880
call fcn.0046e6d0
add esp, 0xc
mov dword [0x5fa83c], 1
mov eax, 2
mov word [0x5fa878], ax
mov eax, dword [ebp - 0x248]
mov dword [0x5fa87c], eax
mov ax, word [ebp - 0x244]
pop esi
mov word [0x5fa87a], ax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
push str.NET_OpenSocks
push str._s:_bad_response_n
jmp 0x41cd8b
push str.NET_OpenSocks
push str._s:_bad_auth.method_response_n
call fcn.0040cbe0
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
pop esi
pop edi
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret