Function at 0x402c60
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x50
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
push 1
mov esi, dword [ebp + 0xc]
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
jns 0x402c90
or esi, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
push eax
xor eax, eax
mov al, byte [edi]
push eax
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
js 0x402c82
mov byte [edi], 5
mov byte [edi + 1], 0
push 0
push 2
push edi
push ebx
call sub.WS2_32.DLL_send
test eax, eax
js 0x402c82
push eax
push 4
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
js 0x402c82
mov al, byte [edi + 1]
mov byte [ebp - 0x41], al
mov dl, byte [edi + 3]
cmp dl, 1
je 0x402d04
cmp dl, 3
je 0x402da5
cmp dl, 4
je 0x402d8d
push eax
xor eax, eax
mov al, dl
or esi, 0xffffffff
push eax
push str.SOCKS5_address_type_0x_02x_not_supported_n
push ebx
call fcn.00401410
add esp, 0x10
jmp 0x402c85
push eax
push 4
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
js 0x402c82
mov eax, dword [edi]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xe]
push 2
push eax
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
js 0x402c82
sub esp, 0xc
mov ax, word [ebp - 0xe]
and eax, 0xffff
push eax
call sub.WS2_32.DLL_htons
add esp, 0xc
mov word [ebp - 0xe], ax
cmp byte [ebp - 0x41], 1
je 0x402f41
cmp byte [ebp - 0x41], 2
je 0x402ec3
cmp byte [ebp - 0x41], 3
je 0x402de4
xor eax, eax
push edx
mov al, byte [ebp - 0x41]
or esi, 0xffffffff
push eax
push str.SOCKS5_command_0x_02x_not_supported_n
push ebx
call fcn.00401410
add esp, 0x10
jmp 0x402c85
push eax
push eax
push str.IPv6_not_supported_n
push ebx
or esi, 0xffffffff
call fcn.00401410
add esp, 0x10
jmp 0x402c85
push ecx
push 1
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
js 0x402c82
xor eax, eax
mov al, byte [edi]
push edx
mov dword [ebp - 0x48], eax
push eax
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
js 0x402c82
mov eax, dword [ebp - 0x48]
mov byte [edi + eax], 0
mov dword [ebp - 0x40], edi
jmp 0x402d25
push ecx
push ecx
push str.SOCKS5_UDP_binding_n
push ebx
call fcn.00401410
pop eax
mov eax, dword [0x40c028]
pop edx
push eax
lea eax, [ebp - 0x28]
push eax
mov word [ebp - 0x26], 0
call fcn.00401810
add esp, 0x10
mov dword [ebp - 0x4c], eax
test eax, eax
js 0x402c82
push eax
push eax
push 0
push ebx
call fcn.00401540
add esp, 0x10
mov edx, eax
cmp eax, 0xffffffff
je 0x402c82
mov ax, word [ebp - 0x26]
sub esp, 0xc
and eax, 0xffff
mov dword [ebp - 0x14], edx
push eax
call sub.WS2_32.DLL_ntohs
mov word [ebp - 0xe], ax
and eax, 0xffff
push ecx
push ecx
push eax
push str.SOCKS5_UDP_assigned_port__hu_n
push ebx
call fcn.00401410
add esp, 0x20
mov byte [edi], 5
mov byte [edi + 1], 0
mov byte [edi + 2], 0
mov byte [edi + 3], 1
mov eax, dword [ebp - 0x14]
mov dx, word [ebp - 0xe]
mov dword [edi + 4], eax
mov eax, edx
shr ax, 8
mov byte [edi + 9], dl
mov byte [edi + 8], al
push 0
push 0xa
push edi
push ebx
call sub.WS2_32.DLL_send
test eax, eax
js 0x402c82
cmp byte [ebp - 0x41], 2
je 0x402fd3
cmp byte [ebp - 0x41], 3
jne 0x402c85
lea eax, [ebp - 0x28]
or esi, 0xffffffff
push eax
mov eax, dword [ebp - 0x4c]
push edi
push eax
push ebx
call fcn.004028e0
add esp, 0x10
jmp 0x402c85
push ecx
push ecx
push str.SOCKS5_TCP_binding_n
push ebx
call fcn.00401410
pop eax
mov eax, dword [0x40c028]
pop edx
push eax
lea eax, [ebp - 0x28]
push eax
mov word [ebp - 0x26], 0
call fcn.00401960
add esp, 0x10
mov dword [ebp - 0x4c], eax
test eax, eax
js 0x402c82
push ecx
push ecx
push 0
push ebx
call fcn.00401540
add esp, 0x10
mov edx, eax
cmp eax, 0xffffffff
je 0x402c82
mov ax, word [ebp - 0x26]
sub esp, 0xc
and eax, 0xffff
mov dword [ebp - 0x14], edx
push eax
call sub.WS2_32.DLL_ntohs
mov word [ebp - 0xe], ax
and eax, 0xffff
push edx
push edx
push eax
push str.SOCKS5_TCP_assigned_port__hu_n
push ebx
call fcn.00401410
add esp, 0x20
jmp 0x402e5d
sub esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
call sub.WS2_32.DLL_inet_ntoa
sub esp, 0xc
push eax
lea eax, [ebp - 0x38]
push eax
call sub.msvcrt.dll_strcpy
mov ecx, dword [ebp - 0x40]
add esp, 0x20
mov ax, word [ebp - 0xe]
lea edx, [ebp - 0x38]
test ecx, ecx
je 0x402f6e
mov edx, dword [ebp - 0x40]
and eax, 0xffff
push eax
push edx
push str.SOCKS5_TCP__s:_hu_n
push ebx
call fcn.00401410
pop eax
mov eax, dword [ebp + 0x14]
pop edx
push eax
mov ax, word [ebp - 0xe]
and eax, 0xffff
push eax
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x40]
push eax
push esi
push ebx
call fcn.00402240
add esp, 0x20
mov esi, eax
test eax, eax
js 0x402c82
push eax
push eax
lea eax, [ebp - 0xe]
push eax
push esi
call fcn.00401540
add esp, 0x10
cmp eax, 0xffffffff
je 0x402c82
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x4c], 0
jmp 0x402e5d
sub esp, 0xc
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x18], 0x10
push eax
call fcn.00401640
add esp, 0x10
test eax, eax
js 0x402c82
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x4c]
push eax
call sub.WS2_32.DLL_accept
mov esi, eax
pop eax
test esi, esi
js 0x402c82
push eax
mov ax, word [ebp - 0xe]
and eax, 0xffff
push eax
push str.SOCKS5_connected_to_TCP_bound_port__hu_n
push esi
call fcn.00401410
add esp, 0x10
jmp 0x402c85