Function at 0x466a40
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x14
push esi
mov esi, dword [esp + 0x1c]
cmp eax, esi
jne 0x466a5f
mov eax, 4
pop esi
mov dword [0x51a938], eax
add esp, 0x14
ret
test dword [eax + 0xc], 0x1800000
jne 0x466a8b
push str.PgSOUND::Convert
push 4
mov dword [0x51d090], 0x512c0c
mov dword [0x51d094], 0x46
call fcn.00449f60
add esp, 8
mov eax, dword [0x51d128]
mov cl, byte [eax + 0x9a]
mov byte [eax + 0x9a], 0
mov dword [0x51a938], 0
mov al, byte [esi + 0xc]
test al, 1
mov byte [esp + 7], cl
je 0x466ab7
mov eax, dword [esi + 0x18]
jmp 0x466ac0
push esi
call fcn.00476870
add esp, 4
push ebx
mov dword [esp + 0xc], eax
test eax, eax
push edi
je 0x466de9
mov eax, dword [esp + 0x28]
test byte [eax + 0xc], 1
je 0x466add
mov esi, dword [eax + 0x18]
jmp 0x466afc
mov edx, dword [esp + 0x24]
mov ecx, dword [edx + 0x14]
mov edx, dword [eax + 0x14]
cmp ecx, edx
jne 0x466af1
mov esi, dword [esp + 0x10]
jmp 0x466afc
push eax
call fcn.00476870
add esp, 4
mov esi, eax
test esi, esi
je 0x466dd6
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
push ebp
mov ebx, 1
mov edi, dword [edx + 0x38]
mov ebp, dword [eax + 0x38]
cmp edi, ebp
mov dword [esp + 0x1c], ebx
ja 0x466b26
mov dword [esp + 0x18], ebx
jmp 0x466b30
mov eax, edi
xor edx, edx
div ebp
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x28]
xor edx, edx
mov eax, dword [ecx + 0x44]
div dword [esp + 0x18]
mov edx, dword [esp + 0x28]
mov ecx, eax
mov eax, dword [edx + 0x40]
mov edx, dword [esp + 0x2c]
cmp eax, dword [edx + 0x40]
je 0x466b67
cmp eax, 2
jne 0x466b58
mov ebx, eax
jmp 0x466b6e
cmp eax, 1
jne 0x466b6e
mov dword [esp + 0x1c], 2
jmp 0x466b6e
cmp eax, 2
jne 0x466b6e
add ecx, ecx
cmp dword [esp + 0x18], 1
jne 0x466c54
mov eax, ebp
xor edx, edx
div edi
mov edx, dword [esp + 0x28]
mov edi, dword [esp + 0x2c]
mov edx, dword [edx + 0x3c]
mov ebp, dword [edi + 0x3c]
shl edx, 4
or edx, ebp
lea edi, [edx - 0x88]
imul eax, dword [esp + 0x1c]
cmp edi, 0x88
ja case.0x466c7d.140
xor edx, edx
mov dl, byte [edi + 0x466e84]
jmp dword [edx*4 + 0x466e70]
mov edx, dword [esp + 0x14]
mov edi, ecx
dec ecx
test edi, edi
jle 0x466d6b
lea edi, [ecx + 1]
mov cl, byte [esi]
add esi, eax
mov byte [edx], cl
add edx, ebx
dec edi
jne 0x466bca
jmp 0x466d6b
mov edx, dword [esp + 0x14]
mov edi, ecx
dec ecx
test edi, edi
jle 0x466d6b
lea edi, [eax + eax]
lea eax, [ecx + 1]
xor ecx, ecx
mov cl, byte [esi + 1]
add esi, edi
mov byte [edx], cl
add edx, ebx
dec eax
jne 0x466bef
jmp 0x466d6b
mov edx, dword [esp + 0x14]
mov edi, ecx
dec ecx
test edi, edi
jle 0x466d6b
lea ebp, [ebx + ebx]
lea edi, [ecx + 1]
xor ecx, ecx
mov ch, byte [esi]
add esi, eax
mov word [edx], cx
add edx, ebp
dec edi
jne 0x466c17
jmp 0x466d6b
mov edx, dword [esp + 0x14]
mov edi, ecx
dec ecx
test edi, edi
jle 0x466d6b
lea ebp, [eax + eax]
lea edi, [ebx + ebx]
lea eax, [ecx + 1]
mov cx, word [esi]
add esi, ebp
mov word [edx], cx
add edx, edi
dec eax
jne 0x466c42
jmp 0x466d6b
mov edx, dword [esp + 0x28]
mov eax, dword [edx + 0x3c]
mov edx, dword [esp + 0x2c]
shl eax, 4
or eax, dword [edx + 0x3c]
add eax, 0xffffff78
cmp eax, 0x88
ja case.0x466c7d.140
xor edx, edx
mov dl, byte [eax + 0x466f24]
jmp dword [edx*4 + 0x466f10]
mov eax, dword [esp + 0x14]
mov edx, ecx
dec ecx
test edx, edx
jle 0x466d6b
lea edi, [ecx + 1]
mov ecx, dword [esp + 0x18]
test ecx, ecx
jle 0x466cab
mov dl, byte [esi]
mov byte [eax], dl
add eax, ebx
dec ecx
jne 0x466c9e
mov ecx, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
add esi, ebp
dec edi
jne 0x466c9a
jmp 0x466d6b
mov eax, dword [esp + 0x14]
mov edx, esi
mov esi, ecx
dec ecx
test esi, esi
jle 0x466d6b
mov esi, dword [esp + 0x18]
lea edi, [ecx + 1]
test esi, esi
jle 0x466ce5
xor ecx, ecx
mov cl, byte [edx + 1]
mov byte [eax], cl
add eax, ebx
dec esi
jne 0x466cd5
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
dec edi
lea edx, [edx + ecx*2]
jne 0x466cd1
jmp 0x466d6b
mov eax, dword [esp + 0x14]
mov edx, ecx
dec ecx
test edx, edx
jle 0x466d6b
lea ebp, [ecx + 1]
mov ecx, dword [esp + 0x18]
test ecx, ecx
jle 0x466d1a
lea edi, [ebx + ebx]
xor edx, edx
mov dh, byte [esi]
mov word [eax], dx
add eax, edi
dec ecx
jne 0x466d0a
mov ecx, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
add esi, edi
dec ebp
jne 0x466d03
jmp 0x466d6b
mov eax, dword [esp + 0x14]
mov edx, ecx
dec ecx
test edx, edx
jle 0x466d6b
mov edi, dword [esp + 0x18]
inc ecx
mov dword [esp + 0x20], ecx
test edi, edi
jle 0x466d4d
lea edx, [ebx + ebx]
lea ecx, [edi]
mov bp, word [esi]
mov word [eax], bp
add eax, edx
dec ecx
jne 0x466d42
mov ecx, dword [esp + 0x1c]
lea esi, [esi + ecx*2]
mov ecx, dword [esp + 0x20]
dec ecx
mov dword [esp + 0x20], ecx
jne 0x466d39
jmp 0x466d6b
mov dword [0x51a938], 4
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x28]
pop ebp
mov edx, dword [edi + 0x40]
mov eax, dword [esi + 0x40]
cmp edx, eax
jae 0x466dbb
mov eax, dword [esi + 0x3c]
cmp eax, 8
jne 0x466d9e
mov ecx, dword [esi + 0x44]
mov eax, dword [esp + 0x10]
test ecx, ecx
jbe 0x466dbb
mov dl, byte [eax]
mov byte [eax + 1], dl
add eax, 2
dec ecx
jne 0x466d91
jmp 0x466dbb
cmp eax, 0x10
jne 0x466dbb
mov ecx, dword [esi + 0x44]
mov eax, dword [esp + 0x10]
test ecx, ecx
jbe 0x466dbb
mov dx, word [eax]
mov word [eax + 2], dx
add eax, 4
dec ecx
jne 0x466dae
test byte [edi + 0xc], 1
jne 0x466dda
mov eax, dword [esi + 0x14]
mov ecx, dword [edi + 0x14]
cmp eax, ecx
je 0x466dda
push edi
call fcn.004768f0
add esp, 4
jmp 0x466dda
mov esi, dword [esp + 0x24]
test byte [esi + 0xc], 1
jne 0x466de9
push esi
call fcn.004768f0
add esp, 4
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov ecx, dword [esi + 0xc]
mov edi, dword [edx + 0xc]
xor ecx, edi
test ecx, 0x1800000
je 0x466e55
push esi
mov dword [0x51a938], 0
call fcn.00476870
add esp, 4
test eax, eax
je 0x466e55
mov edx, dword [esi + 0x44]
mov ecx, dword [esi + 0x3c]
imul edx, dword [esi + 0x40]
cmp ecx, 0x10
jne 0x466e38
test edx, edx
jbe 0x466e4c
xor word [eax], 0x8000
add eax, 2
dec edx
jne 0x466e2b
jmp 0x466e4c
xor ecx, ecx
test edx, edx
jbe 0x466e4c
mov bl, byte [ecx + eax]
xor bl, 0x80
mov byte [ecx + eax], bl
inc ecx
cmp ecx, edx
jb 0x466e3e
push esi
call fcn.004768f0
add esp, 4
mov eax, dword [0x51d128]
mov cl, byte [esp + 0xf]
pop edi
pop ebx
mov byte [eax + 0x9a], cl
mov eax, dword [0x51a938]
pop esi
add esp, 0x14
ret