Function at 0x408480
Capabilities:
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
sub esp, 0x34
mov eax, dword [0x6a7c78]
xor eax, esp
mov dword [esp + 0x30], eax
push ebx
mov ebx, dword [esp + 0x3c]
cmp dword [ebx], 0xffffffff
push ebp
mov ebp, dword [esp + 0x44]
mov dword [esp + 0x14], 0x10
mov dword [esp + 0x10], 1
jne 0x4084c0
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.004adf6a
add esp, 0x34
ret
lea eax, [ebp + 0x44]
push esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
push edi
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x408678
push 4
lea ecx, [esp + 0x1c]
push ecx
push 4
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
push edi
test eax, eax
jl 0x40871a
push ebp
call fcn.00405510
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 4]
add esp, 8
mov edx, 2
mov word [esp + 0x20], dx
test eax, eax
je 0x40854f
push 0x10
lea ecx, [esp + 0x24]
push ecx
push eax
push ebp
call fcn.00403080
add esp, 0x10
test eax, eax
jl 0x40869f
movzx edx, word [ebx]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x22], ax
push 0x10
lea eax, [esp + 0x24]
push eax
push edi
call dword [sym.imp.WS2_32.dll_bind]
mov esi, eax
test esi, esi
jl 0x4086d1
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x34]
push edx
push edi
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, 0xffffffff
jne 0x4085ab
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call dword [sym.imp.MSVCR90.dll_strerror]
push eax
push str.getsockname:__s_n
push 2
call fcn.00403280
add esp, 0x10
jmp 0x4085bb
mov eax, dword [esp + 0x32]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, ax
mov dword [ebx], ecx
mov edx, dword [ebx]
push 0x130
mov dword [ebp + 0x2fc], edx
call fcn.00405af0
mov esi, eax
add esp, 4
test esi, esi
je 0x40870a
mov cl, byte [esp + 0x14]
mov edx, dword [esp + 0x10]
mov dword [esi + 0xc8], ebp
mov dword [esi + 0x104], edi
mov byte [esi + 0x126], 0x10
mov eax, dword [ebp + 0x168]
push esi
mov dword [esi + 0xcc], eax
mov byte [esi + 0x12d], cl
push ebp
mov dword [edx - 4], esi
call fcn.00403cb0
add esp, 8
test eax, eax
jne 0x408719
inc dword [ebp + 0x30c]
mov eax, dword [esp + 0x10]
mov dword [eax], edi
mov ecx, dword [esi + 0x104]
push closesocket
push ecx
call dword [sym.imp.WS2_32.dll_listen]
mov eax, dword [esp + 0x14]
add dword [esp + 0x10], 0x40
inc eax
cmp eax, 1
mov dword [esp + 0x14], eax
jl 0x4084d1
mov ecx, dword [ebx]
push ecx
push str._Listening_on_port__d_n
push 4
call fcn.00403280
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.004adf6a
add esp, 0x34
ret
push str.ERROR_opening_socket_n
push 1
call fcn.00403280
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.004adf6a
add esp, 0x34
ret
mov edx, dword [ebx + 4]
push edx
push str.Unable_to_find_interface__s_n
push 1
call fcn.00403280
add esp, 0xc
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.004adf6a
add esp, 0x34
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [ebx]
push esi
push eax
push str.ERROR_on_binding_to_port__d___d__d__n
push 1
call fcn.00403280
add esp, 0x14
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.004adf6a
add esp, 0x34
ret
push str.Out_of_mem_n
push 1
call fcn.00403280
add esp, 8
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x40]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov eax, 1
call fcn.004adf6a
add esp, 0x34
ret