Function at 0x406927
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x324
mov eax, dword [0x4271a0]
xor eax, esp
mov dword [esp + 0x320], eax
push ebx
mov ebx, dword [esp + 0x344]
xor eax, eax
push ebp
mov ebp, dword [esp + 0x330]
push esi
movzx esi, word [esp + 0x338]
push edi
mov edi, dword [esp + 0x34c]
push 0x22
push eax
lea eax, [esp + 0xb0]
mov dword [esp + 0x30], ebp
push eax
mov dword [esp + 0x68], esi
mov dword [esp + 0x60], edi
mov dword [esp + 0x44], ebx
call fcn.004037f6
add esp, 0xc
movzx edx, si
mov ecx, ebp
movzx eax, word [ecx]
add edx, 0xffff
lea ecx, [ecx + 2]
inc word [esp + eax*2 + 0xa8]
test dx, dx
jne 0x406986
cmp word [esp + 0xa8], si
jne 0x4069b4
xor eax, eax
mov dword [edi], eax
mov dword [ebx], eax
jmp 0x406e64
xor edi, edi
inc edi
xor ecx, ecx
push 0x10
mov dword [esp + 0x14], edi
mov si, di
pop edx
movzx eax, si
cmp word [esp + eax*2 + 0xa8], cx
jne 0x4069dd
inc edi
mov si, di
mov dword [esp + 0x10], edi
cmp si, dx
jbe 0x4069c3
cmp word [ebx], si
movzx eax, si
mov ecx, eax
mov dword [esp + 0x24], eax
cmovae ecx, dword [ebx]
xor ebx, ebx
movzx eax, dx
cmp word [esp + eax*2 + 0xa8], bx
jne 0x406a06
add edx, 0xffff
test dx, dx
jne 0x4069ee
mov ebx, dword [esp + 0x38]
cmp cx, dx
movzx eax, dx
mov dword [esp + 0x60], eax
movzx eax, dx
mov ebp, eax
mov dword [esp + 0x34], eax
cmovbe ebp, ecx
mov ecx, ebp
mov dword [esp + 0x20], ebp
mov ebp, dword [esp + 0x28]
mov dword [ebx], ecx
xor ebx, ebx
mov ecx, dword [esp + 0x24]
inc ebx
shl ebx, cl
cmp si, dx
jae 0x406a5c
movzx eax, si
movzx eax, word [esp + eax*2 + 0xa8]
sub ebx, eax
js 0x406a6c
inc edi
add ebx, ebx
mov si, di
mov dword [esp + 0x10], edi
cmp si, dx
jb 0x406a3a
mov eax, dword [esp + 0x34]
movzx esi, word [esp + eax*2 + 0xa8]
sub ebx, esi
mov dword [esp + 0x48], ebx
jns 0x406a74
push 2
pop eax
jmp 0x406e64
mov ecx, dword [esp + 0x34]
lea eax, [esi + ebx]
mov edi, 0xffff
xor esi, esi
add edx, edi
mov dword [esp + 0x10], esi
mov word [esp + ecx*2 + 0xa8], ax
xor eax, eax
mov word [esp + 0xce], ax
test dx, dx
je 0x406abc
mov cx, si
add cx, word [esp + eax + 0xaa]
lea eax, [eax + 2]
add edx, edi
mov word [esp + eax + 0xce], cx
test dx, dx
jne 0x406aa2
mov edi, dword [esp + 0x5c]
movzx eax, word [ebp]
lea ebp, [ebp + 2]
mov dword [esp + 0x10], eax
test ax, ax
je 0x406af0
movzx edx, ax
movzx ecx, word [esp + edx*2 + 0xcc]
mov eax, ecx
mov word [esp + eax*2 + 0xf0], si
lea eax, [ecx + 1]
mov word [esp + edx*2 + 0xcc], ax
inc esi
cmp si, di
jb 0x406ac0
mov edx, dword [esp + 0x24]
xor eax, eax
mov ebp, dword [esp + 0x34]
xor esi, esi
mov word [esp + 0xcc], ax
or edi, 0xffffffff
lea eax, [esp + 0xf0]
mov dword [esp + 0x30], esi
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x20]
mov ecx, eax
neg ecx
mov dword [esp + 0x44], edi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x68], esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x40], esi
cmp edx, ebp
ja 0x406e57
lea esi, [esp + 0xa8]
lea esi, [esi + edx*2]
mov dword [esp + 0x4c], esi
movzx esi, word [esi]
test si, si
je 0x406e3d
xor ebp, ebp
inc ebp
add esi, 0xffff
add eax, ecx
mov dword [esp + 0x38], esi
cmp edx, eax
jle 0x406cc2
movzx eax, si
inc eax
mov dword [esp + 0x64], eax
mov edx, dword [esp + 0x20]
inc edi
mov eax, dword [esp + 0x60]
add ecx, edx
mov dword [esp + 0x2c], ecx
movzx ecx, cx
sub eax, ecx
mov dword [esp + 0x58], ecx
movzx esi, ax
movzx ecx, dx
mov edx, esi
cmp si, cx
mov dword [esp + 0x44], edi
mov eax, ecx
cmova edx, eax
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x24]
sub eax, dword [esp + 0x58]
movzx esi, dx
movzx edx, ax
mov eax, ebp
mov cl, dl
mov dword [esp + 0x28], esi
shl ax, cl
mov byte [esp + 0x17], cl
movzx ecx, ax
mov dword [esp + 0x10], edx
cmp ecx, dword [esp + 0x64]
jbe 0x406c15
mov eax, 0xffff
sub eax, dword [esp + 0x38]
add ecx, eax
mov eax, dword [esp + 0x4c]
inc edx
mov dword [esp + 0x10], edx
cmp dx, si
jae 0x406c0b
mov ebx, esi
lea eax, [eax + 2]
add ecx, ecx
movzx esi, word [eax]
cmp cx, si
jbe 0x406c07
sub ecx, esi
inc edx
mov dword [esp + 0x10], edx
cmp dx, bx
jb 0x406bee
mov ebx, dword [esp + 0x48]
mov cl, byte [esp + 0x10]
mov byte [esp + 0x17], cl
jmp 0x406c19
mov cl, byte [esp + 0x17]
mov eax, ebp
shl ax, cl
movzx esi, ax
movzx eax, si
inc eax
mov dword [esp + 0x40], esi
imul eax, eax, 6
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
je 0x406e7d
mov edx, dword [esp + 0x54]
lea ecx, [esi + 1]
add word [0x42a42c], cx
lea ecx, [eax + 6]
add eax, 2
mov dword [esp + 0x28], ecx
mov dword [esp + 0x54], eax
mov dword [edx], ecx
xor edx, edx
mov dword [esp + edi*4 + 0x68], ecx
mov dword [eax], edx
test edi, edi
je 0x406cac
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x30]
mov byte [esp + 0x19], al
mov al, byte [esp + 0x17]
add al, 0x10
mov dword [esp + 0x1a], ecx
mov cl, byte [esp + 0x58]
sub cl, byte [esp + 0x50]
mov byte [esp + 0x18], al
movzx eax, si
shr eax, cl
imul ecx, eax, 6
mov eax, dword [esp + 0x18]
mov word [esp + edi*2 + 0xcc], si
add ecx, dword [esp + edi*4 + 0x64]
mov dword [ecx], eax
mov ax, word [esp + 0x1c]
mov word [ecx + 4], ax
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x2c]
add eax, ecx
mov edx, dword [esp + 0x24]
cmp edx, eax
jg 0x406b79
mov al, dl
lea esi, [esp + 0xf0]
sub al, cl
mov byte [esp + 0x19], al
mov eax, dword [esp + 0x5c]
movzx eax, ax
lea eax, [esi + eax*2]
mov esi, dword [esp + 0x3c]
cmp esi, eax
jb 0x406cea
mov byte [esp + 0x18], 0x63
jmp 0x406d40
movzx ecx, word [esi]
add esi, 2
mov ax, word [esp + 0x340]
mov dword [esp + 0x3c], esi
cmp cx, ax
jae 0x406d19
mov eax, 0x100
mov word [esp + 0x1a], cx
cmp cx, ax
setb al
add al, 0xf
mov byte [esp + 0x18], al
jmp 0x406d40
movzx eax, ax
sub ecx, eax
mov dword [esp + 0x3c], esi
mov eax, dword [esp + 0x348]
mov al, byte [eax + ecx*2]
mov byte [esp + 0x18], al
mov eax, dword [esp + 0x344]
mov ax, word [eax + ecx*2]
mov word [esp + 0x1a], ax
mov esi, dword [esp + 0x2c]
mov ecx, edx
sub ecx, esi
mov eax, ebp
shl ax, cl
mov cx, si
movzx eax, ax
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x30]
shr ax, cl
movzx ecx, ax
mov ax, cx
mov dword [esp + 0x10], ecx
cmp ax, word [esp + 0x40]
jae 0x406da8
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x50]
mov di, word [esp + 0x1c]
movzx eax, ax
add ecx, edx
imul eax, eax, 6
mov dword [esp + 0x10], ecx
add eax, dword [esp + 0x28]
mov dword [eax], esi
mov word [eax + 4], di
mov ax, cx
cmp ax, word [esp + 0x40]
jb 0x406d7c
mov ebx, dword [esp + 0x48]
mov edx, dword [esp + 0x24]
mov edi, dword [esp + 0x44]
mov esi, dword [esp + 0x30]
lea ecx, [edx - 1]
mov eax, ebp
shl ax, cl
movzx ecx, ax
mov eax, ecx
mov dword [esp + 0x10], ecx
and eax, esi
test ax, ax
je 0x406dde
mov dx, cx
shr dx, 1
xor esi, ecx
mov word [esp + 0x10], dx
mov ecx, dword [esp + 0x10]
mov eax, ecx
and eax, esi
test ax, ax
jne 0x406dc7
movzx eax, word [esp + edi*2 + 0xcc]
xor esi, ecx
mov ecx, dword [esp + 0x2c]
mov edx, ebp
shl edx, cl
mov dword [esp + 0x30], esi
dec edx
movzx esi, si
and edx, esi
cmp edx, eax
je 0x406e24
mov ebx, dword [esp + 0x20]
movzx eax, word [esp + edi*2 + 0xca]
sub ecx, ebx
dec edi
mov edx, ebp
shl edx, cl
dec edx
and edx, esi
cmp edx, eax
jne 0x406e02
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x44], edi
mov dword [esp + 0x2c], ecx
mov esi, dword [esp + 0x38]
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
test si, si
jne 0x406b5d
mov ebp, dword [esp + 0x34]
mov esi, dword [esp + 0x4c]
inc edx
add esi, 2
mov dword [esp + 0x24], edx
mov dword [esp + 0x4c], esi
cmp edx, ebp
jle 0x406b4e
xor esi, esi
test ebx, ebx
je 0x406e62
xor eax, eax
inc eax
cmp ebp, eax
jne 0x406e64
mov eax, esi
mov ecx, dword [esp + 0x330]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00408783
add esp, 0x324
ret
test edi, edi
je 0x406e9c
mov eax, dword [esp + 0x68]
test eax, eax
je 0x406e9c
mov esi, dword [eax - 4]
sub eax, 6
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, esi
test esi, esi
jne 0x406e89
push 0x7d3
call fcn.00403824
push eax
call fcn.004020cc
push 3
jmp 0x406a6e