Function at 0x406520
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8c
mov eax, dword [0x43b698]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
mov esi, ecx
mov ecx, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x84], eax
test ecx, ecx
je 0x406843
mov eax, dword [ebp + 8]
mov edx, eax
shr edx, 0x18
mov byte [ebp - 0x73], dl
mov edx, eax
shr edx, 0x10
mov byte [ebp - 0x72], dl
mov edx, eax
mov byte [ebp - 0x70], al
xor ebx, ebx
shr edx, 8
mov eax, ecx
and eax, 0x80000003
mov dword [ebp - 0x7c], ebx
mov dword [ebp - 0x78], 0x55050201
mov byte [ebp - 0x74], 0xb1
mov byte [ebp - 0x71], dl
jns 0x406588
dec eax
or eax, 0xfffffffc
inc eax
jne 0x4065b3
dec cl
mov dl, cl
movzx edi, dl
inc edi
xor eax, eax
mov byte [ebp - 0x7e], dl
mov byte [ebp - 0x7d], cl
test edi, edi
jle 0x4065fb
mov edi, edi
mov edx, dword [ebp - 0x84]
xor cl, byte [edx + eax]
inc eax
cmp eax, edi
jl 0x4065a0
mov byte [ebp - 0x7d], cl
jmp 0x4065fb
mov eax, ecx
cdq
and edx, 3
add eax, edx
sar eax, 2
add al, al
add al, al
add al, 3
xor edi, edi
mov byte [ebp - 0x7e], al
mov byte [ebp - 0x7d], al
test ecx, ecx
jle 0x4065e1
mov edx, dword [ebp - 0x84]
xor al, byte [edx + edi]
inc edi
cmp edi, ecx
jl 0x4065d0
mov byte [ebp - 0x7d], al
movzx eax, byte [ebp - 0x7e]
cmp ecx, eax
jg 0x4065fb
sub eax, ecx
inc eax
lea esp, [esp]
dec eax
mov cl, byte [ebp - 0x7d]
not cl
mov byte [ebp - 0x7d], cl
jne 0x4065f0
mov dl, byte [ebp - 0x7e]
push 2
push 0xb1
push 5
lea eax, [ebp - 0x73]
push eax
mov ecx, esi
mov byte [ebp - 0x6f], dl
mov word [ebp - 0x6e], bx
mov byte [ebp - 0x6c], bl
call fcn.004059e0
xor ecx, ecx
push 0x63
push ecx
lea edx, [ebp - 0x67]
push edx
mov byte [ebp - 0x6b], al
mov word [ebp - 0x6a], cx
mov byte [ebp - 0x68], cl
call fcn.0042ccee
mov ecx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x74]
add esp, 0xc
push 5
lea eax, [ebp - 0x68]
push eax
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x70]
mov dword [eax + 8], edx
mov edx, dword [ebp - 0x6c]
mov dword [eax + 0xc], ecx
mov ecx, esi
mov dword [eax + 0x10], edx
call fcn.00405bc0
test eax, eax
jne 0x40667c
mov al, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042ccde
mov esp, ebp
pop ebp
ret 0x10
xor eax, eax
mov dword [ebp - 0x73], eax
mov dword [ebp - 0x6f], eax
mov cl, 1
mov byte [ebp - 0x6b], al
movzx eax, cl
mov byte [ebp - 0x76], cl
push eax
lea ecx, [ebp - 0x68]
push ecx
mov ecx, dword [ebp - 0x74]
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov word [ebp - 0x78], 0x202
mov edx, dword [ebp - 0x78]
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x70]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x6c]
mov dword [eax + 0xc], edx
mov dword [eax + 0x10], ecx
mov ecx, esi
call fcn.00405bc0
test eax, eax
je 0x4066ce
cmp byte [ebp - 0x68], 0x79
jne 0x406843
mov eax, dword [ebp + 0xc]
add eax, 7
cdq
and edx, 7
add eax, edx
sar eax, 3
lea ecx, [eax - 1]
mov byte [ebp - 0x78], 1
mov byte [ebp - 0x74], 0xc4
mov byte [ebp - 0x76], 8
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x8c], ebx
test ecx, ecx
jle 0x406784
mov edi, dword [ebp - 0x84]
cmp eax, 1
je 0x406784
mov ecx, dword [ebp - 0x77]
mov edx, dword [edi]
mov eax, dword [edi + 4]
push ecx
push 0xc4
mov dword [ebp - 0x73], edx
push 8
lea edx, [ebp - 0x73]
push edx
mov ecx, esi
mov dword [ebp - 0x6f], eax
call fcn.004059e0
mov ecx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x74]
mov byte [ebp - 0x6b], al
push 8
lea eax, [ebp - 0x68]
push eax
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x70]
mov dword [eax + 8], edx
mov edx, dword [ebp - 0x6c]
mov dword [eax + 0xc], ecx
mov ecx, esi
mov dword [eax + 0x10], edx
call fcn.00405bc0
test eax, eax
je 0x406667
mov eax, dword [ebp - 0x8c]
mov ecx, dword [ebp - 0x88]
inc eax
dec ecx
add edi, 8
mov dword [ebp - 0x8c], eax
cmp eax, ecx
mov eax, dword [ebp - 0x88]
jl 0x406706
mov edi, dword [ebp + 0xc]
xor ecx, ecx
and edi, 0x80000007
mov dword [ebp - 0x73], ecx
mov dword [ebp - 0x6f], ecx
jns 0x40679c
dec edi
or edi, 0xfffffff8
inc edi
jne 0x4067a8
mov edi, 8
jmp 0x406861
cmp edi, 4
jg 0x406858
mov ecx, dword [ebp - 0x84]
lea edx, [ecx + eax*8 - 8]
push edi
push edx
lea eax, [ebp - 0x73]
push eax
mov byte [ebp - 0x76], 5
call fcn.0042ccf4
add esp, 0xc
cmp edi, 4
jge 0x4067ec
mov ecx, 4
sub ecx, edi
push ecx
lea eax, [ebp + edi - 0x73]
push 0xff
push eax
call fcn.0042ccee
add esp, 0xc
mov eax, dword [ebp - 0x77]
mov dl, byte [ebp - 0x7d]
mov edi, dword [ebp - 0x74]
mov ecx, dword [ebp - 0x76]
push eax
push edi
mov byte [ebp - 0x6f], dl
push ecx
lea edx, [ebp - 0x73]
push edx
mov ecx, esi
call fcn.004059e0
mov ebx, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x78]
mov byte [ebp - 0x6b], al
movzx eax, byte [ebp - 0x76]
push eax
lea ecx, [ebp - 0x68]
push ecx
mov ecx, dword [ebp - 0x70]
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x6c]
mov dword [eax + 8], edi
mov dword [eax + 0xc], ecx
mov ecx, esi
mov dword [eax + 0x10], edx
call fcn.00405bc0
test eax, eax
jne 0x406951
mov al, 0x14
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042ccde
mov esp, ebp
pop ebp
ret 0x10
cmp edi, 8
jg 0x406951
mov ecx, dword [ebp - 0x84]
lea edx, [ecx + eax*8 - 8]
push edi
push edx
lea eax, [ebp - 0x73]
push eax
mov byte [ebp - 0x76], 8
call fcn.0042ccf4
add esp, 0xc
cmp edi, 8
jge 0x40689c
mov ecx, 8
sub ecx, edi
push ecx
lea eax, [ebp + edi - 0x73]
push 0xff
push eax
call fcn.0042ccee
add esp, 0xc
mov edx, dword [ebp - 0x77]
mov edi, dword [ebp - 0x74]
mov eax, dword [ebp - 0x76]
push edx
push edi
push eax
lea ecx, [ebp - 0x73]
push ecx
mov ecx, esi
call fcn.004059e0
movzx edx, byte [ebp - 0x76]
mov ebx, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x78]
mov byte [ebp - 0x6b], al
push edx
mov edx, dword [ebp - 0x70]
lea eax, [ebp - 0x68]
push eax
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x6c]
mov dword [eax + 8], edi
mov dword [eax + 0xc], edx
mov dword [eax + 0x10], ecx
mov ecx, esi
call fcn.00405bc0
test eax, eax
je 0x406843
mov dl, byte [ebp - 0x7d]
xor eax, eax
mov byte [ebp - 0x76], 1
mov dword [ebp - 0x72], eax
mov byte [ebp - 0x73], dl
mov edi, dword [ebp - 0x74]
mov ecx, dword [ebp - 0x76]
mov word [ebp - 0x6e], ax
mov byte [ebp - 0x6c], al
mov eax, dword [ebp - 0x77]
push eax
push edi
push ecx
lea edx, [ebp - 0x73]
push edx
mov ecx, esi
call fcn.004059e0
mov edx, dword [ebp - 0x78]
mov byte [ebp - 0x6b], al
movzx eax, byte [ebp - 0x76]
push eax
lea ecx, [ebp - 0x68]
push ecx
mov ecx, dword [ebp - 0x70]
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x6c]
mov dword [eax + 8], edi
mov dword [eax + 0xc], ecx
mov ecx, esi
mov dword [eax + 0x10], edx
call fcn.00405bc0
test eax, eax
je 0x406843
mov cl, 1
xor eax, eax
movzx edi, cl
mov dword [ebp - 0x73], eax
mov dword [ebp - 0x6f], eax
mov byte [ebp - 0x6b], al
push edi
lea eax, [ebp - 0x68]
push eax
mov byte [ebp - 0x76], cl
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov word [ebp - 0x78], 0x202
mov ecx, dword [ebp - 0x78]
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x70]
mov byte [ebp - 0x74], 0xb1
mov edx, dword [ebp - 0x74]
mov dword [eax + 8], edx
mov edx, dword [ebp - 0x6c]
mov dword [eax + 0xc], ecx
mov ecx, esi
mov dword [eax + 0x10], edx
call fcn.00405bc0
test eax, eax
je 0x406843
cmp byte [ebp - 0x68], 0x79
jne 0x406843
mov ecx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x74]
push edi
lea eax, [ebp - 0x68]
push eax
sub esp, 0x14
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x70]
mov dword [eax + 8], edx
mov edx, dword [ebp - 0x6c]
mov dword [eax + 0xc], ecx
mov ecx, esi
mov dword [eax + 0x10], edx
call fcn.00405bc0
test eax, eax
je 0x406843
cmp byte [ebp - 0x68], 0x79
jne 0x406843
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.0042ccde
mov esp, ebp
pop ebp
ret 0x10