Function at 0x631ebd0d
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
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x84
mov dword [0x6757a354], 0
mov dword [esp + 4], str.Opening_connection_to_SOCKS_server._n
mov dword [esp], 0x1e
call fcn.631a9790
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
mov eax, dword [sym.imp.WSOCK32.DLL_socket]
call eax
sub esp, 0xc
mov dword [0x633ae3bc], eax
mov eax, dword [0x633ae3bc]
cmp eax, 0xffffffff
jne 0x631ebd87
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.WARNING:_NET_OpenSocks:_socket:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, dword [0x6757a364]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_gethostbyname]
call eax
sub esp, 4
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x631ebdc7
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.WARNING:_NET_OpenSocks:_gethostbyname:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, dword [ebp - 0x14]
movzx eax, word [eax + 8]
cmp ax, 2
je 0x631ebded
mov dword [esp + 4], str.WARNING:_NET_OpenSocks:_gethostbyname:_address_type_was_not_AF_INET_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov word [ebp - 0x2c], 2
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
mov eax, dword [0x6757a368]
mov eax, dword [eax + 0xc]
movzx eax, ax
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_htons]
call eax
sub esp, 4
mov word [ebp - 0x2a], ax
mov eax, dword [0x633ae3bc]
mov dword [esp + 8], 0x10
lea edx, [ebp - 0x2c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_connect]
call eax
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x631ebe64
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_connect:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, dword [0x6757a36c]
mov eax, dword [eax + 0xc]
movzx eax, byte [eax]
test al, al
jne 0x631ebe82
mov eax, dword [0x6757a370]
mov eax, dword [eax + 0xc]
movzx eax, byte [eax]
test al, al
je 0x631ebe8b
mov dword [ebp - 0x10], 1
jmp 0x631ebe92
mov dword [ebp - 0x10], 0
mov byte [ebp - 0x6c], 5
cmp dword [ebp - 0x10], 0
je 0x631ebea9
mov byte [ebp - 0x6b], 2
mov dword [ebp - 0xc], 4
jmp 0x631ebeb4
mov byte [ebp - 0x6b], 1
mov dword [ebp - 0xc], 3
mov byte [ebp - 0x6a], 0
cmp dword [ebp - 0x10], 0
je 0x631ebec2
mov byte [ebp - 0x6a], 2
mov eax, dword [0x633ae3bc]
mov dword [esp + 0xc], 0
mov edx, dword [ebp - 0xc]
mov dword [esp + 8], edx
lea edx, [ebp - 0x6c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_send]
call eax
sub esp, 0x10
cmp eax, 0xffffffff
jne 0x631ebf11
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_send:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, dword [0x633ae3bc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x40
lea edx, [ebp - 0x6c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_recv]
call eax
sub esp, 0x10
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x631ebf65
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_recv:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
cmp dword [ebp - 0xc], 2
jne 0x631ebf73
movzx eax, byte [ebp - 0x6c]
cmp al, 5
je 0x631ebf8c
mov dword [esp + 4], str.NET_OpenSocks:_bad_response_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
movzx eax, byte [ebp - 0x6b]
movzx eax, al
test eax, eax
je 0x631ebfb5
cmp eax, 2
je 0x631ebfb8
mov dword [esp + 4], str.NET_OpenSocks:_request_denied_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
nop
jmp 0x631ebfb9
nop
movzx eax, byte [ebp - 0x6b]
cmp al, 2
jne 0x631ec148
mov eax, dword [0x6757a36c]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.msvcr100.dll_strlen
mov dword [ebp - 0x18], eax
mov eax, dword [0x6757a370]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.msvcr100.dll_strlen
mov dword [ebp - 0x1c], eax
mov byte [ebp - 0x6c], 1
mov eax, dword [ebp - 0x18]
mov byte [ebp - 0x6b], al
cmp dword [ebp - 0x18], 0
je 0x631ec01c
mov edx, dword [ebp - 0x18]
mov eax, dword [0x6757a36c]
mov eax, dword [eax + 0xc]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
lea eax, [ebp - 0x6c]
add eax, 2
mov dword [esp], eax
call sub.msvcr100.dll_memcpy
mov eax, dword [ebp - 0x18]
add eax, 2
mov edx, dword [ebp - 0x1c]
mov byte [ebp + eax - 0x6c], dl
cmp dword [ebp - 0x1c], 0
je 0x631ec055
mov edx, dword [ebp - 0x1c]
mov eax, dword [0x6757a370]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x18]
lea ebx, [ecx + 3]
lea ecx, [ebp - 0x6c]
add ecx, ebx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], ecx
call sub.msvcr100.dll_memcpy
mov eax, dword [ebp - 0x18]
lea edx, [eax + 3]
mov eax, dword [ebp - 0x1c]
add edx, eax
mov eax, dword [0x633ae3bc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea edx, [ebp - 0x6c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_send]
call eax
sub esp, 0x10
cmp eax, 0xffffffff
jne 0x631ec0ac
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_send:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, dword [0x633ae3bc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x40
lea edx, [ebp - 0x6c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_recv]
call eax
sub esp, 0x10
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x631ec100
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_recv:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
cmp dword [ebp - 0xc], 2
jne 0x631ec10e
movzx eax, byte [ebp - 0x6c]
cmp al, 1
je 0x631ec127
mov dword [esp + 4], str.NET_OpenSocks:_bad_response_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
movzx eax, byte [ebp - 0x6b]
test al, al
je 0x631ec148
mov dword [esp + 4], str.NET_OpenSocks:_authentication_failed_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov byte [ebp - 0x6c], 5
mov byte [ebp - 0x6b], 3
mov byte [ebp - 0x6a], 0
mov byte [ebp - 0x69], 1
lea eax, [ebp - 0x6c]
add eax, 4
mov dword [eax], 0
mov eax, dword [ebp + 8]
movzx eax, ax
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_htons]
call eax
sub esp, 4
mov edx, eax
lea eax, [ebp - 0x6c]
add eax, 8
mov word [eax], dx
mov eax, dword [0x633ae3bc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xa
lea edx, [ebp - 0x6c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_send]
call eax
sub esp, 0x10
cmp eax, 0xffffffff
jne 0x631ec1d2
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_send:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, dword [0x633ae3bc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x40
lea edx, [ebp - 0x6c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_recv]
call eax
sub esp, 0x10
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x631ec226
call fcn.631e9415
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_recv:__s_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
cmp dword [ebp - 0xc], 1
jle 0x631ec234
movzx eax, byte [ebp - 0x6c]
cmp al, 5
je 0x631ec24d
mov dword [esp + 4], str.NET_OpenSocks:_bad_response_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
movzx eax, byte [ebp - 0x6b]
test al, al
je 0x631ec276
movzx eax, byte [ebp - 0x6b]
movzx eax, al
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_request_denied:__i_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
movzx eax, byte [ebp - 0x69]
cmp al, 1
je 0x631ec29f
movzx eax, byte [ebp - 0x69]
movzx eax, al
mov dword [esp + 8], eax
mov dword [esp + 4], str.NET_OpenSocks:_relay_address_is_not_IPV4:__i_n
mov dword [esp], 0x1e
call fcn.631a9790
jmp 0x631ec2f2
mov eax, 0x6757a37c
mov word [eax], 2
lea eax, [ebp - 0x6c]
add eax, 4
mov eax, dword [eax]
mov edx, 0x6757a37c
mov dword [edx + 4], eax
lea eax, [ebp - 0x6c]
add eax, 8
movzx eax, word [eax]
mov edx, 0x6757a37c
mov word [edx + 2], ax
mov eax, 0x6757a384
mov dword [esp + 8], 8
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcr100.dll_memset
mov dword [0x6757a354], 1
mov ebx, dword [ebp - 4]
leave
ret