Function at 0x520842
Capabilities:
Encrypt data using tea
Encrypt data using xtea

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
call 0x520850
add esp, 4
jge 0x520872
pushf
jbe 0x520859
jg 0x52085b
lea ecx, [ecx + 0x35ec]
lea ecx, [ecx - 0x35ec]
popf
ja 0x52086b
je 0x52086d
jle 0x52086f
jl 0x520872
call 0x8b5e4e01
or byte [ecx + 0x76f84d], cl
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
mov dword [ebp - 8], ecx
jbe 0x52087c
xor ecx, dword [esp]
xor ecx, dword [esp]
je 0x520884
jg 0x520898
mov esp, esp
lea edx, [edx + 0x25db]
lea edx, [edx - 0x25db]
jle 0x520898
call 0xca7942b
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 4]
mov dword [ebp - 0x10], eax
or esi, esi
jge 0x5208a5
xchg ecx, ecx
jmp 0x5208a9
jb 0x5208b3
jp 0x5208ad
jno 0x5208af
jae 0x5208b3
lcall 0, 0xf445c72c
add byte [eax], al
mov dword [ebp - 0xc], 0
mov dword [ebp - 4], 0
add esi, 0
js 0x5208d1
lea ebx, [ebx]
jo 0x5208ca
jns 0x5208cc
jns 0x5208d1
xor eax, 0x7d83d6ba
adc byte [eax], al
cmp dword [ebp + 0x10], 0
jle 0x5209dc
rol esp, 0
je 0x5208e0
ror esp, 0
xor ecx, dword [esp]
xor ecx, dword [esp]
jnp 0x520919
pushf
lea ecx, [ecx + 0x1211]
lea ecx, [ecx - 0x1211]
test dword [esp], edi
jmp 0x5208fe
cmp edi, 0x2251
popf
lea ecx, [ecx + 0x405d]
lea ecx, [ecx - 0x405d]
ja 0x520914
jbe 0x520916
jp 0x520919
jmp 0x696256a8
mov ecx, dword [ebp + 0x10]
imul ecx, ecx, 0x9e3779b9
mov dword [ebp - 0xc], ecx
cmp ebx, eax
jno 0x520933
jge 0x52092b
jno 0x52092d
jle 0x52092f
jo 0x520933
mov ecx, 0xfc558bc9
mov edx, dword [ebp - 4]
cmp edx, dword [ebp - 0xc]
je 0x5209d7
nop
jo 0x520942
or ebx, ebx
jmp 0x520946
jg 0x520952
ja 0x52094a
mov esp, esp
ja 0x52094e
jle 0x520952
mov ebp, 0xf0458ba8
mov eax, dword [ebp - 0x10]
shl eax, 4
mov ecx, dword [ebp - 0x10]
shr ecx, 5
xor eax, ecx
mov edx, dword [ebp - 0x10]
xor edx, dword [ebp - 4]
add eax, edx
mov ecx, dword [ebp - 4]
and ecx, 3
mov edx, dword [ebp + 8]
add eax, dword [edx + ecx*4]
mov ecx, dword [ebp - 8]
add ecx, eax
mov dword [ebp - 8], ecx
jo 0x52097e
jnp 0x520980
jbe 0x520982
cmp edx, ebx
jne 0x52098c
mov edx, edx
je 0x52098c
mov esp, 0xfc558b23
mov edx, dword [ebp - 4]
sub edx, 0x61c88647
mov dword [ebp - 4], edx
jle 0x52099a
je 0x5209a5
xchg esp, esp
ja 0x5209a0
jb 0x5209a2
jne 0x5209a5
mov ecx, 0xc1f8458b
loopne 0x5209af
mov eax, dword [ebp - 8]
shl eax, 4
mov ecx, dword [ebp - 8]
shr ecx, 5
xor eax, ecx
mov edx, dword [ebp - 8]
xor edx, dword [ebp - 4]
add eax, edx
mov ecx, dword [ebp - 4]
shr ecx, 0xb
and ecx, 3
mov edx, dword [ebp + 8]
add eax, dword [edx + ecx*4]
mov ecx, dword [ebp - 0x10]
add ecx, eax
mov dword [ebp - 0x10], ecx
jmp 0x520933
jmp 0x8c133cb9
jmp 0x520ae9
xor edi, dword [esp + 0x10]
xor edi, dword [esp + 0x10]
jp 0x5209e6
jne 0x520a07
pushf
xor ecx, 0x58c7
xor ecx, 0x58c7
ja 0x5209f8
jb 0x5209fa
add edi, dword [esp]
sub edi, dword [esp]
popf
jbe 0x520a04
je 0x520a07
add eax, 0xf710558b
fisubr dword [ecx - 0x2e]
mov ecx, 0x899e3779
push ebp
cld
mov edx, dword [ebp + 0x10]
neg edx
imul edx, edx, 0x9e3779b9
mov dword [ebp - 4], edx
cld
jae 0x520a1f
jp 0x520a1a
jnp 0x520a1c
jb 0x520a1f
mov ecx, 0xfc7d83
cmp dword [ebp - 4], 0
je 0x520ae9
cmp edi, 0x698
cmp esp, 0x2e65
add edi, dword [esp]
sub edi, dword [esp]
jae 0x520a3d
jge 0x520a4b
lea edx, [edx]
xchg edi, edi
mov edi, edi
mov ebx, ebx
jl 0x520a4b
xor eax, 0xf8458b41
mov eax, dword [ebp - 8]
shl eax, 4
mov ecx, dword [ebp - 8]
shr ecx, 5
xor eax, ecx
mov edx, dword [ebp - 8]
xor edx, dword [ebp - 4]
add eax, edx
mov ecx, dword [ebp - 4]
shr ecx, 0xb
and ecx, 3
mov edx, dword [ebp + 8]
add eax, dword [edx + ecx*4]
mov ecx, dword [ebp - 0x10]
sub ecx, eax
mov dword [ebp - 0x10], ecx
rol edx, 0
xchg esi, esi
jo 0x520a7f
ja 0x520a8e
pushf
jb 0x520a85
popf
jg 0x520a89
jb 0x520a8b
jbe 0x520a8e
or dword [ebx - 0x3d7e03ab], 0x61c88647
mov edx, dword [ebp - 4]
add edx, 0x61c88647
mov dword [ebp - 4], edx
sub esp, 0
xor edi, 0
test dword [esp + 4], edi
jg 0x520aba
jns 0x520aa8
nop
lea esi, [esi + 0x4423]
lea esi, [esi - 0x4423]
jle 0x520aba
jmp 0x45dd1cd5
mov eax, dword [ebp - 0x10]
shl eax, 4
mov ecx, dword [ebp - 0x10]
shr ecx, 5
xor eax, ecx
mov edx, dword [ebp - 0x10]
xor edx, dword [ebp - 4]
add eax, edx
mov ecx, dword [ebp - 4]
and ecx, 3
mov edx, dword [ebp + 8]
add eax, dword [edx + ecx*4]
mov ecx, dword [ebp - 8]
sub ecx, eax
mov dword [ebp - 8], ecx
jmp 0x520a1f
mov esi, esi
xchg edi, edi
jle 0x520aef
js 0x520af1
je 0x520afb
mov esp, esp
mov esp, esp
jne 0x520afb
sub eax, 0xc558b3b
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 8]
mov dword [edx], eax
test ecx, edi
xchg esp, esp
rol edi, 0x1f
ror edi, 0x1f
je 0x520b0f
jb 0x520b1a
lea edx, [edx]
mov esp, esp
lea esi, [esi]
jae 0x520b1a
lcall 0xf055, 0x8b0c4d8b
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x10]
mov dword [ecx + 4], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret