Function at 0x4e1990
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
mov esi, ecx
push edi
cmp dword [esi + 0x84], 2
jne 0x4e1a96
mov eax, dword [esi + 0x88]
cmp dword [eax + 0xc], 2
jb 0x4e1a1c
push 3
call fcn.004e17d0
mov ecx, dword [esi + 0x88]
mov byte [esi + 0x7c], 0
mov word [esi + 0x75], 0
mov dword [ebp - 4], ecx
mov eax, dword [ecx + 0xc]
mov edx, dword [ecx + 4]
lea edi, [eax - 2]
mov bh, byte [edx]
mov bl, byte [edx + 1]
test edi, edi
jne 0x4e19e6
mov dword [ecx + 0xc], edi
mov byte [edx], 0
jmp 0x4e1a02
sub eax, edi
push edi
add eax, edx
push eax
push edx
call fcn.005190f0
mov eax, dword [ebp - 4]
add esp, 0xc
mov dword [eax + 0xc], edi
mov eax, dword [eax + 4]
mov byte [edi + eax], 0
test bh, bh
js 0x4e1a25
sub esp, 0x18
mov ecx, esp
push str.Invalid_Message_Received_From_Client.
call fcn.00409680
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movzx ecx, bh
and ecx, 0xf
cmp ecx, 8
jne 0x4e1a3c
sub esp, 0x18
mov ecx, esp
push str.Client_is_Closing_the_Connection.
jmp 0x4e1a10
cmp ecx, 9
sete al
cmp ecx, 0xa
mov byte [esi + 0x75], al
sete al
mov byte [esi + 0x76], al
je 0x4e1a66
cmp ecx, 9
je 0x4e1a66
cmp ecx, 1
je 0x4e1a66
sub esp, 0x18
mov ecx, esp
push str.Invalid_Opcode_Received.
jmp 0x4e1a10
mov al, bl
and bl, 0x7f
shr al, 7
mov byte [esi + 0x77], al
cmp bl, 0x7d
ja 0x4e1a82
movzx eax, bl
mov dword [esi + 0x70], eax
mov byte [esi + 0x74], 0
jmp 0x4e1a96
cmp bl, 0x7e
jne 0x4e1a8d
mov byte [esi + 0x74], 2
jmp 0x4e1a96
cmp bl, 0x7f
jne 0x4e1a96
mov byte [esi + 0x74], 8
cmp dword [esi + 0x70], 0
jne 0x4e1aea
cmp byte [esi + 0x75], 0
jne 0x4e1af6
cmp byte [esi + 0x76], 0
jne 0x4e1aea
mov edx, dword [esi + 0x88]
mov al, byte [esi + 0x74]
movzx edi, al
cmp dword [edx + 0xc], edi
jb 0x4e1a1c
cmp al, 2
jne 0x4e1ad5
mov eax, dword [edx + 4]
movzx ecx, byte [eax]
movzx eax, byte [eax + 1]
shl ecx, 8
add ecx, eax
mov dword [esi + 0x70], ecx
jmp 0x4e1ad9
cmp al, 8
je 0x4e1b31
mov eax, dword [edx + 0xc]
mov ecx, edx
sub eax, edi
push eax
call fcn.004bc950
mov byte [esi + 0x74], 0
cmp byte [esi + 0x75], 0
jne 0x4e1af6
cmp byte [esi + 0x76], 0
je 0x4e1b40
cmp dword [esi + 0x70], 0x7d
jbe 0x4e1b40
sub esp, 0x18
mov ecx, esp
push 0x23
push str.Ping_Pong_with_Too_long_Data_Bytes.
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.00408270
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
sub esp, 0x18
mov ecx, esp
push str.Too_Long_Frame_Sent_by_Client.
jmp 0x4e1a10
cmp byte [esi + 0x77], 0
je 0x4e1b74
cmp byte [esi + 0x7c], 0
jne 0x4e1b74
mov ecx, dword [esi + 0x88]
cmp dword [ecx + 0xc], 4
jb 0x4e1a1c
mov eax, dword [ecx + 4]
mov eax, dword [eax]
mov dword [esi + 0x78], eax
mov eax, dword [ecx + 0xc]
sub eax, 4
push eax
call fcn.004bc950
mov byte [esi + 0x7c], 1
mov ebx, dword [esi + 0x8c]
mov edi, dword [esi + 0x70]
mov eax, dword [ebx + 8]
sub edi, dword [ebx + 0xc]
sub eax, dword [ebx + 0xc]
cmp eax, edi
jae 0x4e1b99
sub esp, 0x18
mov ecx, esp
push str.Client_Sent_Too_Long_Message.
jmp 0x4e1a10
mov edx, dword [esi + 0x88]
mov ecx, ebx
mov eax, dword [edx + 0xc]
cmp eax, edi
cmovae eax, edi
push eax
push dword [edx + 4]
call fcn.004bc910
mov ecx, dword [esi + 0x88]
mov edx, dword [ecx + 0xc]
sub edx, eax
push edx
call fcn.004bc950
mov eax, dword [esi + 0x8c]
mov eax, dword [eax + 0xc]
cmp eax, dword [esi + 0x70]
jne 0x4e1a1c
cmp byte [esi + 0x77], 0
je 0x4e1c71
test eax, eax
je 0x4e1c71
push 0x1f000
call fcn.0051ebb5
mov edi, dword [esi + 0x8c]
add esp, 4
mov dword [ebp - 4], eax
push dword [esi + 0x70]
mov ebx, dword [edi + 4]
push ebx
push eax
call fcn.005190f0
mov dword [edi + 0xc], 0
add esp, 0xc
mov byte [ebx], 0
xor edx, edx
mov edi, dword [esi + 0x70]
mov ebx, dword [ebp - 4]
test edi, edi
je 0x4e1c39
xor eax, eax
lea ecx, [eax + ebx]
inc edx
and eax, 3
mov al, byte [eax + esi + 0x78]
xor byte [ecx], al
movzx eax, dx
cmp eax, edi
jb 0x4e1c25
mov ecx, dword [esi + 0x8c]
mov dword [ebp - 4], ecx
cmp edi, 1
jb 0x4e1c68
mov eax, dword [ecx + 4]
add eax, dword [ecx + 0xc]
push edi
push ebx
push eax
call fcn.005190f0
mov eax, dword [ebp - 4]
add esp, 0xc
add dword [eax + 0xc], edi
mov ecx, dword [eax + 0xc]
mov eax, dword [eax + 4]
mov byte [ecx + eax], 0
push ebx
call fcn.0051e914
add esp, 4
mov ecx, esi
call fcn.004e1c80
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret