Function at 0xaf8f10
Capabilities:
Encode data using xor

Disassembly:
test bl, 1
mov ebx, ebp
je 0xaf8c56
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0xaf8c56
mov word [esp + ebx*4 + 0xb0], cx
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.00af9540
add esp, 0xc
test ebx, ebx
sete byte [esp + 8]
je 0xaf8d10
xor eax, eax
cmp ebx, 1
je 0xaf8ccf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
add eax, 2
cmp ecx, eax
jne 0xaf8c90
test bl, 1
je 0xaf8cf0
movzx eax, word [esp + eax*4 + 0xb0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x530]
shr eax, 8
inc dword [esp + eax*4 + 0x930]
mov eax, dword [esp + 0x930]
jmp 0xaf8d19
xor ebx, ebx
mov byte [esp + 8], 1
xor eax, eax
xor ecx, ecx
mov dword [esp], ebx
cmp eax, ebx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x28], eax
lea ebp, [esp + 0x1130]
xor esi, esi
lea edx, [esp + 0xb0]
lea eax, [esp + 0x534]
xor ecx, ecx
jmp 0xaf8d6d
mov esi, dword [esp + 4]
inc esi
add ecx, 8
mov eax, dword [esp + 0xc]
add eax, 0x400
mov edx, ebx
cmp esi, dword [esp + 0x28]
je 0xaf8e0d
mov dword [esp + 4], esi
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x10], edx
xor edx, edx
xor esi, esi
nop
nop
nop
mov dword [esp + edx*4 + 0xd30], esi
mov edi, dword [eax + edx*4 - 4]
mov ebx, edi
xor ebx, esi
and edi, esi
lea esi, [ebx + edi*2]
mov dword [esp + edx*4 + 0xd34], esi
mov edi, dword [eax + edx*4]
add edx, 2
mov ebx, edi
xor ebx, esi
and edi, esi
lea esi, [ebx + edi*2]
cmp edx, 0x100
jne 0xaf8d80
mov dword [esp + 0xc], eax
cmp byte [esp + 8], 0
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x10]
jne 0xaf8d50
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebx
movzx ebx, word [ebp + edx*4]
shr ebx, cl
movzx esi, bl
mov edi, dword [esp + esi*4 + 0xd30]
lea ebx, [edi + 1]
mov dword [esp + esi*4 + 0xd30], ebx
mov ebx, eax
mov eax, dword [esp]
mov esi, dword [ebp + edx*4]
mov dword [ebx + edi*4], esi
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
cmp edx, eax
jb 0xaf8dd0
jmp 0xaf8d50
cmp dword [esp], 0
je 0xaf9195
mov edx, dword [esp]
cmp edx, 1
jne 0xaf8e29
mov word [ebx], 1
jmp 0xaf90ac
movzx eax, word [ebx + 4]
add word [ebx], ax
lea ebp, [edx - 2]
cmp edx, 3
jl 0xaf8f35
mov dword [esp + 0xc], ebp
mov ecx, 2
mov edi, 2
sub edi, edx
mov esi, 1
xor ebp, ebp
jmp 0xaf8e7b
movzx edx, word [ebx + ebp*4]
add word [ebx + esi*4], dx
mov word [ebx + ebp*4], si
inc ebp
lea eax, [edi + esi]
inc eax
inc esi
cmp eax, 1
je 0xaf8f41
cmp ecx, dword [esp]
jge 0xaf8ea0
movzx edx, word [ebx + ecx*4]
movzx eax, word [ebx + ebp*4]
cmp ax, dx
jb 0xaf8ea4
inc ecx
mov word [ebx + esi*4], dx
cmp ecx, dword [esp]
jge 0xaf8e60
jmp 0xaf8eb2
movzx eax, word [ebx + ebp*4]
mov word [ebx + esi*4], ax
mov word [ebx + ebp*4], si
inc ebp
cmp ecx, dword [esp]
jge 0xaf8e60
cmp ebp, esi
jge 0xaf8ed0
movzx edx, word [ebx + ebp*4]
movzx eax, word [ebx + ecx*4]
cmp dx, ax
jb 0xaf8e64
jmp 0xaf8ed4
movzx eax, word [ebx + ecx*4]
inc ecx
add word [ebx + esi*4], ax
jmp 0xaf8e6d
add eax, 2
cmp ecx, eax
je 0xaf8c25
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0xaf8f16
mov word [esp + ebp*4 + 0xb0], si
mov word [esp + ebp*4 + 0xb2], ax
lodsb al, byte [esi]
mov dl, 0
add byte [eax], al
lodsb al, byte [esi]
mov dl, 0
add byte [eax], al
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0xaf8ef0
mov word [esp + ebp*4 + 0xb0], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xb2], si
inc ebp
jmp 0xaf8ef0
mov word [ebx + edx*4 - 8], 0
jmp 0xaf8fc1
mov eax, dword [esp]
mov word [ebx + eax*4 - 8], 0
lea edx, [eax - 3]
mov ebp, dword [esp + 0xc]
mov esi, ebp
mov ecx, edx
and esi, 3
je 0xaf8f71
mov ecx, edx
nop
nop
nop
movzx eax, word [ebx + ecx*4]
movzx eax, word [ebx + eax*4]
inc eax
mov word [ebx + ecx*4], ax
dec ecx
dec esi
jne 0xaf8f60
cmp edx, 3
jb 0xaf8fc1
inc ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebx + ecx*4 - 4]
movzx eax, word [ebx + eax*4]
inc eax
mov word [ebx + ecx*4 - 4], ax
movzx eax, word [ebx + ecx*4 - 8]
movzx eax, word [ebx + eax*4]
inc eax
mov word [ebx + ecx*4 - 8], ax
movzx eax, word [ebx + ecx*4 - 0xc]
movzx eax, word [ebx + eax*4]
inc eax
mov word [ebx + ecx*4 - 0xc], ax
movzx eax, word [ebx + ecx*4 - 0x10]
movzx eax, word [ebx + eax*4]
inc eax
mov word [ebx + ecx*4 - 0x10], ax
add ecx, 0xfffffffc
jne 0xaf8f80
mov ecx, dword [esp]
mov eax, ecx
or eax, 0xfffffffe
and ecx, 0xfffffffe
add ecx, eax
inc ecx
mov esi, 1
xor edx, edx
jmp 0xaf8fec
lea esi, [eax + eax]
inc edx
test eax, eax
jle 0xaf90a2
test ebp, ebp
js 0xaf9020
lea eax, [ebp + 1]
mov dword [esp + 4], eax
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebx + ebp*4]
cmp edx, edi
jne 0xaf9022
inc eax
add ebp, 0xffffffff
jb 0xaf9000
mov ebp, 0xffffffff
mov eax, dword [esp + 4]
jmp 0xaf9022
xor eax, eax
mov edi, esi
sub edi, eax
jle 0xaf8fe0
mov dword [esp + 0x10], edi
mov edi, eax
not edi
add edi, esi
and dword [esp + 0x10], 3
je 0xaf906c
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov dword [esp + 0xc], ebp
lea ebp, [ebx + ecx*4]
xor eax, eax
mov edi, dword [esp + 0x10]
nop
nop
mov word [ebp], dx
inc eax
add ebp, 0xfffffffc
cmp edi, eax
jne 0xaf9050
sub esi, eax
sub ecx, eax
mov ebp, dword [esp + 0xc]
mov eax, dword [esp + 4]
mov edi, dword [esp + 8]
cmp edi, 3
jb 0xaf8fe0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebx + ecx*4], dx
mov word [ebx + ecx*4 - 4], dx
mov word [ebx + ecx*4 - 8], dx
mov word [ebx + ecx*4 - 0xc], dx
add ecx, 0xfffffffc
add esi, 0xfffffffc
cmp esi, eax
jg 0xaf9080
jmp 0xaf8fe0
cmp dword [esp], 0
jle 0xaf9195
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0xaf90fa
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0xaf90d0
test eax, eax
je 0xaf911d
lea ecx, [ebx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x2c]
inc edx
cmp eax, edx
jne 0xaf9110
cmp dword [esp], 2
jl 0xaf9195
mov edi, dword [esp + 0x15c8]
lea eax, [edi + 1]
cmp eax, 0x21
jge 0xaf9169
mov ecx, dword [esp + edi*4 + 0x2c]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, dword [esp + eax*4 + 0x2c]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + edi*4 + 0x2c], ecx
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
cmp eax, 0x21
jl 0xaf9140
test edi, edi
jle 0xaf93fd
lea edx, [edi + 1]
xor ecx, ecx
xor eax, eax
mov esi, dword [esp + edx*4 + 0x28]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0xaf9170
mov edx, 1
mov ecx, dword [esp + 0x15c8]
shl edx, cl
cmp eax, edx
jne 0xaf9408
mov ebp, dword [esp + 0x14]
shl ebp, 5
mov edi, dword [esp + 0x24]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00af9540
add esp, 0xc
mov eax, dword [esp + 0x20]
mov esi, edi
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00af9540
add esp, 0xc
cmp dword [esp + 0x15c8], 0
jle 0xaf92d5
add ebx, 0xfffffffe
mov eax, 1
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], ebp
jmp 0xaf9220
mov edi, ebx
mov ebx, dword [esp]
mov ebp, esi
mov esi, ebp
mov dword [esp], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c8]
mov eax, ecx
mov ebx, edi
je 0xaf92d5
mov edi, dword [esp + eax*4 + 0x2c]
test edi, edi
jle 0xaf9200
mov edx, edi
and edx, 3
je 0xaf9270
mov dword [esp + 4], edi
mov ecx, esi
mov esi, dword [esp]
lea ebp, [ebx + esi*4]
xor esi, esi
nop
nop
nop
movzx edi, word [ebp]
mov ebx, dword [esp + 0x14]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0xaf9240
sub dword [esp], esi
mov edi, dword [esp + 4]
mov edx, edi
sub edx, esi
mov esi, ecx
jmp 0xaf9272
mov edx, edi
cmp edi, 4
mov ebx, dword [esp]
mov edi, dword [esp + 0x1c]
mov ebp, esi
jb 0xaf9207
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x14]
add esi, ebp
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0xaf9290
jmp 0xaf9207
mov ebx, dword [esp + 0x15c4]
mov edi, esi
mov dword [esp + 0x534], 0
cmp dword [esp + 0x15c8], 2
jl 0xaf9321
xor eax, eax
mov ecx, 2
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
cmp ecx, dword [esp + 0x15c8]
jle 0xaf9300
test ebx, ebx
jle 0xaf93f2
xor eax, eax
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, edi
shl ecx, 6
add ecx, edi
mov dword [esp], ecx
jmp 0xaf936b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c4]
inc eax
cmp eax, ebx
je 0xaf93f2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0xaf9362
mov ebp, dword [esp + ecx*4 + 0x530]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x530], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0xaf93cf
and ecx, 0xfffffffc
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
mov esi, ebp
and esi, 1
shl esi, 2
lea esi, [esi + ebx*8]
mov ebx, ebp
and ebx, 2
or ebx, esi
mov esi, ebp
shr esi, 2
and esi, 1
or esi, ebx
mov ebx, ebp
shr ebx, 3
and ebx, 1
lea ebx, [ebx + esi*2]
shr ebp, 4
add ecx, 0xfffffffc
jne 0xaf93a0
test edi, edi
je 0xaf9350
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, ebp
and ecx, 1
lea ebx, [ecx + ebx*2]
shr ebp, 1
dec edi
jne 0xaf93e0
jmp 0xaf9350
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, edi
mov edx, 1
shl edx, cl
xor eax, eax
mov ecx, dword [esp + 0x15c8]
dec ecx
jmp 0xaf9429
dec eax
cmp eax, edx
je 0xaf9195
mov esi, dword [esp + 0x15c8]
dec dword [esp + esi*4 + 0x2c]
mov esi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
test esi, esi
jle 0xaf9420
mov ebp, dword [esp + esi*4 + 0x2c]
dec esi
test ebp, ebp
je 0xaf9440
dec ebp
mov dword [esp + esi*4 + 0x30], ebp
add dword [esp + esi*4 + 0x34], 2
jmp 0xaf9420