Function at 0x45d950
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
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x13c
push ebx
push esi
push edi
mov edi, ecx
call fcn.0045ddc0
cmp byte [edi + 0x4b], 0
mov eax, str.NO_Auth
mov ebx, dword [ebp + 8]
mov esi, str.RFC_1929_Auth
push ebx
cmove esi, eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push esi
mov esi, dword [ebp + 0xc]
movzx ecx, si
push ecx
push eax
push str._PROXY__Connecting_to__s:_d.___s_
call fcn.00456d60
add esp, 0x10
mov dword [edi + 0x14], ebx
mov word [edi + 0x18], si
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [edi], eax
cmp eax, 0xffffffff
jne 0x45d9d0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str._PROXY__ERROR:_Unable_to_create_socket.__WSAError:__p_
call fcn.00456d60
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov dword [esp + 0x3c], ebx
mov ebx, 2
push esi
mov word [esp + 0x3c], bx
call dword [sym.imp.WS2_32.dll_htons]
push 4
mov word [esp + 0x3e], ax
lea eax, [esp + 0x2c]
push eax
push 0x1006
push 0xffff
push dword [edi]
mov dword [esp + 0x3c], 0x3e8
call dword [sym.imp.WS2_32.dll_setsockopt]
push 0x10
lea eax, [esp + 0x3c]
push eax
push dword [edi]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x45da30
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str._PROXY__ERROR:_Cant_connect_to_server.__WSAError:__p_
jmp 0x45dd7b
mov cl, byte [edi + 0x4b]
test cl, cl
mov byte [esp + 0x10], 5
push 0
setne al
mov byte [esp + 0x16], 0
inc al
test cl, cl
mov byte [esp + 0x15], al
movzx eax, byte [esp + 0x17]
cmovne eax, ebx
mov byte [esp + 0x17], al
lea eax, [esp + 0x14]
push 4
push eax
push dword [edi]
call dword [sym.imp.WS2_32.dll_send]
push 0
push 2
lea eax, [esp + 0x1c]
push eax
push dword [edi]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
jne 0x45da8e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str._PROXY__ERROR:_Connection_setup_failed.__WSAError:__p_
jmp 0x45dd7b
mov ax, word [esp + 0x14]
cmp al, 5
je 0x45daa5
movzx eax, al
push eax
push str._PROXY__ERROR:_Invalid_SOCKS_version.___d___5_
jmp 0x45dd7b
test ah, ah
jne 0x45dac4
push str._PROXY__Server_accepted_NO_Auth_method
call fcn.00456d60
mov esi, dword [sym.imp.WS2_32.dll_send]
mov ebx, dword [sym.imp.WS2_32.dll_recv]
jmp 0x45dbb7
cmp ah, 2
jne 0x45dd72
cmp byte [edi + 0x4b], 0
je 0x45dd72
push str._PROXY__Server_accepted_RFC_1929_Auth_method
call fcn.00456d60
mov al, byte [edi + 0x2b]
mov edx, ebx
mov ebx, dword [edi + 0x2b]
add esp, 4
xor ecx, ecx
mov byte [esp + 0x48], 1
mov byte [esp + 0x49], al
test ebx, ebx
je 0x45db18
lea edx, [ebx + 2]
nop
cmp dword [edi + 0x2f], 0x10
lea eax, [edi + 0x1b]
jb 0x45db0c
mov eax, dword [edi + 0x1b]
mov al, byte [eax + ecx]
mov byte [esp + ecx + 0x4a], al
inc ecx
cmp ecx, ebx
jb 0x45db00
mov al, byte [edi + 0x43]
xor ecx, ecx
mov ebx, dword [edi + 0x43]
mov byte [esp + edx + 0x48], al
inc edx
test ebx, ebx
je 0x45db49
nop dword [eax]
cmp dword [edi + 0x47], 0x10
lea eax, [edi + 0x33]
jb 0x45db3c
mov eax, dword [edi + 0x33]
mov al, byte [eax + ecx]
inc ecx
mov byte [esp + edx + 0x48], al
inc edx
cmp ecx, ebx
jb 0x45db30
mov esi, dword [sym.imp.WS2_32.dll_send]
lea eax, [esp + 0x48]
push 0
push edx
push eax
push dword [edi]
call esi
mov ebx, dword [sym.imp.WS2_32.dll_recv]
lea eax, [esp + 0x18]
push 0
push 2
push eax
push dword [edi]
call ebx
cmp eax, 0xffffffff
jne 0x45db84
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str._PROXY__ERROR:_Authentication_failed.__WSAError:__p_
jmp 0x45dd7b
mov ax, word [esp + 0x18]
cmp al, 1
je 0x45db9b
movzx eax, al
push eax
push str._PROXY__ERROR:_Invalid_subnegotiation_version.___d___1_
jmp 0x45dd7b
test ah, ah
je 0x45dbad
movzx eax, ah
push eax
push str._PROXY__ERROR:_Invalid_status.___d___0_
jmp 0x45dd7b
push str._PROXY__Auth_OK._Connecting...
call fcn.00456d60
add esp, 4
mov dword [esp + 0x1c], 0x1000305
push 0x5bd0c0
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x20], eax
movzx eax, word [0x5bd2c0]
push eax
call dword [sym.imp.WS2_32.dll_htons]
push 0
mov word [esp + 0x28], ax
lea eax, [esp + 0x20]
push 0xa
push eax
push dword [edi]
call esi
push 0
push 0xa
lea eax, [esp + 0x34]
push eax
push dword [edi]
call ebx
cmp eax, 0xffffffff
jne 0x45dc14
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str._PROXY__ERROR:_Connection_failed.__WSAError:__p_
jmp 0x45dd7b
mov al, byte [esp + 0x2c]
cmp al, 5
jne 0x45da97
movzx eax, byte [esp + 0x2d]
cmp eax, 8
ja case.default.0x45dc2e
jmp dword [eax*4 + 0x45dd98]
push str._PROXY__Connection_succeeded
call fcn.00456d60
mov eax, 2
mov byte [edi + 0x1a], 1
mov word [edi + 4], ax
add esp, 4
mov ax, word [esp + 0x34]
mov word [edi + 6], ax
mov eax, dword [esp + 0x30]
mov dword [edi + 8], eax
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_General_SOCKS_server_failure
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_Connection_not_allowed_by_ruleset
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_Network_unreachable
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_Host_unreachable
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_Connection_refused
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_TTL_expired
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_Command_not_supported
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push str._PROXY__ERROR:_Address_type_not_supported
call fcn.00456d60
add esp, 4
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push eax
push str._PROXY__ERROR:_Unknown:__d
jmp 0x45dd7b
movzx eax, ah
push eax
push str._PROXY__Server_accepted_invalid_method.___d_
call fcn.00456d60
add esp, 8
push dword [edi]
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8