Function at 0x522e30
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x16c
mov eax, dword [0x778400]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x148], ecx
mov eax, dword [ebp - 0x148]
cmp dword [eax + 0x10], 0
jne 0x522e5c
xor eax, eax
jmp 0x523148
mov ecx, 2
mov word [ebp - 0x118], cx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x114], edx
mov dword [ebp - 0x108], 0x10
mov dword [ebp - 0x15c], 0x2c
mov ecx, dword [ebp - 0x148]
call fcn.005226e0
mov dword [ebp - 0x164], eax
mov ax, word [0x786a60]
add ax, 1
mov word [0x786a60], ax
mov cx, word [0x786a60]
mov word [ebp - 0x14c], cx
mov edx, dword [ebp - 0x15c]
push edx
push 0
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax + 0xc]
push ecx
call fcn.0066eb10
add esp, 0xc
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 0xc]
mov dword [ebp - 0x150], eax
mov ecx, dword [ebp - 0x150]
mov byte [ecx], 8
mov edx, dword [ebp - 0x150]
mov byte [edx + 1], 0
mov eax, dword [ebp - 0x150]
mov ecx, dword [ebp - 0x148]
mov dx, word [ecx + 8]
mov word [eax + 4], dx
mov eax, dword [ebp - 0x150]
mov cx, word [ebp - 0x14c]
mov word [eax + 6], cx
mov edx, dword [ebp - 0x150]
mov eax, dword [ebp - 0x164]
mov dword [edx + 8], eax
mov ecx, dword [ebp - 0x15c]
push ecx
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 0xc]
push eax
mov ecx, dword [ebp - 0x148]
call fcn.00522120
mov ecx, dword [ebp - 0x150]
mov word [ecx + 2], ax
mov edx, dword [ebp - 0x108]
push edx
lea eax, [ebp - 0x118]
push eax
push 0
mov ecx, dword [ebp - 0x15c]
push ecx
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 0xc]
push eax
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_sendto]
cmp eax, 0xffffffff
jne 0x522f87
xor eax, eax
jmp 0x523148
cmp dword [ebp + 0xc], 0
jne 0x522f97
mov eax, 1
jmp 0x523148
mov ax, word [0x6e2a70]
mov word [ebp - 0x104], ax
push 0xfe
push 0
lea ecx, [ebp - 0x102]
push ecx
call fcn.0066eb10
add esp, 0xc
mov edx, 1
test edx, edx
je 0x523148
push 0
push 0x64
push 0
mov eax, dword [ebp - 0x148]
add eax, 4
push eax
push 1
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp eax, 0x102
je 0x523129
lea ecx, [ebp - 0x144]
push ecx
mov edx, dword [ebp - 0x148]
mov eax, dword [edx + 4]
push eax
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
mov eax, dword [ebp - 0x144]
and eax, 1
je 0x523129
mov ecx, dword [ebp - 0x148]
call fcn.005226e0
mov dword [ebp - 0x16c], eax
lea ecx, [ebp - 0x108]
push ecx
lea edx, [ebp - 0x118]
push edx
push 0
push 0x100
lea eax, [ebp - 0x104]
push eax
mov ecx, dword [ebp - 0x148]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_recvfrom]
mov dword [ebp - 0x160], eax
cmp dword [ebp - 0x160], 0xffffffff
je 0x523129
lea eax, [ebp - 0x104]
mov dword [ebp - 0x168], eax
mov ecx, dword [ebp - 0x168]
movzx edx, byte [ecx]
and edx, 0xf
shl edx, 2
mov word [ebp - 0x154], dx
movzx eax, word [ebp - 0x154]
lea ecx, [ebp + eax - 0x104]
mov dword [ebp - 0x158], ecx
mov edx, dword [ebp - 0x158]
movzx eax, word [edx + 4]
mov ecx, dword [ebp - 0x148]
movzx edx, word [ecx + 8]
cmp eax, edx
jne 0x523129
mov eax, dword [ebp - 0x158]
movzx ecx, byte [eax]
test ecx, ecx
jne 0x523129
mov edx, dword [ebp - 0x158]
movzx eax, word [edx + 6]
movzx ecx, word [ebp - 0x14c]
cmp eax, ecx
jne 0x523129
mov edx, dword [ebp + 0xc]
mov ax, word [ebp - 0x14c]
mov word [edx], ax
mov ecx, dword [ebp - 0x158]
mov edx, dword [ebp - 0x16c]
sub edx, dword [ecx + 8]
mov eax, dword [ebp + 0xc]
mov dword [eax + 4], edx
movzx ecx, word [ebp - 0x154]
mov edx, dword [ebp - 0x160]
sub edx, ecx
sub edx, 0xc
mov eax, dword [ebp + 0xc]
mov dword [eax + 8], edx
mov ecx, dword [ebp - 0x168]
movzx edx, byte [ecx + 8]
mov eax, dword [ebp + 0xc]
mov dword [eax + 0xc], edx
mov eax, 1
jmp 0x523148
mov ecx, dword [ebp - 0x148]
call fcn.005226e0
sub eax, dword [ebp - 0x164]
cmp eax, dword [ebp + 0x10]
jb 0x523143
xor eax, eax
jmp 0x523148
jmp 0x522fba
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0066c98d
mov esp, ebp
pop ebp
ret 0xc