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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x18
mov esi, dword [esp + 0x40]
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
mov ebx, dword [esp + 0x38]
test esi, esi
jne 0x1004aa70
test ebx, ebx
je 0x1004aa65
mov esi, dword [esp + 0x3c]
jmp 0x1004aa47
movzx eax, byte [ebp]
add ebp, 8
movzx edx, byte [esi]
xor al, dl
mov byte [edi], al
movzx eax, byte [ebp - 7]
movzx ecx, byte [esi + 1]
xor al, cl
mov byte [edi + 1], al
movzx eax, byte [ebp - 6]
movzx edx, byte [esi + 2]
xor al, dl
mov byte [edi + 2], al
movzx eax, byte [ebp - 5]
movzx ecx, byte [esi + 3]
xor al, cl
mov byte [edi + 3], al
movzx eax, byte [ebp - 4]
movzx edx, byte [esi + 4]
xor al, dl
mov byte [edi + 4], al
movzx eax, byte [ebp - 3]
movzx ecx, byte [esi + 5]
xor al, cl
mov byte [edi + 5], al
movzx eax, byte [ebp - 2]
movzx edx, byte [esi + 6]
xor al, dl
mov edx, edi
mov byte [edi + 6], al
movzx eax, byte [ebp - 1]
movzx ecx, byte [esi + 7]
xor al, cl
mov ecx, edi
mov byte [edi + 7], al
mov eax, dword [esp + 0x2c]
add edi, 8
call fcn.1004a890
mov eax, dword [edi - 8]
mov dword [esi], eax
mov eax, dword [edi - 4]
dec ebx
mov dword [esi + 4], eax
je 0x1004aa65
test esi, esi
jne 0x1004a9c0
mov eax, dword [esp + 0x2c]
mov ecx, ebp
mov edx, edi
add ebp, 8
add edi, 8
call fcn.1004a890
dec ebx
jne 0x1004aa47
add esp, 0x18
pop ebx
pop esi
pop edi
pop ebp
ret
test ebx, ebx
je 0x1004aa65
lea eax, [ebx - 1]
mov dword [esp + 0x14], eax
lea esi, [esi]
nop
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x2c]
mov esi, dword [esi]
mov eax, dword [eax + 0x40]
mov ecx, dword [edx + 8]
mov edx, dword [edx + 0xc]
mov dword [esp], esi
mov esi, dword [esp + 0x2c]
mov ebx, eax
mov dword [esp + 8], ecx
shr ebx, 0x1f
mov ecx, dword [ebp]
mov dword [esp + 0xc], edx
mov edx, dword [ebp + 4]
add ebx, eax
mov esi, dword [esi + 4]
sar ebx, 1
mov dword [esp + 0x10], ebx
imul ebx, ebx, 0x9e3779b9
dec eax
bswap ecx
bswap edx
mov dword [esp + 4], esi
jle 0x1004ab32
mov dword [esp + 0x30], edi
xor esi, esi
mov dword [esp + 0x34], ebp
lea esi, [esi]
nop
mov eax, dword [esp + 8]
mov ebp, ecx
inc esi
mov edi, dword [esp + 0xc]
shl ebp, 4
add ebp, eax
mov eax, ecx
shr eax, 5
add eax, edi
mov edi, dword [esp + 4]
xor eax, ebp
lea ebp, [ebx + ecx]
xor eax, ebp
sub edx, eax
mov eax, dword [esp]
mov ebp, edx
shl ebp, 4
add ebp, eax
mov eax, edx
shr eax, 5
add eax, edi
xor eax, ebp
lea ebp, [ebx + edx]
add ebx, 0x61c88647
xor eax, ebp
sub ecx, eax
cmp dword [esp + 0x10], esi
jg 0x1004aae0
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
mov ebx, dword [esp + 0x3c]
test ebx, ebx
je 0x1004ab88
mov eax, dword [esp + 0x3c]
bswap ecx
bswap edx
mov ebx, dword [eax]
mov esi, dword [eax + 4]
mov eax, dword [ebp]
mov dword [esp], ebx
mov ebx, dword [esp + 0x3c]
mov dword [ebx], eax
mov eax, dword [ebp + 4]
mov dword [ebx + 4], eax
mov ebx, dword [esp]
mov eax, esi
xor eax, edx
mov dword [edi + 4], eax
xor ebx, ecx
mov dword [edi], ebx
dec dword [esp + 0x14]
add ebp, 8
add edi, 8
mov eax, dword [esp + 0x14]
inc eax
jne 0x1004aa80
add esp, 0x18
pop ebx
pop esi
pop edi
pop ebp
ret
bswap ecx
bswap edx
mov dword [edi], ecx
mov dword [edi + 4], edx
jmp 0x1004ab67