Function at 0x412af2
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
mov eax, dword [0xaa1e14]
mov ecx, 0xffff
sub eax, dword [esp + 0x48]
mov dword [esp + 0xc], eax
mov eax, dword [0xaa1e30]
push ebx
mov ebx, dword [esp + 0x48]
push ebp
mov ebp, dword [esp + 0x48]
push esi
mov eax, dword [ebx + eax*4]
mov esi, dword [esp + 0x38]
mov dword [esp + 0xc], eax
mov eax, dword [0xaa1dfc]
mov dword [esp + 0x1c], eax
add eax, esi
mov dword [esp + 0x14], eax
xor esi, 0x10d0
mov ax, word [0xaa1df8]
add ax, cx
mov word [0xaa1df8], ax
movzx eax, ax
push edi
mov edi, dword [esp + 0x38]
mov eax, dword [ebx + eax*4]
mov dword [esp + 0x2c], eax
inc word [edi]
movzx ecx, word [edi]
mov eax, dword [0xaa1e10]
mov edx, dword [0xaa1e14]
mov al, byte [eax + ecx*4]
mov ecx, dword [0xaa1de4]
mov byte [esp + 0x58], al
mov eax, dword [ebx + edx*4 + 0x2c]
mov ebx, dword [esp + 0x60]
xor eax, 0xf3a
mov dword [esp + 0x14], eax
inc ecx
mov dword [0xaa1de4], ecx
movzx eax, byte [ebp]
movzx eax, word [ebx + eax*8]
mov ebx, dword [0xaa1de0]
xor eax, ecx
mov dword [esp + 0x30], eax
sub ecx, 2
mov eax, dword [0xaa1e08]
mov dword [esp + 0x3c], eax
movzx eax, si
mov esi, dword [esp + 0x14]
mov dword [0xaa1de4], ecx
mov dword [esp + 0x24], eax
movzx eax, word [edi + edx*2]
mov edx, dword [esp + 0x40]
mov dword [esp + 0x28], ebx
cmp dword [edx + ecx*4], eax
jle 0x412c16
inc word [edi]
movzx edx, word [edi]
mov eax, dword [0xaa1dec]
mov cl, byte [esi + edx*4]
cmp cl, byte [edx + eax + 6]
mov ecx, dword [esp + 0x44]
jb 0x412c0e
imul eax, dword [ecx], 6
mov edx, dword [esp + 0x60]
movzx eax, word [eax + edx]
cmp eax, dword [0xaa1de8]
jg 0x412c0e
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
movzx eax, byte [eax + ebp]
cmp dword [0xaa1e24], eax
jl 0x412cbb
mov ebx, dword [0xaa1de0]
jmp 0x412c1a
mov ecx, dword [esp + 0x44]
movzx eax, byte [ebp]
mov edx, dword [esp + 0x1c]
sub ebx, dword [edx + eax*4]
mov dword [edx + eax*4], ebx
movzx eax, word [0xaa1df8]
imul eax, eax, 0xc
mov ecx, dword [eax + ecx]
mov eax, dword [esp + 0x5c]
xor ecx, dword [eax + 0x1334]
imul eax, ecx, 0xf53
mov ecx, dword [esp + 0x10]
cdq
idiv dword [0xaa1dfc]
mov eax, dword [ecx]
mov byte [ebp + eax*4], dl
inc word [0xaa1df8]
dec byte [ebp]
mov eax, dword [0xaa1e24]
mov edx, dword [esp + 0x28]
mov cl, byte [ecx + eax*8]
movzx eax, byte [ebp]
sub cl, byte [esp + 0x48]
mov byte [eax + esi + 0xc], cl
mov eax, dword [0xaa1e30]
mov ecx, dword [esp + 0x40]
mov dword [ecx + eax*4], edx
mov dx, word [0xaa1df8]
mov eax, dword [esp + 0x64]
movzx ecx, dx
add ecx, ecx
imul eax, dword [eax + ecx*8], 0x16d
sub eax, dword [esp + 0x2c]
imul eax, dword [0x644e]
imul eax, dword [0xaa1e28]
inc dx
mov word [0xaa1df8], dx
mov dword [0xaa1e28], eax
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x3c]
mov ebx, dword [0xaa1e30]
movzx esi, ax
mov eax, dword [esp + 0x44]
imul eax, dword [eax], 0xc
cmp esi, dword [eax + ecx - 0x1403]
je 0x412d56
imul eax, dword [esp + 0x20], 0x126f
mov edi, dword [esp + 0x44]
mov ebp, dword [esp + 0x10]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x18]
xor edx, edx
movzx ecx, word [eax + ebx*2 + 0x4a]
mov eax, dword [0xaa1df4]
div ecx
mov ecx, dword [esp + 0x18]
mov word [ecx + ebx*2 + 0x4a], ax
mov ax, word [0xaa1df8]
inc ax
mov ebx, dword [0xaa1e30]
mov word [0xaa1df8], ax
movzx ecx, ax
mov eax, dword [esp + 0x60]
cdq
idiv dword [ebp + ecx*4]
mov cl, byte [0xaa1dfa]
mov edx, dword [esp + 0x3c]
xor al, bl
xor cl, al
inc esi
mov byte [0xaa1dfa], cl
imul eax, dword [edi], 0xc
cmp esi, dword [eax + edx - 0x1403]
jne 0x412cf0
mov edi, dword [esp + 0x38]
mov ebp, dword [esp + 0x50]
jmp 0x412d5c
mov cl, byte [0xaa1dfa]
mov eax, dword [esp + 0x3c]
mov esi, dword [0xaa1df0]
mov edx, dword [esp + 0x30]
push 0x1df
mov eax, dword [eax - 0x144f]
mov eax, dword [esi + eax*4]
add eax, dword [edx + ebx*8]
xor edx, edx
div dword [0x26a5]
movzx eax, cl
movzx ecx, dl
mov edx, dword [0xaa1e14]
imul ecx, eax
add edx, edx
mov byte [0xaa1dfa], cl
movzx eax, byte [ebp]
mov ecx, dword [esi + 0x6024]
mov esi, dword [esp + 0x20]
sub ecx, dword [eax*4 + 0x69a]
mov eax, dword [esp + 0x44]
sub ecx, dword [eax + edx*8]
mov dword [eax + edx*8], ecx
xor edx, edx
mov eax, dword [esp + 0x14]
mov ecx, dword [0xaa1e30]
mov eax, dword [eax]
mov eax, dword [eax*4 + 0x656]
div dword [esi + ecx*4]
movzx eax, word [0xaa1df8]
and edx, eax
mov eax, 0xe3d
sub eax, dword [esp + 0x24]
or ecx, edx
push eax
mov dword [0xaa1e30], ecx
call fcn.00404b47
mov ebx, dword [esp + 0x1c]
xor edx, edx
mov ebp, dword [esp + 0x2c]
pop ecx
pop ecx
imul ecx, dword [0xaa1e14], 6
movzx esi, bp
mov word [ecx + edi], ax
mov cx, word [0xaa1df8]
movzx eax, cx
imul eax, eax, 3
movzx eax, byte [eax + ebx + 8]
div esi
mov eax, edx
cdq
idiv dword [0xaa1e30]
xor edx, edx
mov dword [0xaa1e30], eax
mov eax, 0xffff
add cx, ax
mov eax, dword [esp + 0x3c]
mov word [0xaa1df8], cx
mov eax, dword [eax - 0x144f]
movzx ecx, word [edi + eax*8]
mov eax, dword [esp + 0x44]
pop edi
pop esi
pop ebp
mov eax, dword [eax]
movzx eax, byte [eax + ebx]
div ecx
mov ecx, 0x18a7
add eax, dword [0xaa1e24]
cdq
idiv ecx
movzx ecx, byte [esp + 0x4c]
mov edx, dword [esp + 0x48]
pop ebx
mov dword [edx + ecx*4], eax
mov cl, byte [0xaa1dfa]
movzx eax, cl
inc cl
mov byte [0xaa1dfa], cl
add esp, 0x24
ret