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

Disassembly:
sub esp, 0x80
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov eax, dword [edi + 4]
xor ebp, ebp
xor esi, esi
cmp eax, ebp
mov dword [esp + 0x18], edx
mov ebx, 1
mov dword [esp + 0x10], ebp
je 0x51be46
cmp byte [eax], 0x2d
jne 0x51be46
push 0x584de8
push eax
call fcn.005809c6
add esp, 8
test eax, eax
jne 0x51be1d
mov esi, ebx
cmp esi, ebp
mov ebx, 2
je 0x51be46
mov eax, dword [edi + 8]
cmp eax, ebp
je 0x51be4d
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
je 0x51bee1
mov dword [esp + 0x10], ebx
mov ebx, 3
mov ecx, dword [edi + ebx*4]
cmp ecx, ebp
jne 0x51be63
mov edx, dword [edi]
push ebp
push ebp
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret
mov eax, ecx
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x51be68
sub eax, esi
cmp eax, 0x5a
jbe 0x51bea7
xor edx, edx
mov ecx, 0x1452
call fcn.0041d620
push eax
mov eax, dword [edi + ebx*4]
push eax
push str.__socklisten:__s__s
push 0x5a7240
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x80
ret
call fcn.0051b1e0
test eax, eax
je 0x51bec3
xor edx, edx
mov ecx, 0x1453
call fcn.0041d620
mov ecx, dword [edi + ebx*4]
push eax
push ecx
jmp 0x51be87
mov eax, dword [edi + ebx*4 + 4]
cmp eax, ebp
mov dword [esp + 0x14], ebp
je 0x51bef8
push eax
call fcn.00570543
add esp, 4
cmp ax, bp
mov dword [esp + 0x14], eax
ja 0x51bef8
mov edx, dword [edi]
push 3
push ebp
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret
call fcn.0051afa0
mov esi, eax
cmp esi, ebp
jne 0x51bf1a
mov edx, dword [edi]
push 2
push ebp
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret
mov ebx, dword [edi + ebx*4]
mov ecx, esi
nop
mov al, byte [ebx]
inc ebx
mov byte [ecx], al
inc ecx
test al, al
jne 0x51bf20
mov eax, dword [esp + 0x18]
lea ebp, [esi + 0x64]
add eax, 0x15d4
mov edx, ebp
sub edx, eax
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x51bf40
mov dx, word [esp + 0x14]
lea ebx, [esi + 0xc8]
push 0
mov word [ebx], dx
mov dword [esi + 0x14c], 1
call fcn.00570bc6
mov dword [esi + 0x17c], eax
mov dword [esi + 0x180], eax
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x51bfa8
mov eax, dword [edi + eax*4]
push eax
mov edx, 0x64
mov ecx, ebp
call fcn.0041ee40
mov ecx, dword [esp + 0x10]
mov edx, dword [edi + ecx*4]
push edx
lea ecx, [esi + 0xca]
mov edx, 0x64
call fcn.0041ee40
cmp word [esp + 0x14], 0
mov eax, dword [esp + 0x18]
mov dword [esi + 0x194], eax
jne 0x51c059
push 0x5ae5a0
mov edx, 0x64
lea ecx, [esp + 0x30]
call fcn.0041ee40
mov al, byte [esi + 0xca]
test al, al
mov ebp, dword [0x5ae598]
lea edi, [esi + 0xca]
je 0x51c001
push edi
mov edx, 0x64
mov ecx, 0x5ae5a0
call fcn.0041ee40
mov dword [0x5ae598], 2
mov dx, word [0x59bcfc]
mov cx, word [0x59bcf8]
push 0
push 0
push 0
push ebx
call fcn.005049f0
lea ecx, [esp + 0x2c]
push ecx
mov edx, 0x64
mov ecx, 0x5ae5a0
mov dword [esi + 0x190], eax
call fcn.0041ee40
mov dword [0x5ae598], ebp
cmp dword [esi + 0x190], 0xffffffff
jne 0x51c147
mov ecx, esi
call fcn.0051b0e0
mov ecx, 0x1454
jmp 0x51c11f
push 0
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x190], eax
jne 0x51c081
mov ecx, esi
call fcn.0051b0e0
mov ecx, 0x1455
jmp 0x51c11f
push 0x5ae5a0
mov edx, 0x64
lea ecx, [esp + 0x30]
call fcn.0041ee40
mov al, byte [esi + 0xca]
test al, al
mov ebp, dword [0x5ae598]
lea edi, [esi + 0xca]
je 0x51c0c4
push edi
mov edx, 0x64
mov ecx, 0x5ae5a0
call fcn.0041ee40
mov dword [0x5ae598], 2
mov dx, word [ebx]
mov ecx, dword [esi + 0x190]
call fcn.00504920
lea edx, [esp + 0x2c]
push edx
mov edx, 0x64
mov ecx, 0x5ae5a0
mov ebx, eax
call fcn.0041ee40
test ebx, ebx
mov dword [0x5ae598], ebp
jne 0x51c100
mov ecx, esi
call fcn.0051b0e0
mov ecx, 0x1456
jmp 0x51c11f
mov eax, dword [esi + 0x190]
push 5
push eax
call dword [sym.imp.WSOCK32.dll_listen]
test eax, eax
je 0x51c147
mov ecx, esi
call fcn.0051b0e0
mov ecx, 0x145a
xor edx, edx
call fcn.0041d620
push eax
push str.__socklisten:__s
push 0x5a7240
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x80
ret
mov ecx, dword [0x5b4314]
mov edx, dword [esi + 0x190]
push 8
push 0x8037
push ecx
push edx
call dword [sym.imp.WSOCK32.dll_WSAAsyncSelect]
mov eax, dword [esi + 0x190]
cmp eax, 0xffffffff
je 0x51c1b4
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x20]
push edx
push eax
mov dword [esp + 0x24], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jne 0x51c1b4
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.WSOCK32.dll_inet_ntoa]
push eax
mov edx, 0x64
mov ecx, edi
call fcn.0041ee40
mov ecx, dword [esp + 0x1e]
push ecx
call dword [sym.imp.WSOCK32.dll_ntohs]
mov word [esi + 0x12e], ax
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x80
ret