Function at 0x50996c
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 0x5099a8
cmp byte [eax], 0x2d
jne 0x5099a8
push 0x56de50
push eax
call fcn.0054e450
add esp, 8
test eax, eax
jne 0x5099a7
mov ebx, 1
inc edi
test ebx, ebx
je 0x5099e7
cmp dword [esi + edi*4], 0
jne 0x5099c4
push 0
push 0
push dword [esi]
push 0
call fcn.00479438
jmp 0x509dac
push dword [esi + edi*4]
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
jne 0x5099e3
push 3
push 0
push dword [esi]
push 0
call fcn.00479438
jmp 0x509dac
mov dword [ebp - 4], edi
inc edi
cmp dword [esi + edi*4], 0
jne 0x5099ff
push 0
push 0
push dword [esi]
push 0
call fcn.00479438
jmp 0x509dac
push dword [esi + edi*4]
call fcn.0054e28c
pop ecx
cmp eax, 0x5a
jbe 0x509a36
push 0
push 0x1452
call fcn.0042c771
push eax
push dword [esi + edi*4]
push 0x56de54
push 0x5803c4
call sub.USER32.dll_wsprintfA
add esp, 0x10
xor eax, eax
jmp 0x509dac
push dword [esi + edi*4]
call fcn.00508d16
test eax, eax
je 0x509a6b
push 0
push 0x1453
call fcn.0042c771
push eax
push dword [esi + edi*4]
push str.__socklisten:__s__s
push 0x5803c4
call sub.USER32.dll_wsprintfA
add esp, 0x10
xor eax, eax
jmp 0x509dac
mov word [ebp - 6], 0
mov ebx, dword [esi + edi*4 + 4]
test ebx, ebx
je 0x509a9d
push ebx
call fcn.005570e0
pop ecx
mov word [ebp - 6], ax
cmp word [ebp - 6], 0
ja 0x509a9d
push 3
push 0
push dword [esi]
push 0
call fcn.00479438
jmp 0x509dac
call fcn.00508ad8
mov ebx, eax
test ebx, ebx
jne 0x509aba
push 2
push 0
push dword [esi]
push 0
call fcn.00479438
jmp 0x509dac
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, 0x1170
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.0055ca2c
pop ecx
mov edi, eax
mov dword [ebx + 0x17c], edi
mov dword [ebx + 0x180], edi
cmp dword [ebp - 4], 0
je 0x509b67
mov eax, dword [ebp - 4]
push dword [esi + eax*4]
push 0x64
lea edx, [ebx + 0x64]
push edx
call fcn.0042e5e3
mov ecx, dword [ebp - 4]
push dword [esi + ecx*4]
push 0x64
lea eax, [ebx + 0xca]
push eax
call fcn.0042e5e3
mov edx, dword [ebp + 0xc]
mov dword [ebx + 0x190], edx
cmp word [ebp - 6], 0
jne 0x509c2b
push 0x5864bc
push 0x64
lea ecx, [ebp - 0x70]
push ecx
call fcn.0042e5e3
mov esi, dword [0x56cdd0]
cmp byte [ebx + 0xca], 0
je 0x509bb7
lea eax, [ebx + 0xca]
push eax
push 0x64
push 0x5864bc
call fcn.0042e5e3
mov dword [0x56cdd0], 2
push 0
push 0
lea edx, [ebx + 0xc8]
push edx
mov cx, word [0x563c12]
push ecx
mov ax, word [0x563c10]
push eax
call fcn.004f316d
mov dword [ebx + 0x18c], eax
lea edx, [ebp - 0x70]
push edx
push 0x64
push 0x5864bc
call fcn.0042e5e3
mov dword [0x56cdd0], esi
cmp dword [ebx + 0x18c], 0xffffffff
jne 0x509d40
push ebx
call fcn.00508c2b
push 0
push 0x1454
call fcn.0042c771
push eax
push 0x56de84
push 0x5803c4
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x509dac
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov esi, eax
mov dword [ebx + 0x18c], esi
cmp esi, 0xffffffff
jne 0x509c6f
push ebx
call fcn.00508c2b
push 0
push 0x1455
call fcn.0042c771
push eax
push 0x56de97
push 0x5803c4
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x509dac
push 0x5864bc
push 0x64
lea edx, [ebp - 0x70]
push edx
call fcn.0042e5e3
mov esi, dword [0x56cdd0]
cmp byte [ebx + 0xca], 0
je 0x509cab
lea eax, [ebx + 0xca]
push eax
push 0x64
push 0x5864bc
call fcn.0042e5e3
mov dword [0x56cdd0], 2
mov dx, word [ebx + 0xc8]
push edx
push dword [ebx + 0x18c]
call fcn.004f30ad
mov edi, eax
lea eax, [ebp - 0x70]
push eax
push 0x64
push 0x5864bc
call fcn.0042e5e3
mov dword [0x56cdd0], esi
test edi, edi
jne 0x509d06
push ebx
call fcn.00508c2b
push 0
push 0x1456
call fcn.0042c771
push eax
push 0x56deaa
push 0x5803c4
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x509dac
push 5
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_listen
test eax, eax
je 0x509d40
push ebx
call fcn.00508c2b
push 0
push 0x145a
call fcn.0042c771
push eax
push str.__socklisten:__s
push 0x5803c4
call sub.USER32.dll_wsprintfA
add esp, 0xc
xor eax, eax
jmp 0x509dac
push 8
push 0x8037
push dword [0x56f018]
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_WSAAsyncSelect
cmp dword [ebx + 0x18c], 0xffffffff
je 0x509da7
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 0x509da7
push dword [ebp - 0x7c]
call sub.WSOCK32.dll_inet_ntoa
push eax
push 0x64
lea eax, [ebx + 0xca]
push eax
call fcn.0042e5e3
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