Function at 0x408400
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x10], edx
push edi
cmp dword [esi + 0x5d], 0
jne 0x408691
mov eax, dword [esi + 0x20]
test eax, eax
je 0x40843d
cmp eax, dword [esi + 0x28]
jae 0x40844f
mov cl, byte [eax]
inc eax
mov dword [esi + 0x20], eax
cmp cl, 0x4f
jne 0x408687
cmp byte [esi + 0x30], 0
je 0x40845b
xor eax, eax
jmp 0x408475
push dword [esi + 0x14]
call fcn.00501d00
mov ecx, eax
add esp, 4
cmp ecx, 0xffffffff
jne 0x40842a
mov dword [esi + 0x5d], 1
jmp 0x408687
mov eax, dword [esi + 0x20]
test eax, eax
je 0x408467
sub eax, dword [esi + 0x24]
jmp 0x408475
push dword [esi + 0x14]
call fcn.00502c51
add esp, 4
sub eax, dword [esi + 0x18]
mov dword [ebp - 4], eax
add eax, 0xffffffe7
cmp eax, dword [esi + 0x2c]
ja 0x408691
mov edi, 1
nop dword [eax]
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4084a4
cmp eax, dword [esi + 0x28]
jae 0x4084b6
mov cl, byte [eax]
inc eax
mov dword [esi + 0x20], eax
jmp 0x4084bf
push dword [esi + 0x14]
call fcn.00501d00
mov ecx, eax
add esp, 4
cmp ecx, 0xffffffff
jne 0x4084bf
xor cl, cl
mov dword [esi + 0x5d], 1
cmp cl, byte [edi + str.OggS_]
jne 0x4084cd
inc edi
cmp edi, 4
jl 0x408490
cmp dword [esi + 0x5d], 0
jne 0x408691
cmp edi, 4
jne 0x40867d
mov eax, dword [str.OggS_]
mov dword [ebp - 0x2c], eax
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4084fc
cmp eax, dword [esi + 0x28]
jae 0x40850e
mov cl, byte [eax]
inc eax
mov dword [esi + 0x20], eax
jmp 0x408517
push dword [esi + 0x14]
call fcn.00501d00
mov ecx, eax
add esp, 4
cmp ecx, 0xffffffff
jne 0x408517
xor cl, cl
mov dword [esi + 0x5d], 1
mov byte [ebp + edi - 0x2c], cl
inc edi
cmp edi, 0x1b
jb 0x4084e8
cmp dword [esi + 0x5d], 0
jne 0x408691
cmp byte [ebp - 0x28], 0
jne 0x40867d
movzx ecx, byte [ebp - 0x13]
movzx eax, byte [ebp - 0x14]
shl ecx, 8
add ecx, eax
movzx eax, byte [ebp - 0x15]
shl ecx, 8
add ecx, eax
movzx eax, byte [ebp - 0x16]
shl ecx, 8
add ecx, eax
mov eax, 0x16
mov dword [ebp - 0xc], ecx
nop dword [eax]
mov byte [ebp + eax - 0x2c], 0
inc eax
cmp eax, 0x1a
jb 0x408560
xor edi, edi
xor edx, edx
nop
movzx ecx, byte [ebp + edx - 0x2c]
mov eax, edi
shr eax, 0x18
xor ecx, eax
shl edi, 8
movzx eax, byte [ebp + edx - 0x2b]
xor edi, dword [ecx*4 + 0x564738]
mov ecx, edi
shl edi, 8
shr ecx, 0x18
xor ecx, eax
xor edi, dword [ecx*4 + 0x564738]
movzx ecx, byte [ebp + edx - 0x2a]
mov eax, edi
shr eax, 0x18
add edx, 3
xor ecx, eax
shl edi, 8
xor edi, dword [ecx*4 + 0x564738]
cmp edx, 0x1b
jb 0x408570
movzx eax, byte [ebp - 0x12]
xor ebx, ebx
mov dword [ebp - 8], eax
test eax, eax
je 0x408678
nop dword [eax + eax]
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4085e4
cmp eax, dword [esi + 0x28]
jae 0x4085f6
mov cl, byte [eax]
inc eax
mov dword [esi + 0x20], eax
jmp 0x4085ff
push dword [esi + 0x14]
call fcn.00501d00
mov ecx, eax
add esp, 4
cmp ecx, 0xffffffff
jne 0x4085ff
xor cl, cl
mov dword [esi + 0x5d], 1
mov eax, edi
movzx ecx, cl
shr eax, 0x18
add ebx, ecx
xor eax, ecx
shl edi, 8
xor edi, dword [eax*4 + 0x564738]
sub dword [ebp - 8], 1
jne 0x4085d0
test ebx, ebx
je 0x408678
cmp dword [esi + 0x5d], 0
jne 0x408691
test ebx, ebx
je 0x408678
nop dword [eax]
mov eax, dword [esi + 0x20]
test eax, eax
je 0x408644
cmp eax, dword [esi + 0x28]
jae 0x408656
mov dl, byte [eax]
inc eax
mov dword [esi + 0x20], eax
jmp 0x40865f
push dword [esi + 0x14]
call fcn.00501d00
mov edx, eax
add esp, 4
cmp edx, 0xffffffff
jne 0x40865f
xor dl, dl
mov dword [esi + 0x5d], 1
mov ecx, edi
movzx eax, dl
shr ecx, 0x18
xor ecx, eax
shl edi, 8
xor edi, dword [ecx*4 + 0x564738]
sub ebx, 1
jne 0x408630
cmp edi, dword [ebp - 0xc]
je 0x40869a
mov edx, dword [ebp - 4]
mov ecx, esi
call fcn.00401ff0
cmp dword [esi + 0x5d], 0
je 0x408418
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x10]
test edi, edi
je 0x4086c7
cmp byte [esi + 0x30], 0
je 0x4086ab
xor eax, eax
jmp 0x4086c5
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4086b7
sub eax, dword [esi + 0x24]
jmp 0x4086c5
push dword [esi + 0x14]
call fcn.00502c51
add esp, 4
sub eax, dword [esi + 0x18]
mov dword [edi], eax
mov ecx, dword [ebp + 8]
test ecx, ecx
je 0x4086da
movzx eax, byte [ebp - 0x27]
shr eax, 2
and eax, 1
mov dword [ecx], eax
mov edx, dword [ebp - 4]
mov ecx, esi
dec edx
call fcn.00401ff0
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret