Function at 0x406348
Capabilities:
Encode data using xor

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x20
mov dword [esp + 0x18], edx
mov ebx, eax
mov ecx, dword [ebx]
mov ebp, dword [ebx + 0xc]
mov edx, dword [ebx + 8]
mov dword [esp + 0x14], ecx
lea eax, [ecx + ebp]
sub edx, ebp
cmp dword [ebx + 4], 0
mov dword [esp + 0x1c], eax
jl 0x4063f3
mov edi, dword [ebx + 0x14]
test edi, edi
jne 0x4063ea
cmp edx, 0x1b
jl 0x4063f3
mov esi, eax
mov edi, str.OggS
mov ecx, 4
xor eax, eax
test ecx, ecx
je 0x40639d
mov al, byte [esi]
sub al, byte [edi]
jne 0x40639d
inc esi
inc edi
dec ecx
jne 0x406392
seta al
setb cl
sub al, cl
movsx eax, al
test eax, eax
jne 0x406541
mov eax, dword [esp + 0x1c]
movzx eax, byte [eax + 0x1a]
lea edi, [eax + 0x1b]
cmp edx, edi
jl 0x4063f3
mov esi, dword [ebx + 0x18]
test eax, eax
jle 0x4063e5
mov eax, dword [esp + 0x1c]
mov dword [esp], ebp
xor ecx, ecx
movzx ebp, byte [ecx + eax + 0x1b]
add esi, ebp
mov dword [ebx + 0x18], esi
movzx ebp, byte [eax + 0x1a]
inc ecx
cmp ecx, ebp
jl 0x4063cf
mov ebp, dword [esp]
mov dword [ebx + 0x14], edi
jmp 0x4063ed
mov esi, dword [ebx + 0x18]
add esi, edi
cmp edx, esi
jge 0x4063fd
xor eax, eax
add esp, 0x20
pop ebx
pop ebp
pop esi
pop edi
ret
mov eax, dword [esp + 0x14]
lea ecx, [eax + ebp + 0x16]
mov dword [esp + 0x10], ecx
mov ebp, dword [ecx]
mov dword [esp + 8], ebp
mov eax, ecx
mov dword [eax], 0
mov ecx, dword [esp + 0x1c]
mov esi, dword [ebx + 0x14]
lea ebp, [ecx + esi]
mov dword [esp + 0xc], ebp
mov ebp, dword [ebx + 0x18]
xor eax, eax
mov byte [ecx + 0x16], al
mov byte [ecx + 0x17], al
mov byte [ecx + 0x18], al
mov byte [ecx + 0x19], al
test esi, esi
jle 0x40646a
mov dword [esp], edx
mov edx, ecx
mov dword [esp + 4], ebx
xor ecx, ecx
movzx edi, byte [ecx + edx]
mov ebx, eax
shl ebx, 8
shr eax, 0x18
xor eax, edi
mov edi, eax
mov eax, ebx
xor eax, dword [edi*4 + 0x4346e0]
inc ecx
cmp ecx, esi
jl 0x406445
mov edx, dword [esp]
mov ebx, dword [esp + 4]
test ebp, ebp
jle 0x4064a0
mov edi, dword [esp + 0xc]
mov dword [esp], edx
mov dword [esp + 4], ebx
xor ecx, ecx
movzx edx, byte [ecx + edi]
mov ebx, eax
shl ebx, 8
shr eax, 0x18
xor eax, edx
mov esi, eax
mov eax, ebx
xor eax, dword [esi*4 + 0x4346e0]
inc ecx
cmp ecx, ebp
jl 0x40647b
mov edx, dword [esp]
mov ebx, dword [esp + 4]
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x10]
lea esi, [esp + 8]
mov byte [ebp + 0x16], al
mov ecx, eax
shr ecx, 8
mov byte [ebp + 0x17], cl
mov ecx, eax
shr ecx, 0x10
mov byte [ebp + 0x18], cl
shr eax, 0x18
mov byte [ebp + 0x19], al
mov ecx, 4
xor eax, eax
test ecx, ecx
je 0x4064db
mov al, byte [esi]
sub al, byte [edi]
jne 0x4064db
inc esi
inc edi
dec ecx
jne 0x4064d0
seta al
setb cl
sub al, cl
movsx eax, al
test eax, eax
jne 0x406531
mov ecx, dword [ebx + 0xc]
mov edx, dword [ebx]
add edx, ecx
cmp dword [esp + 0x18], 0
je 0x406513
mov ecx, dword [esp + 0x18]
mov dword [ecx], edx
mov eax, dword [ebx + 0x14]
mov dword [ecx + 4], eax
add edx, dword [ebx + 0x14]
mov dword [ecx + 8], edx
mov edx, dword [ebx + 0x18]
mov dword [ecx + 0xc], edx
mov ecx, dword [ebx + 0xc]
mov eax, dword [ebx + 0x14]
add eax, dword [ebx + 0x18]
xor edx, edx
mov dword [ebx + 0x10], edx
add ecx, eax
mov dword [ebx + 0xc], ecx
mov dword [ebx + 0x14], edx
mov dword [ebx + 0x18], edx
add esp, 0x20
pop ebx
pop ebp
pop esi
pop edi
ret
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x10]
mov dword [ecx], eax
mov eax, dword [ebx]
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x1c]
xor eax, eax
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x18], eax
lea ebp, [ecx + 1]
dec edx
push edx
push 0x4f
push ebp
call fcn.0042ad00
add esp, 0xc
test eax, eax
jne 0x406568
mov eax, dword [esp + 0x14]
add eax, dword [ebx + 8]
mov edx, dword [esp + 0x14]
neg edx
add edx, eax
sub eax, dword [esp + 0x1c]
mov dword [ebx + 0xc], edx
neg eax
add esp, 0x20
pop ebx
pop ebp
pop esi
pop edi
ret