Function at 0x409080
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get local ipv4 addresses
Get socket information
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration
Start tcp server

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, 0x10
mov dword [eax], 0xffffffff
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], 1
mov dword [ecx], 0xffffffff
call dword [sym.imp.MSVCRT.dll__getpid]
mov esi, dword [sym.imp.WSOCK32.dll_socket]
mov dword [ebp - 0x18], eax
mov eax, dword [0x40df60]
push 6
mov dword [ebp - 0x14], eax
inc eax
push 1
push 2
mov dword [0x40df60], eax
call esi
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [ebp - 8], ebx
jne 0x409100
mov esi, dword [sym.imp.WSOCK32.dll_WSAGetLastError]
call esi
test eax, eax
jne 0x4090f2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call esi
pop edi
pop esi
add eax, 0xafc80
pop ebx
mov esp, ebp
pop ebp
ret
push str.127.0.0.1
mov word [ebp - 0x38], 2
mov word [ebp - 0x36], 0
call dword [sym.imp.WSOCK32.dll_inet_addr]
lea edx, [ebp - 0x38]
push edi
push edx
push ebx
mov dword [ebp - 0x34], eax
call dword [sym.imp.WSOCK32.dll_bind]
cmp eax, 0xffffffff
je 0x409334
lea eax, [ebp - 0xc]
lea ecx, [ebp - 0x48]
push eax
push ecx
push ebx
call dword [sym.imp.WSOCK32.dll_getsockname]
cmp eax, 0xffffffff
je 0x409334
push 1
push ebx
call dword [sym.imp.WSOCK32.dll_listen]
cmp eax, 0xffffffff
je 0x409334
push 6
push 1
push 2
call esi
mov esi, dword [ebp + 0xc]
cmp eax, 0xffffffff
mov dword [esi], eax
je 0x409334
lea edx, [ebp - 0x48]
push edi
push edx
push eax
call dword [sym.imp.WSOCK32.dll_connect]
cmp eax, 0xffffffff
je 0x409334
mov ecx, dword [esi]
push 0
lea eax, [ebp - 0x18]
push 8
push eax
push ecx
call dword [sym.imp.WSOCK32.dll_send]
cmp eax, 8
je 0x4091f5
mov esi, dword [sym.imp.WSOCK32.dll_WSAGetLastError]
call esi
test eax, eax
je 0x4091b2
call esi
mov esi, eax
add esi, 0xafc80
jne 0x4091b7
mov esi, 0x16
mov ecx, dword [ebp + 8]
mov edi, dword [sym.imp.WSOCK32.dll_closesocket]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x4091ca
push eax
call edi
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebx]
cmp eax, 0xffffffff
je 0x4091d7
push eax
call edi
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 8]
push eax
mov dword [edx], 0xffffffff
mov dword [ebx], 0xffffffff
call edi
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 4]
push edx
push 0x8004667e
push ebx
call dword [sym.imp.WSOCK32.dll_ioctlsocket]
cmp eax, 0xffffffff
je 0x409334
mov ebx, dword [sym.imp.WSOCK32.dll_recv]
mov esi, dword [ebp - 8]
mov eax, 1
mov dword [ebp - 0x15c], eax
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
xor edi, edi
push eax
push edi
lea ecx, [ebp - 0x15c]
push edi
push ecx
push edi
mov dword [ebp - 0x158], esi
mov dword [ebp - 0x1c], edi
call dword [sym.imp.WSOCK32.dll_select]
cmp eax, 0xffffffff
jne 0x409253
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x409214
test eax, eax
je 0x409214
lea edx, [ebp - 0x10]
lea eax, [ebp - 0x58]
push edx
push eax
push esi
call dword [sym.imp.WSOCK32.dll_accept]
mov ecx, dword [ebp + 8]
cmp eax, 0xffffffff
mov dword [ecx], eax
je 0x409334
mov edx, edi
inc edi
test edx, edx
je 0x409283
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp + 8]
push 0
lea eax, [ebp - 0x28]
push 8
mov edx, dword [ecx]
push eax
push edx
call ebx
cmp eax, 0xffffffff
jne 0x4092ec
mov esi, dword [sym.imp.WSOCK32.dll_WSAGetLastError]
call esi
test eax, eax
je 0x409340
call esi
mov esi, eax
add esi, 0xafc80
cmp esi, 0xb
je 0x409274
cmp esi, 0xafd68
je 0x409274
cmp esi, 0xafcd9
je 0x409274
cmp esi, 0xafd57
je 0x409274
cmp esi, 0xafd24
je 0x409274
cmp esi, 0xafca1
je 0x409274
cmp esi, 0xb23b3
je 0x409274
jmp 0x4091b7
cmp eax, 8
jne 0x409302
mov ecx, 2
lea edi, [ebp - 0x28]
lea esi, [ebp - 0x18]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
je 0x409313
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WSOCK32.dll_closesocket]
jmp 0x409214
mov ecx, dword [ebp + 8]
lea eax, [ebp - 4]
push eax
push 0x8004667e
mov edx, dword [ecx]
mov dword [ebp - 4], 0
push edx
call dword [sym.imp.WSOCK32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x409356
mov esi, dword [sym.imp.WSOCK32.dll_WSAGetLastError]
call esi
test eax, eax
jne 0x409347
xor esi, esi
jmp 0x4091b7
call esi
mov esi, eax
add esi, 0xafc80
jmp 0x4091b7
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret