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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x224
mov eax, dword [0x64786c]
xor eax, esp
mov dword [esp + 0x220], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x1c]
mov edx, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 0x18]
push edi
mov edi, dword [ebp + 8]
push ecx
mov ecx, dword [ebp + 0x24]
push edi
mov dword [esp + 0x20], esi
mov dword [esp + 0x2c], eax
mov byte [esp + 0x24], 5
mov byte [esp + 0x25], 1
call fcn.004079e0
add esp, 8
test eax, eax
je 0x4083bb
test ebx, ebx
jne 0x40836b
mov ebx, 0x612b02
test esi, esi
jne 0x408377
mov dword [esp + 0x18], 0x612b02
mov dl, byte [ebx]
push 0
neg dl
mov esi, 3
push esi
lea eax, [esp + 0x24]
sbb dl, dl
push eax
and dl, 2
push edi
mov byte [esp + 0x2e], dl
call sub.WS2_32.dll_send
cmp eax, esi
je 0x4083d2
cmp dword [0x653730], esi
jg 0x4083bb
push str.Fail_to_send_SOCK5_request_header.
push 0x190
push str....._base_srcwin32TSocket.c
push esi
call fcn.00401320
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x220]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x24]
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 2
lea ecx, [esp + 0x18]
push ecx
push edi
call sub.WS2_32.dll_recv
cmp eax, 2
je 0x408408
cmp dword [0x653730], esi
jg 0x4083bb
push str.Fail_to_read_method_response.
push 0x19a
jmp 0x4083ad
cmp dword [0x653730], 1
jg 0x408437
mov ax, word [esp + 0x10]
movsx edx, ah
push edx
movsx eax, al
push eax
push str.sock5_ver___d_method___d
push 0x19e
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x18
mov ax, word [esp + 0x10]
test ah, ah
je 0x4085a6
cmp ah, 2
je 0x408489
cmp dword [0x653730], esi
jg 0x4083bb
movsx ecx, ah
push ecx
push str.unsupported_method__d.
push 0x1a2
push str....._base_srcwin32TSocket.c
push 3
call fcn.00401320
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x220]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
mov eax, ebx
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408490
sub eax, edx
mov edx, eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x20], edx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4084a6
sub eax, esi
lea esi, [esp + 0x2a]
mov byte [esp + 0x28], 1
mov byte [esp + 0x29], dl
mov ecx, ebx
sub esi, ebx
mov dl, byte [ecx]
mov byte [esi + ecx], dl
inc ecx
test dl, dl
jne 0x4084c0
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
lea esi, [esp + ebx + 0x2b]
mov byte [esp + ebx + 0x2a], al
sub esi, ecx
lea esp, [esp]
mov dl, byte [ecx]
mov byte [esi + ecx], dl
inc ecx
test dl, dl
jne 0x4084e0
push 0
lea esi, [eax + ebx + 3]
push esi
lea edx, [esp + 0x30]
push edx
push edi
call sub.WS2_32.dll_send
cmp eax, esi
je 0x408523
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_send_credentials.
push 0x1b6
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
mov ecx, dword [ebp + 0x24]
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 2
lea eax, [esp + 0x18]
push eax
push edi
call sub.WS2_32.dll_recv
cmp eax, 2
je 0x40856c
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_auth_response.
push 0x1c0
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
cmp dword [0x653730], 1
jg 0x40859b
mov ax, word [esp + 0x10]
movsx ecx, ah
push ecx
movsx edx, al
push edx
push str.sock5_ver___d_status___d
push 0x1c4
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x18
cmp byte [esp + 0x11], 0
jne 0x4083bb
mov esi, dword [esp + 0x24]
mov eax, esi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4085b0
sub eax, edx
mov ebx, eax
lea edx, [esp + 0x2d]
mov byte [esp + 0x28], 5
mov byte [esp + 0x29], 1
mov byte [esp + 0x2a], cl
mov byte [esp + 0x2b], 3
mov byte [esp + 0x2c], bl
mov eax, esi
sub edx, esi
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4085e0
mov eax, dword [ebp + 0x20]
push eax
call sub.WS2_32.dll_htons
push 0
mov word [esp + ebx + 0x31], ax
add ebx, 7
push ebx
lea ecx, [esp + 0x30]
push ecx
push edi
call sub.WS2_32.dll_send
cmp eax, ebx
je 0x408630
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_send_SOCK5_command.
push 0x1dd
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
mov esi, dword [ebp + 0x24]
mov ecx, esi
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 4
lea edx, [esp + 0x20]
push edx
push edi
call sub.WS2_32.dll_recv
cmp eax, 4
je 0x40867b
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_command_result.
push 0x1ed
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
cmp dword [0x653730], 1
jg 0x4086b5
movsx eax, byte [esp + 0x1b]
movsx ecx, byte [esp + 0x1a]
push eax
mov eax, dword [esp + 0x1c]
push ecx
movsx edx, ah
push edx
movsx eax, al
push eax
push str.ver_d_rep_d_rsv_d_addr_type_d
push 0x1ff
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x20
mov al, byte [esp + 0x1b]
cmp al, 1
jne 0x408709
mov ecx, esi
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 4
lea ecx, [esp + 0x30]
push ecx
push edi
call sub.WS2_32.dll_recv
cmp eax, 4
je 0x4087e8
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_ipv4_address.
push 0x208
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
cmp al, 4
jne 0x408759
mov ecx, esi
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 0x10
lea edx, [esp + 0x30]
push edx
push edi
call sub.WS2_32.dll_recv
cmp eax, 0x10
je 0x4087e8
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_ipv6_address.
push 0x212
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
cmp al, 3
jne 0x4087e8
mov ecx, esi
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 1
lea eax, [esp + 0x1f]
push eax
push edi
call sub.WS2_32.dll_recv
cmp eax, 1
je 0x4087a9
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_length_of_domain_name.
push 0x21f
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
movzx ecx, byte [esp + 0x17]
push 0
push ecx
lea edx, [esp + 0x30]
push edx
push edi
call sub.WS2_32.dll_recv
movzx ecx, byte [esp + 0x17]
cmp eax, ecx
je 0x4087e8
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_domain_name.
push 0x225
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
mov ecx, esi
mov eax, edi
call fcn.00407b90
test eax, eax
jle 0x4083bb
push 0
push 2
lea edx, [esp + 0x28]
push edx
push edi
call sub.WS2_32.dll_recv
cmp eax, 2
je 0x408830
cmp dword [0x653730], 3
jg 0x4083bb
push str.Fail_to_read_port.
push 0x230
push str....._base_srcwin32TSocket.c
push 3
jmp 0x4083b3
mov ecx, dword [esp + 0x22c]
xor eax, eax
cmp byte [esp + 0x19], al
pop edi
pop esi
sete al
pop ebx
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret