Function at 0x52d584
Capabilities:
Encode data using xor

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x18
mov edi, ecx
xor eax, eax
mov ebp, dword [esp + 0x2c]
mov ebx, dword [esp + 0x30]
mov dword [esp], ebp
mov dword [edi + 4], eax
mov dword [edi], eax
mov dword [0xa73348], eax
mov eax, ebp
mov ebp, eax
mov edx, dword [ebp + 4]
test edx, edx
je 0x52d645
mov ecx, dword [edx + 4]
test ecx, ecx
je 0x52d645
movsx edx, word [ecx]
add ecx, 2
cmp edx, 0xff
je 0x52d645
mov dword [esp + 4], ebp
movzx edx, dl
cmp edx, 8
jl 0x52d633
cmp edx, 0x10
jge 0x52d607
mov eax, ecx
movzx edx, word [eax]
add ecx, 2
and edx, 0x1fff
cmp edx, ebx
jne 0x52d5fb
mov dword [0xa73348], 1
jmp 0x52d633
mov dword [0xa73348], 0
jmp 0x52d633
cmp edx, 0x40
jge 0x52d617
movzx eax, word [ecx]
add eax, eax
lea ecx, [eax + ecx + 2]
jmp 0x52d633
mov eax, dword [0xa73348]
movzx ebp, word [ecx]
add ecx, 2
test eax, eax
je 0x52d62f
cmp edx, 0x41
je 0x52d75e
add ebp, ebp
add ecx, ebp
movsx edx, word [ecx]
add ecx, 2
cmp edx, 0xff
jne 0x52d5d0
mov ebp, dword [esp + 4]
mov edx, dword [ebp + 0x2c]
test edx, edx
je 0x52d655
push ebx
push edx
mov ecx, edi
call fcn.0052d9a0
mov ebp, dword [ebp + 0x30]
test ebp, ebp
jne 0x52d5a8
mov ebp, dword [esp]
mov eax, dword [edi + 4]
add eax, eax
add eax, eax
add eax, eax
push eax
call fcn.008581c5
mov dword [edi + 8], eax
mov eax, dword [edi]
add eax, eax
add eax, eax
push eax
call fcn.008581c5
add esp, 8
mov ebx, dword [esp + 0x30]
mov edx, dword [edi + 8]
mov dword [0xa73348], 0
mov dword [edi + 0xc], eax
mov dword [0xa73350], edx
mov dword [0xa7334c], eax
mov eax, dword [ebp + 4]
test eax, eax
je 0x52d737
mov esi, dword [eax + 4]
test esi, esi
je 0x52d737
movsx eax, word [esi]
add esi, 2
cmp eax, 0xff
je 0x52d737
movzx eax, al
cmp eax, 8
jl 0x52d72a
cmp eax, 0x10
jge 0x52d6fd
mov eax, esi
movzx edx, word [eax]
add esi, 2
and edx, 0x1fff
cmp edx, ebx
jne 0x52d6f1
mov dword [0xa73348], 1
jmp 0x52d72a
mov dword [0xa73348], 0
jmp 0x52d72a
cmp eax, 0x40
jge 0x52d70d
movzx eax, word [esi]
add eax, eax
lea esi, [eax + esi + 2]
jmp 0x52d72a
mov edx, dword [0xa73348]
movzx ecx, word [esi]
add esi, 2
test edx, edx
je 0x52d726
cmp eax, 0x41
je 0x52d846
add ecx, ecx
add esi, ecx
movsx eax, word [esi]
add esi, 2
cmp eax, 0xff
jne 0x52d6c6
mov eax, dword [ebp + 0x2c]
test eax, eax
je 0x52d747
push ebx
push eax
mov ecx, edi
call fcn.0052db64
mov ebp, dword [ebp + 0x30]
test ebp, ebp
jne 0x52d6a3
mov eax, edi
add esp, 0x18
pop ebx
pop ebp
pop esi
pop edi
ret 8
add dword [edi + 4], 1
movzx eax, word [ecx]
add ecx, 2
and eax, 0x3fff
mov esi, 0
je 0x52d633
cmp eax, 5
jb 0x52d842
mov ebp, dword [edi]
mov dword [esp + 8], eax
lea edx, [eax - 5]
mov dword [esp + 0xc], edx
movsx eax, word [ecx]
cdq
add esi, 4
xor eax, edx
sub eax, edx
movsx edx, ax
add ebp, edx
mov dword [edi], ebp
lea eax, [edx + edx]
add eax, edx
lea edx, [eax + eax]
movsx eax, word [ecx + eax*2 + 2]
lea ebx, [edx + ecx + 2]
cdq
xor eax, edx
sub eax, edx
movsx edx, ax
add ebp, edx
mov dword [edi], ebp
lea eax, [edx + edx]
add eax, edx
lea edx, [eax + eax]
movsx eax, word [ebx + eax*2 + 2]
lea edx, [edx + ebx + 2]
mov dword [esp + 0x14], edx
mov ebx, edx
cdq
xor eax, edx
sub eax, edx
movsx edx, ax
add ebp, edx
mov dword [edi], ebp
lea eax, [edx + edx]
add eax, edx
lea edx, [eax + eax]
movsx eax, word [ebx + eax*2 + 2]
lea ecx, [edx + ebx + 4]
cdq
xor eax, edx
sub eax, edx
movsx eax, ax
add ebp, eax
mov dword [edi], ebp
lea edx, [eax + eax]
add edx, eax
mov eax, dword [esp + 0xc]
add edx, edx
add ecx, edx
cmp esi, eax
jbe 0x52d78e
mov eax, dword [esp + 8]
mov ebx, dword [esp + 0x30]
mov ebx, eax
movsx eax, word [ecx]
cdq
add esi, 1
xor eax, edx
sub eax, edx
movsx edx, ax
add ebp, edx
mov dword [edi], ebp
lea eax, [edx + edx]
add eax, edx
add eax, eax
lea ecx, [eax + ecx + 2]
cmp esi, ebx
jb 0x52d818
mov ebx, dword [esp + 0x30]
jmp 0x52d633
mov ebp, dword [edi]
jmp 0x52d816
mov eax, dword [0xa73350]
mov dword [eax], esi
mov eax, dword [0xa73350]
mov edx, dword [0xa7334c]
mov dword [eax + 4], edx
add eax, 8
mov dword [0xa73350], eax
movzx eax, word [esi]
add esi, 2
and eax, 0x3fff
mov ecx, 0
je 0x52d72a
mov dword [esp], ebp
mov ebx, eax
mov dword [esp + 0x10], edi
movsx eax, word [esi]
cdq
add esi, 2
add ecx, 1
xor eax, edx
sub eax, edx
movsx ebp, ax
xor edx, edx
test ebp, ebp
jle 0x52d987
cmp ebp, 4
jl 0x52d94b
mov dword [esp + 8], ecx
mov dword [esp + 0xc], ebx
lea eax, [ebp - 4]
mov edi, dword [0xa7334c]
movzx ebx, word [esi + 2]
lea ecx, [edi + 2]
mov dword [0xa7334c], ecx
mov word [edi], bx
movzx ebx, word [esi + 4]
mov edi, dword [0xa7334c]
lea ecx, [edi + 2]
mov dword [0xa7334c], ecx
mov word [edi], bx
movzx ebx, word [esi + 8]
add edx, 3
mov edi, dword [0xa7334c]
lea ecx, [edi + 2]
mov dword [0xa7334c], ecx
mov word [edi], bx
movzx ebx, word [esi + 0xa]
mov edi, dword [0xa7334c]
lea ecx, [edi + 2]
mov dword [0xa7334c], ecx
mov word [edi], bx
movzx ebx, word [esi + 0xe]
mov edi, dword [0xa7334c]
lea ecx, [edi + 2]
mov dword [0xa7334c], ecx
mov word [edi], bx
movzx ebx, word [esi + 0x10]
add esi, 0x12
mov edi, dword [0xa7334c]
lea ecx, [edi + 2]
mov dword [0xa7334c], ecx
mov word [edi], bx
cmp edx, eax
jle 0x52d8b1
mov ecx, dword [esp + 8]
mov ebx, dword [esp + 0xc]
mov dword [esp + 0xc], ebx
mov edi, dword [0xa7334c]
movzx ebx, word [esi + 2]
lea eax, [edi + 2]
mov dword [0xa7334c], eax
mov word [edi], bx
movzx ebx, word [esi + 4]
mov edi, dword [0xa7334c]
lea eax, [edi + 2]
mov dword [0xa7334c], eax
mov word [edi], bx
add edx, 1
add esi, 6
cmp edx, ebp
jl 0x52d94f
mov ebx, dword [esp + 0xc]
cmp ecx, ebx
jb 0x52d882
mov ebx, dword [esp + 0x30]
mov ebp, dword [esp]
mov edi, dword [esp + 0x10]
jmp 0x52d72a