Function at 0x507e40
Capabilities:
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff80
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
mov edi, 1
xor eax, eax
mov dword [ebp - 4], eax
xor ebx, ebx
mov eax, dword [esi + edi*4]
test eax, eax
je 0x507e7c
cmp byte [eax], 0x2d
jne 0x507e7c
push 0x56bd20
push eax
call fcn.0054c494
add esp, 8
test eax, eax
jne 0x507e7b
mov ebx, 1
inc edi
test ebx, ebx
je 0x507ebb
cmp dword [esi + edi*4], 0
jne 0x507e98
push 0
push 0
push dword [esi]
push 0
call fcn.00479c10
jmp 0x508280
push dword [esi + edi*4]
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
jne 0x507eb7
push 3
push 0
push dword [esi]
push 0
call fcn.00479c10
jmp 0x508280
mov dword [ebp - 4], edi
inc edi
cmp dword [esi + edi*4], 0
jne 0x507ed3
push 0
push 0
push dword [esi]
push 0
call fcn.00479c10
jmp 0x508280
push dword [esi + edi*4]
call fcn.0054c2d0
pop ecx
cmp eax, 0x5a
jbe 0x507f0a
push 0
push 0x1452
call fcn.0042c564
push eax
push dword [esi + edi*4]
push 0x56bd24
push 0x57e17c
call sub.USER32.dll_wsprintfA
add esp, 0x10
xor eax, eax
jmp 0x508280
push dword [esi + edi*4]
call fcn.005071ea
test eax, eax
je 0x507f3f
push 0
push 0x1453
call fcn.0042c564
push eax
push dword [esi + edi*4]
push str.__socklisten:__s__s
push 0x57e17c
call sub.USER32.dll_wsprintfA
add esp, 0x10
xor eax, eax
jmp 0x508280
mov word [ebp - 6], 0
mov ebx, dword [esi + edi*4 + 4]
test ebx, ebx
je 0x507f71
push ebx
call fcn.00555124
pop ecx
mov word [ebp - 6], ax
cmp word [ebp - 6], 0
ja 0x507f71
push 3
push 0
push dword [esi]
push 0
call fcn.00479c10
jmp 0x508280
call fcn.00506fac
mov ebx, eax
test ebx, ebx
jne 0x507f8e
push 2
push 0
push dword [esi]
push 0
call fcn.00479c10
jmp 0x508280
mov eax, dword [esi + edi*4]
push esi
push edi
mov edi, eax
mov esi, ebx
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
xchg edi, esi
mov eax, edi
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
lea eax, [ebx + 0x64]
mov edx, dword [ebp + 0xc]
add edx, 0x1172
push esi
mov esi, eax
mov edi, edx
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
xchg edi, esi
mov eax, edi
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop esi
mov ax, word [ebp - 6]
mov word [ebx + 0xc8], ax
mov dword [ebx + 0x14c], 1
push 0
call fcn.0055aa70
pop ecx
mov edi, eax
mov dword [ebx + 0x17c], edi
mov dword [ebx + 0x180], edi
cmp dword [ebp - 4], 0
je 0x50803b
mov eax, dword [ebp - 4]
push dword [esi + eax*4]
push 0x64
lea edx, [ebx + 0x64]
push edx
call fcn.0042e322
mov ecx, dword [ebp - 4]
push dword [esi + ecx*4]
push 0x64
lea eax, [ebx + 0xca]
push eax
call fcn.0042e322
mov edx, dword [ebp + 0xc]
mov dword [ebx + 0x190], edx
cmp word [ebp - 6], 0
jne 0x5080ff
push 0x58465c
push 0x64
lea ecx, [ebp - 0x70]
push ecx
call fcn.0042e322
mov esi, dword [0x56acac]
cmp byte [ebx + 0xca], 0
je 0x50808b
lea eax, [ebx + 0xca]
push eax
push 0x64
push 0x58465c
call fcn.0042e322
mov dword [0x56acac], 2
push 0
push 0
lea edx, [ebx + 0xc8]
push edx
mov cx, word [0x561bee]
push ecx
mov ax, word [0x561bec]
push eax
call fcn.004f196d
mov dword [ebx + 0x18c], eax
lea edx, [ebp - 0x70]
push edx
push 0x64
push 0x58465c
call fcn.0042e322
mov dword [0x56acac], esi
cmp dword [ebx + 0x18c], 0xffffffff
jne 0x508214
push ebx
call fcn.005070ff
push 0
push 0x1454
call fcn.0042c564
push eax
push 0x56bd54
push 0x57e17c
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x508280
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov esi, eax
mov dword [ebx + 0x18c], esi
cmp esi, 0xffffffff
jne 0x508143
push ebx
call fcn.005070ff
push 0
push 0x1455
call fcn.0042c564
push eax
push 0x56bd67
push 0x57e17c
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x508280
push 0x58465c
push 0x64
lea edx, [ebp - 0x70]
push edx
call fcn.0042e322
mov esi, dword [0x56acac]
cmp byte [ebx + 0xca], 0
je 0x50817f
lea eax, [ebx + 0xca]
push eax
push 0x64
push 0x58465c
call fcn.0042e322
mov dword [0x56acac], 2
mov dx, word [ebx + 0xc8]
push edx
push dword [ebx + 0x18c]
call fcn.004f18ad
mov edi, eax
lea eax, [ebp - 0x70]
push eax
push 0x64
push 0x58465c
call fcn.0042e322
mov dword [0x56acac], esi
test edi, edi
jne 0x5081da
push ebx
call fcn.005070ff
push 0
push 0x1456
call fcn.0042c564
push eax
push 0x56bd7a
push 0x57e17c
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x508280
push 5
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_listen
test eax, eax
je 0x508214
push ebx
call fcn.005070ff
push 0
push 0x145a
call fcn.0042c564
push eax
push str.__socklisten:__s
push 0x57e17c
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x508280
push 8
push 0x8037
push dword [0x56cee8]
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_WSAAsyncSelect
cmp dword [ebx + 0x18c], 0xffffffff
je 0x50827b
mov dword [ebp - 0xc], 0x10
lea edx, [ebp - 0xc]
push edx
lea ecx, [ebp - 0x80]
push ecx
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_getsockname
test eax, eax
jne 0x50827b
push dword [ebp - 0x7c]
call sub.WSOCK32.dll_inet_ntoa
push eax
push 0x64
lea eax, [ebx + 0xca]
push eax
call fcn.0042e322
mov dx, word [ebp - 0x7e]
push edx
call sub.WSOCK32.dll_ntohs
mov word [ebx + 0x12e], ax
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8