Function at 0x50a400
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x204
test eax, eax
push ebx
push ebp
push esi
push edi
mov ebx, ecx
je 0x50a9a8
push 0
lea eax, [ebx + 0x8c]
push 0
push eax
call fcn.00508a90
test eax, eax
je 0x50a9a8
mov eax, dword [ebx + 4]
mov byte [esp + 0x14], 5
cmp eax, 0xffffffff
mov byte [esp + 0x15], 2
mov byte [esp + 0x16], 0
mov byte [esp + 0x17], 2
mov esi, 4
mov ebp, 0xa
lea edi, [esp + 0x14]
je 0x50a9a8
lea ecx, [esp + 0x14]
test ecx, ecx
je 0x50a9a8
mov edx, dword [ebx + 4]
push 0
push esi
push edi
push edx
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x50a49f
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x50a988
dec ebp
test ebp, ebp
jle 0x50a988
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x50a4af
push eax
push 0x5a1094
add edi, eax
sub esi, eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
test esi, esi
jg 0x50a46a
mov eax, dword [ebx + 4]
mov esi, 2
cmp eax, 0xffffffff
mov ebp, 0xa
lea edi, [esp + 0x14]
je 0x50a9a8
mov ecx, dword [ebx + 4]
push 0
push esi
push edi
push ecx
call sub.WS2_32.dll_recv
cmp eax, 1
jge 0x50a502
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x50a731
dec ebp
test ebp, ebp
jle 0x50a731
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x50a512
push eax
push 0x5a1090
sub esi, eax
add edi, eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
test esi, esi
jg 0x50a4cd
mov al, byte [esp + 0x14]
cmp al, 5
je 0x50a569
movsx eax, al
push eax
push str.Socks5_Proxy:_invalid_version_0x_X__init_
push 1
push 0x596558
call fcn.004aa400
add esp, 0x10
mov eax, dword [ebx + 4]
cmp eax, 0xffffffff
je 0x50a9a8
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [ebx + 4]
push ecx
call sub.WS2_32.dll_closesocket
pop edi
pop esi
mov dword [ebx + 4], 0xffffffff
pop ebp
xor eax, eax
pop ebx
add esp, 0x204
ret 8
mov al, byte [esp + 0x15]
test al, al
je 0x50a785
cmp al, 2
je 0x50a587
movsx edx, al
push edx
push str.Socks5_Proxy:_invalid_auth_model_0x_X
jmp 0x50a979
lea ebp, [ebx + 0x10c]
push 0x581840
push ebp
call dword [sym.imp.MSVCRT.dll_strstr]
mov edx, eax
add esp, 8
test edx, edx
jne 0x50a5e9
push str.Socks5_Proxy:_enter_login__password_for_logon_
push 1
push 0x596558
call fcn.004aa400
mov eax, dword [ebx + 4]
add esp, 0xc
cmp eax, 0xffffffff
je 0x50a9a8
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [ebx + 4]
push ecx
call sub.WS2_32.dll_closesocket
pop edi
pop esi
mov dword [ebx + 4], 0xffffffff
pop ebp
xor eax, eax
pop ebx
add esp, 0x204
ret 8
mov al, dl
mov edi, ebp
sub al, bl
or ecx, 0xffffffff
sub al, 0xc
lea esi, [esp + 0x16]
mov byte [esp + 0x15], al
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x10], esi
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x10]
mov byte [esp + 0x14], 1
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [edx + 1]
or ecx, 0xffffffff
movsx edx, byte [esp + 0x15]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebp
mov byte [esp + edx + 0x16], cl
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [ebx + 4]
mov ebp, 0xa
not ecx
dec ecx
lea edi, [esp + 0x14]
mov esi, ecx
add esi, 2
cmp eax, 0xffffffff
je 0x50a9a8
test esi, esi
jl 0x50a9a8
jle 0x50a6ae
mov eax, dword [ebx + 4]
push 0
push esi
push edi
push eax
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x50a69a
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x50a536
dec ebp
test ebp, ebp
jle 0x50a536
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x50a6aa
push eax
push 0x5a1094
add edi, eax
sub esi, eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
test esi, esi
jg 0x50a665
mov eax, dword [ebx + 4]
mov esi, 2
cmp eax, 0xffffffff
mov ebp, 0xa
lea edi, [esp + 0x14]
je 0x50a9a8
mov edx, dword [ebx + 4]
push 0
push esi
push edi
push edx
call sub.WS2_32.dll_recv
cmp eax, 1
jge 0x50a6fd
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x50a988
dec ebp
test ebp, ebp
jle 0x50a988
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x50a70d
push eax
push 0x5a1090
sub esi, eax
add edi, eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
test esi, esi
jg 0x50a6c8
mov al, byte [esp + 0x14]
cmp al, 1
je 0x50a764
movsx ecx, al
push ecx
push str.Socks5_Proxy:_invalid_version_0x_X__auth_
push 1
push 0x596558
call fcn.004aa400
add esp, 0x10
mov eax, dword [ebx + 4]
cmp eax, 0xffffffff
je 0x50a9a8
push 2
push eax
call sub.WS2_32.dll_shutdown
mov edx, dword [ebx + 4]
push edx
call sub.WS2_32.dll_closesocket
pop edi
pop esi
mov dword [ebx + 4], 0xffffffff
pop ebp
xor eax, eax
pop ebx
add esp, 0x204
ret 8
mov al, byte [esp + 0x15]
test al, al
je 0x50a785
push str.Socks5_Proxy:_invalid_login_password
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
jmp 0x50a988
mov edx, dword [esp + 0x218]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, edx
mov dword [esp + 0x10], ecx
mov byte [esp + 0x18], cl
or ecx, 0xffffffff
lea ebp, [esp + 0x19]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x14], 5
mov edx, ecx
mov esi, edi
mov edi, ebp
mov byte [esp + 0x15], 1
shr ecx, 2
mov byte [esp + 0x16], 0
mov byte [esp + 0x17], 3
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x21c]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call sub.WS2_32.dll_htons
mov esi, dword [esp + 0x10]
mov ebp, 0xa
lea edi, [esp + 0x14]
mov word [esp + esi + 0x19], ax
mov eax, dword [ebx + 4]
add esi, 7
cmp eax, 0xffffffff
je 0x50a9a8
test esi, esi
jl 0x50a9a8
jle 0x50a856
mov ecx, dword [ebx + 4]
push 0
push esi
push edi
push ecx
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x50a842
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x50a731
dec ebp
test ebp, ebp
jle 0x50a731
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x50a852
push eax
push 0x5a1094
add edi, eax
sub esi, eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
test esi, esi
jg 0x50a80d
mov eax, dword [ebx + 4]
mov esi, 4
cmp eax, 0xffffffff
mov ebp, 0xa
lea edi, [esp + 0x14]
je 0x50a9a8
mov eax, dword [ebx + 4]
push 0
push esi
push edi
push eax
call sub.WS2_32.dll_recv
cmp eax, 1
jge 0x50a8a5
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x50a536
dec ebp
test ebp, ebp
jle 0x50a536
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x50a8b5
push eax
push 0x5a1090
sub esi, eax
add edi, eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
test esi, esi
jg 0x50a870
mov al, byte [esp + 0x14]
cmp al, 5
je 0x50a8cf
movsx edx, al
push edx
push str.Socks5_Proxy:_invalid_version_0x_X__connect_
jmp 0x50a979
mov al, byte [esp + 0x15]
test al, al
je 0x50a968
mov eax, dword [ebx + 4]
cmp eax, 0xffffffff
je 0x50a8fb
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [ebx + 4]
push ecx
call sub.WS2_32.dll_closesocket
mov dword [ebx + 4], 0xffffffff
movsx eax, byte [esp + 0x15]
dec eax
cmp eax, 7
ja case.default.0x50a906
jmp dword [eax*4 + 0x50a9d4]
push str.Socks5_Proxy:_general_SOCKS_server_failure
jmp 0x50a94a
push str.Socks5_Proxy:_connection_not_allowed_by_ruleset
jmp 0x50a94a
push str.Socks5_Proxy:_network_unreachable
jmp 0x50a94a
push str.Socks5_Proxy:_host_unreachable
jmp 0x50a94a
push str.Socks5_Proxy:_connection_refused
jmp 0x50a94a
push str.Socks5_Proxy:_TTL_expired
jmp 0x50a94a
push str.Socks5_Proxy:_command_not_supported
jmp 0x50a94a
push str.Socks5_Proxy:_address_type_not_supported
jmp 0x50a94a
push str.Socks5_Proxy:_unknown_error
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x204
ret 8
mov al, byte [esp + 0x17]
cmp al, 1
je 0x50a9b7
movsx edx, al
push edx
push str.Socks5_Proxy:_invalid_address_type_0x_X
push 1
push 0x596558
call fcn.004aa400
add esp, 0x10
mov eax, dword [ebx + 4]
cmp eax, 0xffffffff
je 0x50a9a8
push 2
push eax
call sub.WS2_32.dll_shutdown
mov eax, dword [ebx + 4]
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebx + 4], 0xffffffff
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x204
ret 8
lea ecx, [esp + 0x14]
push 6
push ecx
mov ecx, ebx
call fcn.0050aca0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x204
ret 8