Function at 0x496e4c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
xor ebx, ebx
push edi
lea eax, [ebp - 0x2c]
push ebx
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp + 0x10]
push eax
mov dword [ebp - 0x28], ebx
push dword [ebp + 0xc]
mov dword [ebp - 0x2c], ebx
call fcn.00496ac4
add esp, 0x28
test al, al
je 0x496ff9
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 8]
test cl, 0x10
mov esi, eax
jne 0x496ea6
test ecx, 0x400000
je 0x496eaa
sar eax, 1
mov esi, eax
mov eax, ecx
and eax, 0x40
je 0x496eb3
sar esi, 1
test ecx, 0x40000
je 0x496ec5
cmp eax, ebx
je 0x496ec5
and ch, 0xef
mov dword [ebp + 0x10], ecx
mov edx, ecx
mov eax, 0xff
and dl, 0x40
push eax
neg dl
sbb edx, edx
and dl, 0x7f
add edx, 0x80
push edx
push eax
push dword [ebp - 0x10]
push ecx
push esi
push dword [ebp + 8]
call fcn.00489bd7
mov esi, eax
cmp esi, ebx
je 0x496ff9
mov eax, dword [esi + 0x10c]
dec eax
push eax
push ebx
push esi
call fcn.0048a343
mov eax, dword [ebp - 0x14]
push ebx
mov dword [esi + 0x165], eax
push dword [ebp - 0x18]
push dword [ebp + 0xc]
call fcn.0048b1bf
add esp, 0xc
lea eax, [ebp - 0x1c]
mov edi, dword [esi + 0x165]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp + 8]
push eax
push dword [ebp - 8]
push ebx
push esi
call fcn.0048a1d4
test al, al
jne 0x496f4c
push esi
call fcn.00489c6e
jmp 0x496ff9
cmp dword [edi + 4], ebx
jne 0x496f55
cmp dword [edi], ebx
je 0x496f5b
test byte [ebp + 0x12], 0x40
je 0x496f83
test byte [ebp + 0x10], 0x10
push dword [ebp + 0xc]
je 0x496f7c
mov eax, dword [ebp - 4]
shr eax, 1
push eax
push 2
push dword [ebp + 8]
call fcn.0048afc9
add esp, 0x10
jmp 0x497013
push dword [ebp - 4]
push 1
jmp 0x496f6c
mov edi, str.F:WorkMediaChanceMMBuilderFMOD_src_format_wav.c
push 0x2ea
push edi
push dword [ebp - 4]
push ebx
call fcn.00485aeb
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x496fb2
push esi
call fcn.00489c6e
mov dword [0x537b40], 0xc
jmp 0x496ff9
push dword [ebp + 0xc]
push dword [ebp - 4]
push 1
push ebx
call fcn.0048afc9
lea eax, [ebp - 8]
push eax
push dword [ebp + 8]
push dword [ebp - 4]
push ebx
push esi
call fcn.00496d79
add esp, 0x24
test al, al
jne 0x497000
push esi
call fcn.00489c6e
push 0x2f7
push edi
push ebx
push 0
call fcn.00485a91
add esp, 0x10
mov dword [0x537b40], 0xb
xor eax, eax
jmp 0x49708f
push 0x2fc
push edi
push ebx
push 0
call fcn.00485a91
add esp, 0x10
xor ebx, ebx
test byte [ebp + 0x10], 8
je 0x49702d
mov eax, dword [ebp + 8]
xor ecx, ecx
cmp dword [ebp - 0xc], ebx
jbe 0x49702d
xor byte [eax], 0x80
inc eax
inc ecx
cmp ecx, dword [ebp - 0xc]
jb 0x497023
push dword [ebp - 0x1c]
push dword [ebp - 0xc]
push dword [ebp - 0x20]
push dword [ebp + 8]
push esi
call fcn.0048a271
test byte [ebp + 0x10], 0x10
mov eax, dword [ebp - 8]
je 0x49704a
sar eax, 1
test byte [ebp + 0x10], 0x40
je 0x497052
sar eax, 1
cmp dword [ebp - 0x2c], ebx
jne 0x497067
cmp dword [ebp - 0x28], ebx
jne 0x497067
dec eax
push eax
push ebx
push esi
call fcn.0048a343
jmp 0x497081
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push esi
call fcn.0048a343
test byte [ebp + 0x10], 1
jne 0x497081
push 2
push esi
call fcn.0048a2ba
push dword [esi + 0x165]
call fcn.00496d2e
pop ecx
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret