Function at 0x409080
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 [0x698b9c]
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.00408750
add esp, 8
test eax, eax
je 0x40912b
test ebx, ebx
jne 0x4090db
mov ebx, 0x6650ae
test esi, esi
jne 0x4090e7
mov dword [esp + 0x18], 0x6650ae
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 0x409142
cmp dword [0x69aaa4], esi
jg 0x40912b
push str.Fail_to_send_SOCK5_request_header.
push 0x190
push str....._base_srcwin32TSocket.c
push esi
call fcn.00401310
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x220]
xor ecx, esp
call fcn.005bfcb8
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x24]
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 2
lea ecx, [esp + 0x18]
push ecx
push edi
call sub.WS2_32.dll_recv
cmp eax, 2
je 0x409178
cmp dword [0x69aaa4], esi
jg 0x40912b
push str.Fail_to_read_method_response.
push 0x19a
jmp 0x40911d
cmp dword [0x69aaa4], 1
jg 0x4091a7
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.00401310
add esp, 0x18
mov ax, word [esp + 0x10]
test ah, ah
je 0x409316
cmp ah, 2
je 0x4091f9
cmp dword [0x69aaa4], esi
jg 0x40912b
movsx ecx, ah
push ecx
push str.unsupported_method__d.
push 0x1a2
push str....._base_srcwin32TSocket.c
push 3
call fcn.00401310
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x220]
xor ecx, esp
call fcn.005bfcb8
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 0x409200
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 0x409216
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 0x409230
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 0x409250
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 0x409293
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_send_credentials.
push 0x1b6
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
mov ecx, dword [ebp + 0x24]
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 2
lea eax, [esp + 0x18]
push eax
push edi
call sub.WS2_32.dll_recv
cmp eax, 2
je 0x4092dc
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_auth_response.
push 0x1c0
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
cmp dword [0x69aaa4], 1
jg 0x40930b
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.00401310
add esp, 0x18
cmp byte [esp + 0x11], 0
jne 0x40912b
mov esi, dword [esp + 0x24]
mov eax, esi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409320
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 0x409350
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 0x4093a0
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_send_SOCK5_command.
push 0x1dd
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
mov esi, dword [ebp + 0x24]
mov ecx, esi
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 4
lea edx, [esp + 0x20]
push edx
push edi
call sub.WS2_32.dll_recv
cmp eax, 4
je 0x4093eb
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_command_result.
push 0x1ed
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
cmp dword [0x69aaa4], 1
jg 0x409425
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.00401310
add esp, 0x20
mov al, byte [esp + 0x1b]
cmp al, 1
jne 0x409479
mov ecx, esi
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 4
lea ecx, [esp + 0x30]
push ecx
push edi
call sub.WS2_32.dll_recv
cmp eax, 4
je 0x409558
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_ipv4_address.
push 0x208
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
cmp al, 4
jne 0x4094c9
mov ecx, esi
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 0x10
lea edx, [esp + 0x30]
push edx
push edi
call sub.WS2_32.dll_recv
cmp eax, 0x10
je 0x409558
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_ipv6_address.
push 0x212
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
cmp al, 3
jne 0x409558
mov ecx, esi
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 1
lea eax, [esp + 0x1f]
push eax
push edi
call sub.WS2_32.dll_recv
cmp eax, 1
je 0x409519
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_length_of_domain_name.
push 0x21f
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
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 0x409558
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_domain_name.
push 0x225
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
mov ecx, esi
mov eax, edi
call fcn.00408900
test eax, eax
jle 0x40912b
push 0
push 2
lea edx, [esp + 0x28]
push edx
push edi
call sub.WS2_32.dll_recv
cmp eax, 2
je 0x4095a0
cmp dword [0x69aaa4], 3
jg 0x40912b
push str.Fail_to_read_port.
push 0x230
push str....._base_srcwin32TSocket.c
push 3
jmp 0x409123
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.005bfcb8
mov esp, ebp
pop ebp
ret