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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x40
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
push 7
mov esi, dword [ebp + 0xc]
push edi
push ebx
call fcn.004018a0
add esp, 0x10
test eax, eax
jns 0x402690
or esi, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov al, byte [edi]
xor edx, edx
mov byte [ebp - 0x41], al
xor eax, eax
mov dl, byte [edi + 1]
mov al, byte [edi + 2]
shl edx, 8
or eax, edx
mov word [ebp - 0xe], ax
mov eax, dword [edi + 3]
mov dword [ebp - 0x14], eax
push eax
push 0x100
push edi
push ebx
call fcn.00401900
add esp, 0x10
test eax, eax
js 0x402682
sub esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
call sub.WS2_32.DLL_ntohl
mov dword [ebp - 0x40], 0
add esp, 0xc
shr eax, 8
je 0x402820
cmp byte [ebp - 0x41], 1
je 0x402840
cmp byte [ebp - 0x41], 2
je 0x40270e
xor eax, eax
push esi
mov al, byte [ebp - 0x41]
or esi, 0xffffffff
push eax
push str.SOCKS4_command_0x_02x_not_supported_n
push ebx
call fcn.00401410
add esp, 0x10
jmp 0x402685
push ecx
push ecx
push str.SOCKS4_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 - 0x48], eax
test eax, eax
js 0x402682
push ecx
push ecx
push 0
push ebx
call fcn.00401540
add esp, 0x10
mov edx, eax
cmp eax, 0xffffffff
je 0x402682
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.SOCKS4_TCP_assigned_port__hu_n
push ebx
call fcn.00401410
add esp, 0x20
mov byte [edi], 0
mov byte [edi + 1], 0x5a
mov dx, word [ebp - 0xe]
mov eax, edx
mov byte [edi + 3], dl
shr ax, 8
mov byte [edi + 2], al
mov eax, dword [ebp - 0x14]
mov dword [edi + 4], eax
push 0
push 8
push edi
push ebx
call sub.WS2_32.DLL_send
test eax, eax
js 0x402682
cmp byte [ebp - 0x41], 2
jne 0x402685
sub esp, 0xc
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x18], 0x10
push ecx
call fcn.00401640
add esp, 0x10
test eax, eax
js 0x402682
lea eax, [ebp - 0x18]
push edx
push eax
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x48]
push eax
call sub.WS2_32.DLL_accept
mov esi, eax
pop eax
test esi, esi
js 0x402682
push eax
mov ax, word [ebp - 0xe]
and eax, 0xffff
push eax
push str.SOCKS4_connected_to_TCP_bound_port__hu_n
push esi
call fcn.00401410
add esp, 0x10
jmp 0x402685
push eax
push 0x100
push edi
push ebx
call fcn.00401900
add esp, 0x10
test eax, eax
js 0x402682
mov dword [ebp - 0x40], edi
jmp 0x4026e1
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 0x40286d
mov edx, dword [ebp - 0x40]
and eax, 0xffff
push eax
push edx
push str.SOCKS4_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 0x402682
push eax
push eax
lea eax, [ebp - 0xe]
push eax
push esi
call fcn.00401540
add esp, 0x10
cmp eax, 0xffffffff
je 0x402682
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x48], 0
jmp 0x402787