Function at 0x40d240
Capabilities:
Get local ipv4 addresses
Get socket information
Print debug messages
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x23c
mov eax, dword [0x4a2300]
xor eax, esp
mov dword [esp + 0x238], eax
push ebx
push esi
push edi
xor edi, edi
mov dword [esp + 0xc], edx
push 0xff
lea eax, [esp + 0x145]
mov dword [esp + 0x14], edi
push edi
push eax
mov esi, ecx
mov byte [esp + 0x14c], 0
call fcn.00451650
xor eax, eax
mov dword [esp + 0x20], 0x10
add esp, 0xc
mov word [esp + 0x18], ax
mov dword [esp + 0x22], eax
xorps xmm0, xmm0
mov word [esp + 0x26], ax
mov word [esp + 0x28], ax
mov dword [esp + 0x32], eax
mov word [esp + 0x36], ax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x1c]
movq qword [esp + 0x1e], xmm0
push eax
push esi
movq qword [esp + 0x36], xmm0
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x40d6a5
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0x10
push eax
lea eax, [esp + 0x2c]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x40d6a5
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
mov ebx, eax
test ebx, ebx
je 0x40d6a5
push 0x20
push ebx
push esi
mov esi, dword [sym.imp.WS2_32.dll_WSAEventSelect]
call esi
cmp eax, 0xffffffff
je 0x40d695
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
mov edi, eax
test edi, edi
je 0x40d695
push 0x21
push edi
push dword [esp + 0x14]
call esi
cmp eax, 0xffffffff
je 0x40d695
push 0x90
lea eax, [esp + 0x3e]
push 0
push eax
call fcn.00451650
xor eax, eax
mov edx, dword [ebp + 8]
mov word [esp + 0x4c], ax
add esp, 0xc
mov ax, word [esp + 0x1a]
mov ecx, dword [esp + 0x1c]
mov word [esp + 0x46], ax
mov word [esp + 0x80], ax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x74], eax
mov eax, dword [0x6ae3c0]
mov dword [esp + 0x4c], eax
mov eax, dword [0x6ae3c4]
mov dword [esp + 0x50], eax
mov eax, dword [0x6ae3b8]
mov dword [esp + 0x54], eax
mov eax, dword [0x6ae3bc]
mov dword [esp + 0x58], eax
mov eax, dword [0x6ae3c8]
mov dword [esp + 0x68], eax
mov eax, dword [0x6ae3cc]
mov dword [esp + 0x6c], eax
mov eax, dword [0x6ae3d0]
mov dword [esp + 0x60], eax
mov eax, dword [0x6ae3d4]
mov dword [esp + 0x64], eax
movzx eax, word [esp + 0x2a]
mov dword [esp + 0x38], 0x10092
mov dword [esp + 0x42], edx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x5c], 1
mov dword [esp + 0x70], edx
mov word [esp + 0x7a], ax
call fcn.0040ee00
movdqu xmm0, xmmword [0x6ae448]
mov dword [esp + 0xc6], edx
xor edx, edx
mov dword [esp + 0xc2], eax
xor esi, esi
movdqu xmmword [esp + 0x82], xmm0
mov dword [esp + 0x3c], 0
movdqu xmm0, xmmword [0x6ae458]
movdqu xmmword [esp + 0x92], xmm0
movdqu xmm0, xmmword [0x6ae4ac]
movdqu xmmword [esp + 0xa2], xmm0
movdqu xmm0, xmmword [0x6ae4bc]
movdqu xmmword [esp + 0xb2], xmm0
lea ecx, [ecx]
movzx ecx, byte [esp + esi + 0x38]
mov eax, edx
shl eax, 5
sub eax, edx
add ecx, eax
movzx eax, byte [esp + esi + 0x39]
mov edx, ecx
add esi, 2
shl edx, 5
sub edx, ecx
add edx, eax
cmp esi, 0x92
jb 0x40d450
push dword [ebp + 0x14]
mov dword [esp + 0x40], edx
lea ecx, [esp + 0x3c]
push dword [ebp + 0x10]
mov edx, 0x92
call fcn.0040f310
add esp, 8
test eax, eax
je 0x40d695
push 0
push 0x92
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0x92
jne 0x40d695
push 0
push 0x1770
push 0
lea eax, [esp + 0xdc]
mov dword [esp + 0xdc], ebx
push eax
push 2
mov dword [esp + 0xe8], edi
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp eax, 0xffffffff
je 0x40d695
push dword [esp + 0xd0]
mov esi, dword [sym.imp.WS2_32.dll_WSAResetEvent]
call esi
push dword [esp + 0xd4]
call esi
push 0
push 0x94
lea eax, [esp + 0x148]
push eax
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0x94
jne 0x40d695
push dword [ebp + 0x14]
mov esi, eax
lea ecx, [esp + 0x144]
push dword [ebp + 0x10]
mov edx, esi
call fcn.0040f4c0
add esp, 8
test eax, eax
je 0x40d695
cmp word [esp + 0x140], si
jne 0x40d695
mov eax, dword [esp + 0x144]
xor ecx, ecx
mov dword [esp + 0x14], eax
xor esi, esi
mov dword [esp + 0x144], 0
movzx edx, byte [esp + esi + 0x140]
mov eax, ecx
shl eax, 5
sub eax, ecx
add edx, eax
movzx eax, byte [esp + esi + 0x141]
mov ecx, edx
shl ecx, 5
sub ecx, edx
add ecx, eax
movzx eax, byte [esp + esi + 0x142]
mov edx, ecx
shl edx, 5
sub edx, ecx
add edx, eax
movzx eax, byte [esp + esi + 0x143]
mov ecx, edx
add esi, 4
shl ecx, 5
sub ecx, edx
add ecx, eax
cmp esi, 0x94
jb 0x40d570
cmp dword [esp + 0x14], ecx
jne 0x40d695
mov eax, dword [esp + 0x148]
cmp eax, 0xc8
push 0x63
mov dword [esp + 0x14], eax
lea eax, [esp + 0xdd]
push 0
mov byte [esp + 0xe0], 0
push eax
jne 0x40d62c
call fcn.00451650
add esp, 0xc
lea eax, [esp + 0x18c]
push eax
push dword [esp + 0x1e]
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
movzx eax, byte [esp + 0x27]
push eax
movzx eax, byte [esp + 0x2a]
push eax
movzx eax, byte [esp + 0x2d]
push eax
movzx eax, byte [esp + 0x30]
push eax
push 0x481544
jmp 0x40d667
call fcn.00451650
add esp, 0xc
lea eax, [esp + 0x18c]
push eax
push dword [esp + 0x1e]
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
movzx eax, byte [esp + 0x27]
push eax
movzx eax, byte [esp + 0x2a]
push eax
movzx eax, byte [esp + 0x2d]
push eax
movzx eax, byte [esp + 0x30]
push eax
push str._DEBUG__l
lea eax, [esp + 0xf4]
push eax
call fcn.0045671f
add esp, 0x20
lea eax, [esp + 0xd8]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [esp + 0xd8]
push eax
call fcn.0045738c
add esp, 4
mov esi, dword [sym.imp.WS2_32.dll_WSACloseEvent]
push ebx
call esi
test edi, edi
je 0x40d6a5
push edi
call esi
mov ecx, dword [esp + 0x244]
xor eax, eax
cmp dword [esp + 0x10], 0xc8
pop edi
pop esi
sete al
pop ebx
xor ecx, esp
call fcn.0045094b
mov esp, ebp
pop ebp
ret