Function at 0x40b320
Capabilities:
Encode data using xor
Encrypt data using tea

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, edx
mov dword [ebp - 0x10], edx
shr eax, 2
test dl, 3
push ebx
push esi
push edi
lea ebx, [eax + 1]
mov dword [ebp - 0xc], ecx
cmove ebx, eax
mov dword [ebp - 0x14], ebx
lea esi, [ebx*4]
lea eax, [esi + 4]
push eax
call fcn.0054def0
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 4], eax
add eax, esi
push esi
mov esi, dword [ebp - 4]
mov dword [ebp - 0x18], eax
mov dword [eax], ecx
lea eax, [ebx + 1]
push 0
push esi
mov dword [ebp - 0x1c], eax
call fcn.00548bf0
mov ebx, dword [ebp - 0x10]
add esp, 0x10
xor edi, edi
test ebx, ebx
je 0x40b3a0
nop dword [eax + eax]
mov eax, edi
mov ecx, edi
shr eax, 2
and ecx, 3
lea edx, [esi + eax*4]
shl ecx, 3
mov eax, dword [ebp - 0xc]
movzx eax, byte [eax + edi]
inc edi
shl eax, cl
or dword [edx], eax
cmp edi, ebx
jb 0x40b380
push 0x10
call fcn.0054def0
mov edi, eax
mov dword [ebp - 0x10], 2
mov eax, dword [ebp + 8]
xorps xmm0, xmm0
mov ecx, eax
mov dword [ebp - 8], edi
not ecx
mov dword [ebp - 0xc], 8
mov dword [ebp - 0x20], ecx
mov esi, 0xfffffffe
mov ecx, 0xfffffffc
lea ebx, [eax + 2]
sub ecx, eax
add esp, 4
mov dword [ebp - 0x24], ecx
mov ecx, 0xfffffffd
sub ecx, eax
mov dword [ebp - 0x2c], ecx
mov ecx, 1
sub ecx, eax
sub esi, eax
movups xmmword [edi], xmm0
mov dword [ebp - 0x28], ecx
lea ecx, [ebx + esi]
mov eax, ecx
and ecx, 3
shr eax, 2
lea edx, [edi + eax*4]
shl ecx, 3
movzx eax, byte [ebx - 2]
shl eax, cl
or dword [edx], eax
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0xc]
add eax, ebx
shr eax, 2
and ecx, 0x18
lea edx, [edi + eax*4]
add dword [ebp - 0xc], 0x20
movzx eax, byte [ebx - 1]
shl eax, cl
or dword [edx], eax
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x24]
shr eax, 2
lea edx, [edi + eax*4]
add dword [ebp - 0x10], 4
movzx eax, byte [ebx]
lea ecx, [ebx + ecx]
shl ecx, 3
and ecx, 0x18
shl eax, cl
or dword [edx], eax
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x2c]
add eax, ebx
shr eax, 2
lea edx, [edi + eax*4]
movzx eax, byte [ebx + 1]
lea ecx, [ebx + ecx]
add ebx, 4
shl ecx, 3
and ecx, 0x18
shl eax, cl
or dword [edx], eax
lea eax, [ebx + esi]
cmp eax, 0x10
jb 0x40b3f5
xor edx, edx
mov ebx, dword [ebp - 0x18]
mov eax, 0x34
mov esi, dword [ebp - 4]
div dword [ebp - 0x1c]
mov ebx, dword [ebx]
lea ecx, [eax + 6]
xor eax, eax
cmp dword [ebp - 0x14], 1
jb 0x40b54f
test ecx, ecx
je 0x40b54f
nop
sub eax, 0x61c88647
dec ecx
mov dword [ebp - 0x10], eax
shr eax, 2
and eax, 3
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0xc], eax
xor eax, eax
mov esi, dword [esi + eax*4 + 4]
mov ecx, ebx
shr ecx, 5
mov edx, esi
shr edx, 3
lea edi, [esi*4]
xor edi, ecx
mov ecx, ebx
shl ecx, 4
xor edx, ecx
mov ecx, eax
add edi, edx
and ecx, 3
xor ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov edx, dword [edx + ecx*4]
mov ecx, dword [ebp - 0x10]
xor edx, ebx
xor ecx, esi
mov esi, dword [ebp - 4]
add edx, ecx
xor edi, edx
add dword [esi + eax*4], edi
mov ebx, dword [esi + eax*4]
inc eax
cmp eax, dword [ebp - 0x14]
jb 0x40b4b7
mov esi, dword [esi]
mov edi, ebx
shl edi, 4
mov ecx, esi
shr ecx, 3
and eax, 3
xor eax, dword [ebp - 0xc]
xor edi, ecx
mov edx, ebx
lea ecx, [esi*4]
shr edx, 5
xor edx, ecx
mov ecx, dword [ebp - 8]
add edi, edx
mov ecx, dword [ecx + eax*4]
mov eax, dword [ebp - 0x10]
xor ecx, ebx
xor eax, esi
mov esi, dword [ebp - 4]
add ecx, eax
mov eax, dword [ebp - 0x18]
xor edi, ecx
mov ecx, dword [ebp - 0x2c]
add dword [eax], edi
mov ebx, dword [eax]
mov eax, dword [ebp - 0x10]
test ecx, ecx
jne 0x40b4a0
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
mov ecx, 0xffffffff
lea ebx, [eax*4]
mov eax, ebx
add eax, 1
cmovb eax, ecx
push eax
call fcn.0054def0
add esp, 4
mov dword [ebp - 0x10], eax
xor edx, edx
test ebx, ebx
je 0x40b5a0
mov edi, eax
nop word [eax + eax]
mov eax, edx
mov ecx, edx
shr eax, 2
and ecx, 3
shl ecx, 3
mov eax, dword [esi + eax*4]
shr eax, cl
mov byte [edi + edx], al
inc edx
cmp edx, ebx
jb 0x40b580
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 0x10]
mov byte [eax + ebx], 0
mov eax, dword [ebp + 0xc]
push esi
mov dword [eax], ebx
call fcn.0054d120
push edi
call fcn.0054d120
mov eax, dword [ebp - 0x10]
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret