Function at 0x8003aa77
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov al, byte [0x80060ba0]
cmp al, 1
mov byte [0x80060ba1], al
jne 0x8003aa94
lea eax, [ebp + 0x10]
push eax
call fcn.8003a72a
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
xor edi, edi
cmp ebx, edi
jne 0x8003aaa8
mov ebx, 0xf010101
mov dword [ebp + 0x10], ebx
movzx eax, byte [ebp + 0x12]
mov dword [ebp - 0x1c], eax
movzx eax, bh
mov dword [ebp - 0x28], eax
mov ecx, ebx
mov edx, ebx
shr ecx, 0x18
and edx, 0xc0000000
mov eax, ebx
and cl, 0xf
and eax, 0x7f
cmp edx, 0x80000000
mov dword [ebp - 0x24], edx
mov byte [ebp - 3], cl
je 0x8003aaf3
cmp dword [0x80056d08], 2
jne 0x8003aaea
movzx eax, byte [eax - 0x7ffea054]
jmp 0x8003ab0c
movzx eax, byte [eax - 0x7ffea074]
jmp 0x8003ab0c
cmp dword [0x80056d08], 2
jne 0x8003ab05
movzx eax, byte [eax - 0x7ffea02c]
jmp 0x8003ab0c
movzx eax, byte [eax - 0x7ffea034]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x14]
sub eax, 0x10
je 0x8003ab39
dec eax
je 0x8003ab2c
dec eax
je 0x8003ab26
sub eax, 0xa
je 0x8003ab39
dec eax
dec eax
jne 0x8003ab44
mov byte [ebp + 0x17], 3
jmp 0x8003ab3d
mov dword [ebp - 0xc], 0x101030
mov byte [ebp + 0x17], 2
jmp 0x8003ab44
mov byte [ebp + 0x17], 2
mov dword [ebp - 0xc], 0x100030
mov eax, dword [ebp + 0x18]
shr eax, 3
cmp dword [0x80060b90], ebx
mov dword [ebp + 0x18], eax
jne 0x8003abce
cmp dword [0x80060b9c], 2
je 0x8003abce
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword [esi + 0x680600], ecx
mov byte [esi + 0x6013d4], 0x1f
mov byte [esi + 0x6013d5], 0x57
mov byte [esi + 0x6013d4], 0x13
mov byte [esi + 0x6013d5], al
shr eax, 3
and ax, 0xe0
mov byte [esi + 0x6013d4], 0x19
mov byte [esi + 0x6013d5], al
mov al, byte [ebp + 0x17]
push edi
or al, 0x80
push 5
mov byte [esi + 0x6013d4], 0x28
mov byte [esi + 0x6013d5], al
mov eax, dword [ebp + 0x1c]
push 0xb
push esi
mov dword [esi + 0x600800], eax
call sym.xboxkrnl.exe_Ordinal_2
push edi
push edi
push 0xe
push esi
call sym.xboxkrnl.exe_Ordinal_2
jmp 0x8003afe3
xor edi, edi
inc edi
cmp byte [0x80060ba1], 1
jne 0x8003abe5
push edi
push 0x60
call fcn.8003a394
mov ebx, dword [ebp + 0x10]
lea eax, [ebp + 0xc]
push eax
push edi
mov dword [0x80060b90], ebx
push 4
mov ebx, 0xe0
push ebx
call sym.xboxkrnl.exe_Ordinal_45
mov eax, dword [ebp + 0xc]
or eax, 0xf
push eax
push edi
push 4
push ebx
call sym.xboxkrnl.exe_Ordinal_50
lea eax, [ebp + 0xc]
push eax
push edi
xor esi, esi
push esi
push ebx
call sym.xboxkrnl.exe_Ordinal_45
mov eax, dword [ebp + 0xc]
and eax, 0xfffffffd
push eax
push edi
push esi
push ebx
call sym.xboxkrnl.exe_Ordinal_50
push edi
mov dword [0x80045bd8], esi
mov dword [0x8004a8b0], esi
call sym.xboxkrnl.exe_Ordinal_151
mov esi, dword [ebp + 8]
mov dx, 0x80d3
mov al, 5
out dx, al
mov eax, dword [esi + 0x6806a0]
mov ecx, eax
shr ecx, 4
mov dword [ebp - 0x2c], eax
not ecx
not eax
xor ecx, eax
test cl, 1
jne 0x8003ac46
mov byte [esi + 0x6013d4], 0x1f
mov byte [esi + 0x6013d5], 0x57
mov byte [esi + 0x6013d4], 0x21
mov byte [esi + 0x6013d5], 0xff
mov byte [esi + 0x6013d4], 0x28
mov byte [esi + 0x6013d5], 0
push edi
mov dword [esi + 0x680880], 0x21121111
call sym.xboxkrnl.exe_Ordinal_151
mov edi, dword [ebp - 8]
imul edi, edi, 0x2a
lea edi, [edi - 0x7ffeb0e0]
lea eax, [edi + 0x2a]
cmp edi, eax
mov dword [ebp - 0x10], eax
jae 0x8003acd1
mov dword [ebp + 8], 0x80014f20
sub dword [ebp + 8], edi
movzx eax, byte [edi]
push eax
mov eax, dword [ebp + 8]
movzx eax, byte [eax + edi]
push eax
push esi
call fcn.8003a7ad
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x8003acb9
cmp dword [0x80056d08], 2
jne 0x8003ad0c
cmp dword [ebp - 8], 0xd
je 0x8003acec
cmp dword [ebp - 8], 0xe
je 0x8003acec
cmp dword [ebp - 8], 0x12
jne 0x8003ad0c
lea eax, [ebp + 0xc]
push eax
xor edi, edi
inc edi
push edi
push edi
push ebx
call sym.xboxkrnl.exe_Ordinal_45
mov eax, dword [ebp + 0xc]
and eax, 0xffff7fff
push eax
push edi
push edi
push ebx
call sym.xboxkrnl.exe_Ordinal_50
test byte [ebp + 0x13], 0x20
je 0x8003ad1b
push dword [ebp - 8]
push esi
call fcn.8003a9e1
xor edi, edi
cmp dword [ebp - 0x24], 0x80000000
jne 0x8003ad3c
push edi
push 1
push 7
push ebx
call sym.xboxkrnl.exe_Ordinal_50
push edi
push 1
push 9
push ebx
call sym.xboxkrnl.exe_Ordinal_50
lea eax, [ebp + 0xc]
push eax
push 1
push edi
push ebx
call sym.xboxkrnl.exe_Ordinal_45
mov eax, dword [ebp + 0xc]
or eax, 2
push eax
push 1
push edi
push ebx
call sym.xboxkrnl.exe_Ordinal_50
push edi
push 0xf
call fcn.8003aa41
push edi
push 5
push 0xb
push esi
call sym.xboxkrnl.exe_Ordinal_2
mov eax, dword [ebp + 0x10]
mov edi, dword [ebp - 0x1c]
and dword [ebp + 8], 0
imul edi, edi, 0x68
shr eax, 0x1c
and al, 1
or al, 4
mov dx, 0x80d6
out dx, al
add dx, 2
mov al, 4
out dx, al
lea ecx, [esi + 0x68050c]
mov eax, dword [ecx]
or eax, 0x10020000
mov dword [ecx], eax
mov eax, dword [ebp - 0xc]
mov byte [esi + 0xc03c3], 1
add edi, 0x80015588
mov byte [esi + 0xc03c2], 0xe3
mov dword [esi + 0x680600], eax
lea eax, [edi + 0x68]
cmp edi, eax
mov dword [ebp - 0x24], eax
jae 0x8003ae1b
cmp byte [0x80060ba1], 1
mov eax, dword [edi]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax*4 - 0x7ffeaa78]
mov dword [ebp - 0x18], eax
jne 0x8003ae07
lea eax, [ebp - 0x14]
push eax
xor eax, eax
mov al, byte [ebp + 8]
add al, 0x1a
shl al, 2
push eax
push 1
call fcn.8003a4ca
lea eax, [ebp - 0x18]
push eax
xor eax, eax
mov al, byte [ebp + 8]
shl al, 2
push eax
push 1
call fcn.8003a4ca
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
add edi, 4
inc dword [ebp + 8]
cmp edi, dword [ebp - 0x24]
mov dword [ecx + esi], eax
jb 0x8003adc2
test byte [ebp + 0x13], 0x20
je 0x8003ae35
xor eax, eax
mov dword [esi + 0x680630], eax
mov dword [esi + 0x6808c4], eax
mov dword [esi + 0x68084c], eax
mov edi, 0x80010ac0
xor ecx, ecx
mov al, byte [edi]
mov byte [esi + 0xc03c4], cl
inc edi
inc ecx
cmp edi, 0x80010ac5
mov byte [esi + 0xc03c5], al
jb 0x8003ae3c
mov edi, 0x80010ab4
xor ecx, ecx
mov al, byte [edi]
mov byte [esi + 0xc03ce], cl
inc edi
inc ecx
cmp edi, 0x80010abd
mov byte [esi + 0xc03cf], al
jb 0x8003ae5b
mov edi, 0x80010a9c
xor edx, edx
lea eax, [esi + 0x6013c0]
mov cl, byte [edi]
mov byte [eax], dl
inc edi
inc edx
cmp edi, 0x80010ab1
mov byte [eax], cl
jb 0x8003ae80
and dword [ebp + 8], 0
mov byte [eax], 0x20
mov eax, dword [ebp - 0x28]
imul eax, eax, 0x22
lea eax, [eax - 0x7ffea2c0]
lea ecx, [eax + 0x22]
cmp eax, ecx
mov byte [esi + 0x6013d4], 0x11
mov byte [esi + 0x6013d5], 0
mov dword [ebp - 0x10], ecx
jae 0x8003af48
mov dword [ebp - 0xc], 0x80015d40
sub dword [ebp - 0xc], eax
mov edi, eax
cmp byte [0x80060ba1], 1
mov eax, dword [ebp - 0xc]
mov al, byte [eax + edi]
mov cl, byte [edi]
mov byte [ebp - 2], al
mov byte [ebp - 1], cl
jne 0x8003af06
lea eax, [ebp - 2]
push eax
push dword [ebp + 8]
push 5
call fcn.8003a4a9
lea eax, [ebp - 1]
push eax
xor eax, eax
mov al, byte [ebp + 8]
add al, 0x22
push eax
push 5
call fcn.8003a4a9
mov al, byte [ebp - 2]
cmp al, 0x13
jne 0x8003af12
mov cl, byte [ebp + 0x18]
mov byte [ebp - 1], cl
jmp 0x8003af30
cmp al, 0x19
jne 0x8003af20
mov ecx, dword [ebp + 0x18]
shr ecx, 3
and cl, bl
jmp 0x8003af2d
cmp al, 0x25
jne 0x8003af30
mov ecx, dword [ebp + 0x18]
shr ecx, 6
and cl, 0x20
or byte [ebp - 1], cl
inc dword [ebp + 8]
mov cl, byte [ebp - 1]
inc edi
cmp edi, dword [ebp - 0x10]
mov byte [esi + 0x6013d4], al
mov byte [esi + 0x6013d5], cl
jb 0x8003aecb
mov eax, dword [ebp - 0x2c]
not eax
and eax, 1
mov dword [esi + 0x6806a0], eax
mov al, byte [ebp + 0x17]
or al, 0x80
mov byte [esi + 0x6013d4], 0x28
mov byte [esi + 0x6013d5], al
xor ecx, ecx
lea eax, [esi + 0x6013da]
test byte [eax], 8
jne 0x8003af70
test byte [eax], 8
je 0x8003af75
inc ecx
cmp ecx, 3
jb 0x8003af70
cmp byte [0x80060ba1], 1
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax*4 - 0x7ffef5b0]
mov dword [ebp - 0x20], eax
jne 0x8003afa3
lea eax, [ebp - 0x20]
push eax
push 0
push 6
call fcn.8003a4ca
mov eax, dword [ebp - 0x20]
mov dword [esi + 0x680880], eax
push 1
call sym.xboxkrnl.exe_Ordinal_151
movzx eax, byte [ebp - 3]
push eax
push 1
push 4
push ebx
call sym.xboxkrnl.exe_Ordinal_50
mov eax, dword [ebp + 0x1c]
push esi
mov dword [esi + 0x600800], eax
call fcn.8003a01a
cmp byte [0x80060ba1], 1
jne 0x8003afe3
push 0
push 0x60
call fcn.8003a394
mov eax, dword [ebp + 0x10]
pop edi
pop esi
mov dword [0x80060b90], eax
xor eax, eax
pop ebx
leave
ret 0x18