Function at 0x522b80
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b16be
mov eax, dword fs:[0]
push eax
sub esp, 0x33c
mov eax, dword [0x6aae20]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], ecx
call fcn.00508f20
movzx eax, byte [0x6b265c]
test eax, eax
je 0x522bd5
mov eax, dword [ebp - 0x14]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x14]
mov eax, dword [edx + 0x68]
call eax
movzx ecx, al
test ecx, ecx
jne 0x522bdf
call fcn.00509030
jmp 0x5232c5
mov eax, dword [ebp - 0x14]
movzx ecx, byte [eax + 0x54]
test ecx, ecx
jne 0x522ce0
push 0x10
push 0
lea eax, [ebp - 0x5c]
push eax
call fcn.00588eb0
add esp, 0xc
mov eax, 2
mov word [ebp - 0x5c], ax
mov eax, dword [0x6b1648]
mov dword [ebp - 0x58], eax
movzx eax, word [0x6aa908]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x5a], ax
push 0x38
push 0
lea eax, [ebp - 0x4c]
push eax
call fcn.00588eb0
add esp, 0xc
mov dword [ebp - 0x4c], 0
mov eax, dword [0x6b2658]
mov dword [ebp - 0x48], eax
movzx eax, word [0x6b2654]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x44], ax
mov dword [ebp - 0x40], 0
push 0x14
mov eax, dword [ebp - 0x14]
add eax, 0xb24
push eax
lea ecx, [ebp - 0x3c]
push ecx
call fcn.0058c7e0
add esp, 0xc
push 0x14
mov eax, dword [ebp - 0x14]
add eax, 0xb38
push eax
lea ecx, [ebp - 0x28]
push ecx
call fcn.0058c7e0
add esp, 0xc
mov dword [ebp - 0x60], 2
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x60]
sub ecx, 1
mov dword [ebp - 0x60], ecx
test eax, eax
jle 0x522ccf
push 0x10
lea eax, [ebp - 0x5c]
push eax
push 0
push 0x38
lea ecx, [ebp - 0x4c]
push ecx
mov edx, dword [0x6b1640]
push edx
call dword [sym.imp.WS2_32.dll_sendto]
cmp eax, 0xffffffff
jne 0x522ccd
call fcn.00514f60
call fcn.00509030
jmp 0x5232c5
jmp 0x522c8e
mov eax, dword [ebp - 0x14]
mov byte [eax + 0x54], 1
call fcn.00509030
jmp 0x5232c5
mov dword [ebp - 0x270], 0
mov dword [ebp - 0x26c], 0
mov dword [ebp - 0x274], 0x10
push 0x10
push 0
lea eax, [ebp - 0x5c]
push eax
call fcn.00588eb0
add esp, 0xc
mov dword [ebp - 0x164], 0
mov dword [ebp - 0x2b8], 0
jmp 0x522d33
mov eax, dword [ebp - 0x2b8]
add eax, 1
mov dword [ebp - 0x2b8], eax
mov eax, dword [ebp - 0x2b8]
cmp eax, dword [ebp - 0x164]
jae 0x522d5a
mov eax, dword [ebp - 0x2b8]
mov ecx, dword [ebp + eax*4 - 0x160]
cmp ecx, dword [0x6b1640]
jne 0x522d58
jmp 0x522d5a
jmp 0x522d24
mov eax, dword [ebp - 0x2b8]
cmp eax, dword [ebp - 0x164]
jne 0x522d93
cmp dword [ebp - 0x164], 0x40
jae 0x522d93
mov eax, dword [ebp - 0x2b8]
mov ecx, dword [0x6b1640]
mov dword [ebp + eax*4 - 0x160], ecx
mov eax, dword [ebp - 0x164]
add eax, 1
mov dword [ebp - 0x164], eax
xor eax, eax
jne 0x522d18
mov dword [ebp - 0x268], 0
mov dword [ebp - 0x2bc], 0
jmp 0x522dbc
mov eax, dword [ebp - 0x2bc]
add eax, 1
mov dword [ebp - 0x2bc], eax
mov eax, dword [ebp - 0x2bc]
cmp eax, dword [ebp - 0x268]
jae 0x522de3
mov eax, dword [ebp - 0x2bc]
mov ecx, dword [ebp + eax*4 - 0x264]
cmp ecx, dword [0x6b1640]
jne 0x522de1
jmp 0x522de3
jmp 0x522dad
mov eax, dword [ebp - 0x2bc]
cmp eax, dword [ebp - 0x268]
jne 0x522e1c
cmp dword [ebp - 0x268], 0x40
jae 0x522e1c
mov eax, dword [ebp - 0x2bc]
mov ecx, dword [0x6b1640]
mov dword [ebp + eax*4 - 0x264], ecx
mov eax, dword [ebp - 0x268]
add eax, 1
mov dword [ebp - 0x268], eax
xor eax, eax
jne 0x522da1
lea eax, [ebp - 0x270]
push eax
lea ecx, [ebp - 0x268]
push ecx
push 0
lea edx, [ebp - 0x164]
push edx
push 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x522e4d
call fcn.00509030
jmp 0x5232c5
push 0x38
push 0
lea eax, [ebp - 0x2ac]
push eax
call fcn.00588eb0
add esp, 0xc
lea eax, [ebp - 0x274]
push eax
lea ecx, [ebp - 0x5c]
push ecx
push 0
push 0x38
lea edx, [ebp - 0x2ac]
push edx
mov eax, dword [0x6b1640]
push eax
call dword [sym.imp.WS2_32.dll_recvfrom]
mov dword [ebp - 0x2b0], eax
cmp dword [ebp - 0x2b0], 0xffffffff
jne 0x522ea7
call fcn.00514f60
call fcn.00509030
mov eax, dword [ebp - 0x14]
mov byte [eax + 0x54], 0
jmp 0x5232c5
cmp dword [ebp - 0x2b0], 0x38
jb 0x522ec7
mov eax, dword [ebp - 0x2a8]
cmp eax, dword [0x6b2658]
je 0x522ec7
cmp dword [ebp - 0x2ac], 0
je 0x522ecc
jmp 0x52304a
push 0x14
mov eax, dword [ebp - 0x14]
add eax, 0xb24
push eax
lea ecx, [ebp - 0x29c]
push ecx
call fcn.0058ad23
add esp, 0xc
test eax, eax
jne 0x522f0a
lea eax, [ebp - 0x2ac]
push eax
mov ecx, dword [ebp - 0x14]
call fcn.00522a30
movzx ecx, al
test ecx, ecx
jne 0x522f05
jmp 0x5232c5
jmp 0x52304a
mov byte [ebp - 0x2bd], 0
mov dword [ebp - 0x2c4], 0
jmp 0x522f2c
mov eax, dword [ebp - 0x2c4]
add eax, 1
mov dword [ebp - 0x2c4], eax
mov ecx, 0x6b2af8
call fcn.00508370
cmp dword [ebp - 0x2c4], eax
jge 0x522f7f
mov eax, dword [ebp - 0x2c4]
push eax
mov ecx, 0x6b2af8
call fcn.005083b0
mov dword [ebp - 0x2b4], eax
push 0x14
lea eax, [ebp - 0x288]
push eax
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x24
push ecx
call fcn.0058ad23
add esp, 0xc
test eax, eax
jne 0x522f7d
mov byte [ebp - 0x2bd], 1
jmp 0x522f7f
jmp 0x522f1d
movzx eax, byte [ebp - 0x2bd]
test eax, eax
je 0x522f8f
jmp 0x52304a
push 0x98
call fcn.0044fb21
add esp, 4
mov dword [ebp - 0x33c], eax
mov dword [ebp - 4], 0
cmp dword [ebp - 0x33c], 0
je 0x522fcc
lea eax, [ebp - 0x2ac]
push eax
mov ecx, dword [ebp - 0x33c]
call fcn.005232f0
mov dword [ebp - 0x344], eax
jmp 0x522fd6
mov dword [ebp - 0x344], 0
mov ecx, dword [ebp - 0x344]
mov dword [ebp - 0x340], ecx
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x340]
mov dword [ebp - 0x2b4], edx
mov ecx, dword [ebp - 0x14]
call fcn.00517b60
mov ecx, dword [ebp - 0x2b4]
mov dword [ecx + 0x90], eax
mov dword [ecx + 0x94], edx
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x338], eax
lea ecx, [ebp - 0x338]
push ecx
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x38
call fcn.005085d0
mov eax, dword [ebp - 0x2b4]
mov dword [ebp - 0x334], eax
lea ecx, [ebp - 0x334]
push ecx
mov ecx, 0x6b2af8
call fcn.005085d0
cmp dword [ebp - 0x2b0], 0x38
je 0x522d0e
mov dword [ebp - 0x2cc], 0
jmp 0x523072
mov eax, dword [ebp - 0x2cc]
add eax, 1
mov dword [ebp - 0x2cc], eax
mov ecx, 0x6b2af8
call fcn.00508370
cmp dword [ebp - 0x2cc], eax
jge 0x5232a5
mov byte [ebp - 0x2c5], 0
mov eax, dword [ebp - 0x2cc]
push eax
mov ecx, 0x6b2af8
call fcn.005083b0
mov dword [ebp - 0x2b4], eax
cmp dword [ebp - 0x2b4], 0
jne 0x5230b1
jmp 0x523063
mov dword [ebp - 0x2d0], 0
jmp 0x5230cc
mov eax, dword [ebp - 0x2d0]
add eax, 1
mov dword [ebp - 0x2d0], eax
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x38
call fcn.00508370
cmp dword [ebp - 0x2d0], eax
jge 0x523107
mov eax, dword [ebp - 0x2d0]
push eax
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x38
call fcn.005083b0
cmp eax, dword [ebp - 0x14]
jne 0x523105
mov byte [ebp - 0x2c5], 1
jmp 0x523107
jmp 0x5230bd
movzx eax, byte [ebp - 0x2c5]
test eax, eax
je 0x523117
jmp 0x523063
push 0x14
mov eax, dword [ebp - 0x14]
add eax, 0xb24
push eax
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x10
push ecx
call fcn.0058ad23
add esp, 0xc
test eax, eax
jne 0x5231c3
mov eax, dword [ebp - 0x2b4]
push eax
mov ecx, dword [ebp - 0x14]
call fcn.00522a30
movzx ecx, al
test ecx, ecx
jne 0x523157
jmp 0x5232c5
mov eax, dword [ebp - 0x2b4]
mov dword [ebp - 0x32c], eax
mov ecx, dword [ebp - 0x32c]
mov dword [ebp - 0x330], ecx
cmp dword [ebp - 0x330], 0
je 0x52318d
push 1
mov ecx, dword [ebp - 0x330]
call fcn.005137a0
mov dword [ebp - 0x344], eax
jmp 0x523197
mov dword [ebp - 0x344], 0
mov dword [ebp - 0x328], 0
lea eax, [ebp - 0x328]
push eax
mov ecx, dword [ebp - 0x2cc]
push ecx
mov ecx, 0x6b2af8
call fcn.00513fc0
jmp 0x523063
mov ecx, dword [ebp - 0x14]
call fcn.00517b60
mov ecx, dword [ebp - 0x2b4]
sub eax, dword [ecx + 0x90]
sbb edx, dword [ecx + 0x94]
mov dword [ebp - 0x348], eax
mov dword [ebp - 0x344], edx
cmp dword [ebp - 0x344], 0
jg 0x52321b
jl 0x5231fd
cmp dword [ebp - 0x348], 0x1e
ja 0x52321b
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x38
call fcn.00508370
mov esi, eax
mov ecx, 0x6b29a8
call fcn.00508370
cmp esi, eax
jl 0x523282
mov eax, dword [ebp - 0x2b4]
mov dword [ebp - 0x320], eax
mov ecx, dword [ebp - 0x320]
mov dword [ebp - 0x324], ecx
cmp dword [ebp - 0x324], 0
je 0x523251
push 1
mov ecx, dword [ebp - 0x324]
call fcn.005137a0
mov dword [ebp - 0x344], eax
jmp 0x52325b
mov dword [ebp - 0x344], 0
mov dword [ebp - 0x31c], 0
lea eax, [ebp - 0x31c]
push eax
mov ecx, dword [ebp - 0x2cc]
push ecx
mov ecx, 0x6b2af8
call fcn.00513fc0
jmp 0x523063
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x318], eax
lea ecx, [ebp - 0x318]
push ecx
mov ecx, dword [ebp - 0x2b4]
add ecx, 0x38
call fcn.005085d0
jmp 0x523063
mov dword [ebp - 0x314], 0
lea eax, [ebp - 0x314]
push eax
mov ecx, 0x6b2af8
call fcn.00513270
call fcn.00509030
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005884bd
mov esp, ebp
pop ebp
ret