Function at 0x409c70
Capabilities:
Encode data using xor

Disassembly:
push edi
mov edi, ecx
mov eax, 0x5a59
cmp word [edi + 0xb2], ax
jne 0x409a97
push ebx
push esi
lea esi, [edi + 0xac]
or eax, 0xffffffff
mov ebx, 6
movzx ecx, byte [esi]
lea esi, [esi + 1]
movzx edx, al
xor edx, ecx
shr eax, 8
xor eax, dword [edx*4 + 0x426700]
dec ebx
jne 0x4099f5
movzx edx, byte [edi + 0xab]
not eax
movzx ecx, byte [edi + 0xaa]
shl edx, 8
or edx, ecx
movzx ecx, byte [edi + 0xa9]
shl edx, 8
or edx, ecx
movzx ecx, byte [edi + 0xa8]
shl edx, 8
or edx, ecx
pop esi
pop ebx
cmp eax, edx
jne 0x409a97
movzx ecx, byte [edi + 0xaf]
movzx eax, byte [edi + 0xae]
mov edx, dword [edi + 0x7c]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 0xad]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 0xac]
shl ecx, 8
or ecx, eax
mov eax, dword [edi + 0x78]
shrd eax, edx, 2
shr edx, 2
cmp eax, ecx
jne 0x409a97
test edx, edx
jne 0x409a97
cmp byte [edi + 0xb0], dl
jne 0x409a97
movzx eax, byte [edi + 0xb1]
cmp eax, dword [edi + 0x1c]
lea eax, [edx + 1]
je 0x409a9c
mov eax, 7
pop edi
ret
push ebx
push esi
mov ebx, edx
mov esi, ecx
push edi
mov eax, dword [ebx + 4]
mov dword [esi + 0x10], eax
lea ecx, [ecx]
mov eax, dword [esi]
cmp eax, 9
ja case.default.0x409c87
jmp dword [eax*4 + 0x409ec4]
mov edx, ebx
mov ecx, esi
call fcn.004094c0
test al, al
je 0x409ebd
mov ecx, esi
mov dword [esi], 1
call fcn.00409910
test eax, eax
jne 0x409dec
mov ecx, dword [ebx + 4]
cmp ecx, dword [ebx + 8]
je 0x409ebd
mov eax, dword [ebx]
mov al, byte [ecx + eax]
test al, al
jne 0x409cd7
mov dword [esi + 0x10], ecx
inc dword [ebx + 4]
mov dword [esi], 6
jmp case.default.0x409c87
movzx eax, al
mov dword [esi + 0xa0], 0
mov dword [esi], 2
lea eax, [eax*4 + 4]
mov dword [esi + 0x38], eax
mov dword [esi + 0xa4], eax
mov edi, dword [esi + 0xa4]
mov eax, dword [ebx + 8]
sub eax, dword [ebx + 4]
sub edi, dword [esi + 0xa0]
cmp eax, edi
cmovb edi, eax
mov eax, dword [ebx]
add eax, dword [ebx + 4]
push edi
push eax
mov eax, dword [esi + 0xa0]
add eax, 0xa8
add eax, esi
push eax
call fcn.00410a40
add dword [ebx + 4], edi
add esp, 0xc
add dword [esi + 0xa0], edi
mov eax, dword [esi + 0xa0]
cmp eax, dword [esi + 0xa4]
jne 0x409ebd
mov ecx, esi
mov dword [esi + 0xa0], 0
call fcn.00409aa0
test eax, eax
jne 0x409dec
mov dword [esi], 3
mov edx, ebx
mov ecx, esi
call fcn.004095e0
cmp eax, 1
jne 0x409dec
mov dword [esi], 4
mov eax, dword [esi + 0x40]
and eax, 3
or eax, 0
je 0x409dbe
jmp 0x409d90
mov edx, dword [ebx + 4]
cmp edx, dword [ebx + 8]
je 0x409ebd
mov eax, dword [ebx]
mov cl, byte [edx + eax]
lea eax, [edx + 1]
mov dword [ebx + 4], eax
test cl, cl
jne 0x409de7
add dword [esi + 0x40], 1
mov eax, dword [esi + 0x40]
adc dword [esi + 0x44], 0
and eax, 3
or eax, 0
jne 0x409d90
mov dword [esi], 5
cmp dword [esi + 0x1c], 1
jne 0x409ddc
push ecx
mov edx, ebx
mov ecx, esi
call fcn.004098b0
add esp, 4
cmp eax, 1
jne 0x409dec
mov dword [esi], 1
jmp case.default.0x409c87
mov eax, 7
pop edi
pop esi
pop ebx
ret
mov edx, ebx
mov ecx, esi
call fcn.00409780
cmp eax, 1
jne 0x409dec
mov dword [esi], 7
mov eax, dword [ebx + 4]
sub eax, dword [esi + 0x10]
add eax, dword [esi + 0x78]
and eax, 3
or eax, 0
je 0x409e46
mov edx, dword [ebx + 8]
jmp 0x409e20
mov ecx, dword [ebx + 4]
cmp ecx, edx
je 0x409eb4
mov eax, dword [ebx]
mov al, byte [ecx + eax]
inc ecx
mov dword [ebx + 4], ecx
test al, al
jne 0x409de7
sub ecx, dword [esi + 0x10]
add ecx, dword [esi + 0x78]
and ecx, 3
or ecx, 0
jne 0x409e20
mov edx, ebx
mov ecx, esi
call fcn.00409730
lea edx, [esi + 0x88]
mov edi, 0x14
lea ecx, [esi + 0x58]
lea ecx, [ecx]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x409de7
add ecx, 4
add edx, 4
sub edi, 4
jae 0x409e60
mov dword [esi], 8
push ecx
mov edx, ebx
mov ecx, esi
call fcn.004098b0
add esp, 4
cmp eax, 1
jne 0x409dec
mov dword [esi + 0xa4], 0xc
mov dword [esi], 9
mov edx, ebx
mov ecx, esi
call fcn.004094c0
test al, al
je 0x409ebd
pop edi
mov ecx, esi
pop esi
pop ebx
jmp 0x4099d0
mov edx, ebx
mov ecx, esi
call fcn.00409730
pop edi
pop esi
xor eax, eax
pop ebx
ret