Function at 0x514520
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, eax
mov ebp, edx
mov ebx, ecx
mov dword [esp + 0x1c], 1
mov dword [esp], 0x68c300
call fcn.00509098
mov edi, eax
call fcn.00513738
test eax, eax
je 0x514704
call fcn.00513738
test eax, eax
je 0x5146b0
mov ecx, ebp
mov edx, ebx
lea eax, [esp + 0x20]
call fcn.00514490
test eax, eax
je 0x514710
mov eax, dword [esp + 0x64]
test eax, eax
je 0x514718
call fcn.00513738
test eax, eax
je 0x5146b0
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x64]
lea eax, [esp + 0x30]
call fcn.00514490
test eax, eax
je 0x514710
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov ebx, eax
cmp eax, 0xffffffff
je 0x514710
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.KERNEL32.dll_SetHandleInformation
sub esp, 0xc
mov dword [esp + 4], 0x1000
mov dword [esp], ebx
call fcn.005317f0
mov eax, dword [esp + 0x60]
test eax, eax
jne 0x514754
mov eax, dword [esp + 0x64]
test eax, eax
je 0x5147ac
mov dword [esp + 8], 0x10
lea eax, [esp + 0x30]
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.WS2_32.dll_bind
sub esp, 0xc
inc eax
je 0x5146c1
mov eax, dword [esp + 0x6c]
test eax, eax
jne 0x51472c
mov dword [esp + 8], 0x10
lea eax, [esp + 0x20]
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.WS2_32.dll_connect
sub esp, 0xc
inc eax
je 0x5147c0
mov eax, ebx
call fcn.00513768
mov esi, eax
mov dword [eax + 0x14], 0x23
lea eax, [esp + 0x1c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x8004667e
mov dword [esp], ebx
call sub.WS2_32.dll_ioctlsocket
sub esp, 0xc
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x402
mov eax, dword [edi]
mov dword [esp], eax
call sub.USER32.dll_SendMessageA
sub esp, 0x10
jmp 0x514706
mov dword [esp], 0xe
call fcn.00505cd8
mov ebx, 0xffffffff
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp], eax
call fcn.0057c9c4
test esi, esi
je 0x5146f6
mov dword [esp], esi
call fcn.00505cec
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], str.couldnt_open_socket:
mov dword [esp], esi
call fcn.004e1460
cmp ebx, 0xffffffff
je 0x514704
mov dword [esp], ebx
call sub.WS2_32.dll_closesocket
push ebp
xor esi, esi
mov eax, esi
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, 0xffffffff
jmp 0x5146c1
mov eax, dword [esp + 0x68]
test eax, eax
jne 0x51457e
jmp 0x5145a4
lea eax, [esp + 0x1c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x8004667e
mov dword [esp], ebx
call sub.WS2_32.dll_ioctlsocket
sub esp, 0xc
inc eax
jne 0x51463f
jmp 0x5146c1
mov dword [esp + 8], 0x10
lea eax, [esp + 0x20]
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.WS2_32.dll_bind
sub esp, 0xc
inc eax
je 0x5146c1
mov dword [esp + 4], 0x7fffffff
mov dword [esp], ebx
call sub.WS2_32.dll_listen
sub esp, 8
inc eax
je 0x5146c1
mov eax, ebx
call fcn.00513768
mov esi, eax
mov dword [eax + 0x14], 8
or dword [eax + 0xc], 8
jmp 0x514671
mov eax, dword [esp + 0x68]
test eax, eax
jne 0x514611
jmp 0x514633
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp], eax
call fcn.0057c9c4
call fcn.00505cc8
cmp eax, 0xb
jne 0x5146c1
mov eax, ebx
call fcn.00513768
mov esi, eax
or dword [eax + 8], 4
mov dword [eax + 0x14], 0x33
jmp 0x514671