Function at 0x406640
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x58
mov eax, dword [esp + 0xa0]
mov esi, dword [ecx + 0x48]
mov edi, dword [esi + 4]
mov dword [esp + 0x54], edi
test eax, eax
je 0x40666e
cmp dword [esi + 0x34], 0
jne 0x40666e
mov dword [ecx + 0x1c], 3
jmp 0x406c71
mov dword [esp + 0xc], eax
mov dword [esp + 0x50], edx
movzx edx, word [esp + 0x74]
movzx eax, word [esp + 0x6c]
movzx ebx, dx
movzx ebp, word [esp + 0x7c]
mov edx, ebx
mov dword [esp + 0x48], ebx
mov dword [esp], eax
lea edx, [ebx + eax]
add edx, ebp
mov eax, dword [esp + 0xac]
xor ebx, ebx
add edx, eax
setb bl
add edx, edi
adc ebx, 0
cmp edx, 0xffffffd1
sbb ebx, 0
jb 0x4066bd
mov dword [ecx + 0x1c], 0xf
jmp 0x406c71
mov dword [esp + 0x44], ebp
mov dword [esp + 0x10], edi
mov dword [esp + 8], ecx
mov dword [esp + 4], esi
mov ebp, dword [esp + 0x8c]
mov edx, eax
mov edi, dword [esp + 0x84]
movzx eax, word [esp + 0x98]
mov dword [esp + 0x1a], 0
mov dword [esp + 0x1e], 0
mov dword [esp + 0x26], 0
mov dword [esp + 0x2a], 0
mov dword [esp + 0x2e], 0
mov dword [esp + 0x32], 0
mov dword [esp + 0x36], 0
mov word [esp + 0x3a], 0
mov dword [esp + 0x22], 0
mov dword [esp + 0x16], 0x2014b50
mov ebx, dword [esp + 0x90]
movzx ecx, word [esp + 0x74]
add ecx, edx
mov dword [esp + 0x4c], ecx
xor ecx, ecx
mov edx, 0
cmp word [esp + 0x94], 0
je 0x40675a
mov dl, 0x14
mov byte [esp + 0x1c], dl
mov byte [esp + 0x1e], al
mov byte [esp + 0x1f], ah
movzx eax, word [esp + 0x94]
mov byte [esp + 0x20], al
mov byte [esp + 0x21], ah
mov byte [esp + 0x26], bl
mov byte [esp + 0x27], bh
mov edx, ebx
shr edx, 0x10
mov byte [esp + 0x28], dl
shr ebx, 0x18
neg ebp
mov edx, 0
sbb edx, edx
mov byte [esp + 0x29], bl
or edx, dword [esp + 0x88]
mov byte [esp + 0x2a], dl
mov byte [esp + 0x2b], dh
mov ebx, edx
shr ebx, 0x10
mov byte [esp + 0x2c], bl
shr edx, 0x18
neg edi
mov ebx, 0
sbb ebx, ebx
mov byte [esp + 0x2d], dl
or ebx, dword [esp + 0x80]
mov byte [esp + 0x2e], bl
mov byte [esp + 0x2f], bh
mov edx, ebx
shr edx, 0x10
mov byte [esp + 0x30], dl
shr ebx, 0x18
mov byte [esp + 0x31], bl
movzx eax, word [esp + 0x6c]
mov byte [esp + 0x32], al
mov byte [esp + 0x33], ah
mov eax, dword [esp + 0x4c]
mov byte [esp + 0x34], al
mov byte [esp + 0x35], ah
movzx edx, word [esp + 0x7c]
mov byte [esp + 0x36], dl
mov byte [esp + 0x37], dh
mov eax, dword [esp + 0xa4]
mov byte [esp + 0x3c], al
mov byte [esp + 0x3d], ah
mov edx, eax
shr edx, 0x10
mov byte [esp + 0x3e], dl
shr eax, 0x18
neg dword [esp + 0xc]
sbb ecx, ecx
mov byte [esp + 0x3f], al
or ecx, dword [esp + 0x9c]
mov byte [esp + 0x40], cl
mov byte [esp + 0x41], ch
mov eax, ecx
shr eax, 0x10
mov byte [esp + 0x42], al
shr ecx, 0x18
mov byte [esp + 0x43], cl
mov edi, dword [esp + 0x10]
lea esi, [edi + 0x2e]
mov ebx, dword [esp + 4]
mov eax, dword [ebx + 8]
cmp eax, esi
jae 0x4068b7
mov edi, 1
test eax, eax
je 0x406888
mov edi, eax
jmp 0x406888
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, esi
jb 0x406870
push edi
push dword [ebx + 0xc]
push dword [ebx]
mov eax, dword [esp + 0x14]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
mov ebp, ebx
je 0x406c40
mov dword [ebp], eax
mov dword [ebp + 8], edi
mov ebx, ebp
mov edi, dword [esp + 0x10]
jmp 0x4068b9
mov eax, dword [ebx]
mov dword [ebx + 4], esi
mov edx, dword [ebx + 0xc]
mov ecx, edx
imul ecx, edi
add ecx, eax
mov eax, edx
and eax, 0x2e
mov esi, edx
or edx, 0x2e
imul edx, eax
xor eax, 0x2e
and esi, 0xffffffd1
imul esi, eax
add edx, esi
lea eax, [esp + 0x16]
push edx
push eax
push ecx
call fcn.00408ed0
add esp, 0xc
mov ebp, dword [ebx + 4]
mov eax, dword [ebx + 8]
mov ecx, dword [esp]
lea edi, [ecx + ebp]
cmp eax, edi
jae 0x406957
mov esi, 1
test eax, eax
je 0x406908
mov esi, eax
cmp esi, edi
mov dword [esp + 0xc], ebp
jae 0x40692c
mov eax, esi
and eax, 0xfffffffd
mov ecx, esi
and ecx, 2
or esi, 2
imul esi, ecx
xor ecx, 2
imul ecx, eax
add esi, ecx
cmp esi, edi
jb 0x406910
push esi
push dword [ebx + 0xc]
push dword [ebx]
mov eax, dword [esp + 0x14]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
mov ebp, ebx
je 0x406c40
mov dword [ebp], eax
mov dword [ebp + 8], esi
mov ebx, ebp
mov ebp, dword [esp + 0xc]
jmp 0x406959
mov esi, eax
mov dword [ebx + 4], edi
cmp word [esp + 0x6c], 0
je 0x40699d
mov eax, dword [ebx + 0xc]
imul ebp, eax
add ebp, dword [ebx]
mov ecx, eax
not ecx
mov esi, dword [esp]
and ecx, esi
mov edx, esi
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, esi
or eax, esi
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0x54]
push ebp
call fcn.00408ed0
add esp, 0xc
mov edi, dword [ebx + 4]
mov esi, dword [ebx + 8]
mov eax, dword [esp + 0x48]
lea edx, [edi + eax]
cmp esi, edx
jae 0x406a0d
mov ebx, 1
test esi, esi
je 0x4069d8
mov ebx, esi
jmp 0x4069d8
mov eax, ebx
and eax, 0xfffffffd
mov ecx, ebx
and ecx, 2
or ebx, 2
imul ebx, ecx
xor ecx, 2
imul ecx, eax
add ebx, ecx
cmp ebx, edx
jb 0x4069c0
mov esi, edx
push ebx
mov ebp, dword [esp + 8]
push dword [ebp + 0xc]
push dword [ebp]
mov eax, dword [esp + 0x14]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x406c40
mov dword [ebp], eax
mov dword [ebp + 8], ebx
movzx eax, word [esp + 0x74]
mov edx, esi
jmp 0x406a16
mov ebp, ebx
mov ebx, esi
movzx eax, word [esp + 0x74]
mov dword [ebp + 4], edx
test ax, ax
je 0x406a59
mov eax, dword [ebp + 0xc]
imul edi, eax
add edi, dword [ebp]
mov ecx, eax
not ecx
mov esi, dword [esp + 0x48]
and ecx, esi
mov edx, esi
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, esi
or eax, esi
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0x74]
push edi
call fcn.00408ed0
add esp, 0xc
mov edx, dword [ebp + 4]
mov ebx, dword [ebp + 8]
mov edi, dword [esp + 0xac]
lea eax, [edx + edi]
mov dword [esp], eax
cmp ebx, eax
jae 0x406aae
mov dword [esp + 0xc], edx
mov esi, 1
test ebx, ebx
mov edx, dword [esp + 8]
je 0x406a7d
mov esi, ebx
mov edi, dword [esp]
cmp esi, edi
jae 0x406ab6
mov ebp, dword [esp + 4]
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, esi
and eax, 0xfffffffd
mov ecx, esi
and ecx, 2
or esi, 2
imul esi, ecx
xor ecx, 2
imul ecx, eax
add esi, ecx
cmp esi, edi
jb 0x406a90
jmp 0x406aba
mov esi, ebx
mov ebp, dword [esp + 4]
jmp 0x406ae3
mov ebp, dword [esp + 4]
push esi
push dword [ebp + 0xc]
push dword [ebp]
push dword [edx + 0x34]
call dword [edx + 0x30]
add esp, 0x10
test eax, eax
je 0x406c40
mov dword [ebp], eax
mov dword [ebp + 8], esi
mov edi, dword [esp + 0xac]
mov edx, dword [esp + 0xc]
mov ebx, dword [esp]
mov dword [ebp + 4], ebx
test edi, edi
je 0x406b29
mov eax, dword [ebp + 0xc]
imul edx, eax
add edx, dword [ebp]
mov ecx, eax
not ecx
and ecx, edi
mov esi, edx
mov edx, edi
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, edi
or eax, edi
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0xac]
push esi
call fcn.00408ed0
add esp, 0xc
mov ebx, dword [ebp + 4]
mov esi, dword [ebp + 8]
mov eax, dword [esp + 0x44]
lea edi, [ebx + eax]
cmp esi, edi
jae 0x406b95
mov dword [esp], ebx
mov ebx, 1
test esi, esi
je 0x406b68
mov ebx, esi
jmp 0x406b68
mov eax, ebx
and eax, 0xfffffffd
mov ecx, ebx
and ecx, 2
or ebx, 2
imul ebx, ecx
xor ecx, 2
imul ecx, eax
add ebx, ecx
cmp ebx, edi
jb 0x406b50
push ebx
mov ebp, dword [esp + 8]
push dword [ebp + 0xc]
push dword [ebp]
mov eax, dword [esp + 0x14]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x406c40
mov dword [ebp], eax
mov dword [ebp + 8], ebx
mov ebx, dword [esp]
mov dword [ebp + 4], edi
cmp word [esp + 0x7c], 0
je 0x406bd5
mov eax, dword [ebp + 0xc]
imul ebx, eax
add ebx, dword [ebp]
mov ecx, eax
not ecx
mov esi, dword [esp + 0x44]
and ecx, esi
mov edx, esi
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, esi
or eax, esi
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0x7c]
push ebx
call fcn.00408ed0
add esp, 0xc
mov edi, dword [ebp + 0x14]
mov eax, dword [ebp + 0x18]
lea esi, [edi + 1]
cmp eax, esi
jae 0x406c7b
mov ebx, 1
test eax, eax
je 0x406c18
mov ebx, eax
jmp 0x406c18
mov eax, ebx
and eax, 0xfffffffd
mov ecx, ebx
and ecx, 2
or ebx, 2
imul ebx, ecx
xor ecx, 2
imul ecx, eax
add ebx, ecx
cmp ebx, esi
jb 0x406c00
push ebx
mov ebp, dword [esp + 8]
push dword [ebp + 0x1c]
push dword [ebp + 0x10]
mov eax, dword [esp + 0x14]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x406c40
mov dword [ebp + 0x10], eax
mov dword [ebp + 0x18], ebx
jmp 0x406c7e
mov edi, dword [esp + 0x10]
cmp dword [ebp + 8], edi
mov esi, dword [esp + 8]
jae 0x406c67
push edi
push dword [ebp + 0xc]
push dword [ebp]
push dword [esi + 0x34]
call dword [esi + 0x30]
add esp, 0x10
test eax, eax
je 0x406c6a
mov dword [ebp], eax
mov dword [ebp + 8], edi
mov dword [ebp + 4], edi
mov dword [esi + 0x1c], 0x10
xor eax, eax
add esp, 0x58
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp + 0x10]
mov dword [ebp + 0x14], esi
mov ecx, dword [ebp + 0x1c]
mov edx, ecx
not edx
imul edi, ecx
add edi, eax
mov eax, ecx
and eax, 1
neg eax
and edx, 1
mov esi, ecx
and esi, 0xfffffffe
imul esi, edx
or ecx, 1
and ecx, eax
add ecx, esi
lea eax, [esp + 0x54]
push ecx
push eax
push edi
call fcn.00408ed0
add esp, 0xc
mov eax, 1
jmp 0x406c73