Function at 0x406c4f
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x318
mov eax, dword [0x4231a4]
xor eax, esp
mov dword [esp + 0x314], eax
push ebx
mov ebx, dword [esp + 0x338]
xor eax, eax
push ebp
movzx ebp, word [esp + 0x328]
push esi
mov esi, dword [esp + 0x328]
push edi
mov edi, dword [esp + 0x340]
push 0x22
push eax
lea eax, [esp + 0xa4]
mov dword [esp + 0x24], esi
push eax
mov dword [esp + 0x64], ebp
mov dword [esp + 0x5c], edi
mov dword [esp + 0x50], ebx
call fcn.004037ab
add esp, 0xc
movzx edx, bp
mov ecx, esi
movzx eax, word [ecx]
add edx, 0xffff
lea ecx, [ecx + 2]
inc word [esp + eax*2 + 0x9c]
test dx, dx
jne 0x406cae
cmp word [esp + 0x9c], bp
jne 0x406cdc
xor eax, eax
mov dword [edi], eax
mov dword [ebx], eax
jmp 0x4071aa
mov ecx, dword [ebx]
xor ebp, ebp
push 0x10
pop edx
xor ebx, ebx
lea edi, [ebp + 1]
mov dword [esp + 0x10], edi
mov si, di
movzx eax, si
cmp word [esp + eax*2 + 0x9c], bx
jne 0x406d09
inc edi
mov si, di
mov dword [esp + 0x10], edi
cmp si, dx
jbe 0x406cef
mov ebx, dword [esp + 0x44]
cmp cx, si
movzx eax, si
cmovb ecx, eax
mov dword [esp + 0x18], eax
xor ebp, ebp
movzx eax, dx
cmp word [esp + eax*2 + 0x9c], bp
jne 0x406d34
add edx, 0xffff
test dx, dx
jne 0x406d1c
cmp cx, dx
movzx eax, dx
mov dword [esp + 0x30], eax
cmova ecx, eax
xor ebp, ebp
mov dword [ebx], ecx
inc ebp
mov dword [esp + 0x28], ecx
mov ebx, ebp
mov ecx, dword [esp + 0x18]
shl ebx, cl
cmp si, dx
jae 0x406d7d
movzx eax, si
movzx eax, word [esp + eax*2 + 0x9c]
sub ebx, eax
js 0x406f35
inc edi
add ebx, ebx
mov si, di
mov dword [esp + 0x10], edi
cmp si, dx
jb 0x406d57
mov eax, dword [esp + 0x30]
movzx ecx, word [esp + eax*2 + 0x9c]
sub ebx, ecx
mov dword [esp + 0x44], ebx
js 0x406f35
lea eax, [ecx + ebx]
mov edi, 0xffff
mov ecx, dword [esp + 0x30]
xor esi, esi
add edx, edi
mov dword [esp + 0x10], esi
mov word [esp + ecx*2 + 0x9c], ax
xor eax, eax
mov word [esp + 0xc2], ax
test dx, dx
je 0x406dd9
mov cx, si
add cx, word [esp + eax + 0x9e]
lea eax, [eax + 2]
add edx, edi
mov word [esp + eax + 0xc2], cx
test dx, dx
jne 0x406dbf
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x58]
movzx eax, word [ecx]
add ecx, 2
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], ecx
test ax, ax
je 0x406e18
movzx edx, ax
movzx ecx, word [esp + edx*2 + 0xc0]
mov eax, ecx
mov word [esp + eax*2 + 0xe4], si
lea eax, [ecx + 1]
mov ecx, dword [esp + 0x1c]
mov word [esp + edx*2 + 0xc0], ax
inc esi
cmp si, di
jb 0x406de1
mov ecx, dword [esp + 0x28]
xor eax, eax
xor esi, esi
mov word [esp + 0xc0], ax
lea eax, [esp + 0xe4]
mov dword [esp + 0x38], esi
mov dword [esp + 0x48], eax
neg ecx
mov eax, dword [esp + 0x18]
or edi, 0xffffffff
mov dword [esp + 0x5c], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x4c], esi
mov esi, dword [esp + 0x30]
mov dword [esp + 0x2c], ecx
cmp eax, esi
jg 0x40719c
lea edx, [esp + 0x9c]
lea edx, [edx + eax*2]
mov dword [esp + 0x1c], edx
movzx edx, word [edx]
mov dword [esp + 0x3c], edx
test dx, dx
mov edx, dword [esp + 0x28]
je 0x407160
mov esi, dword [esp + 0x3c]
add esi, 0xffff
add edx, ecx
mov dword [esp + 0x3c], esi
cmp eax, edx
jle 0x406fe4
movzx eax, si
inc eax
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x30]
mov esi, edx
movzx ecx, si
inc edi
sub eax, ecx
mov dword [esp + 0x54], ecx
movzx ecx, ax
mov dword [esp + 0x2c], esi
mov edx, ecx
mov esi, dword [esp + 0x28]
cmp cx, si
movzx eax, si
cmova edx, eax
mov eax, dword [esp + 0x18]
sub eax, dword [esp + 0x54]
movzx esi, dx
movzx edx, ax
mov eax, ebp
mov cl, dl
mov dword [esp + 0x40], esi
shl ax, cl
mov byte [esp + 0x17], cl
movzx ecx, ax
mov dword [esp + 0x10], edx
cmp ecx, dword [esp + 0x34]
jle 0x406f3d
mov eax, 0xffff
sub eax, dword [esp + 0x3c]
add ecx, eax
mov eax, dword [esp + 0x1c]
inc edx
mov dword [esp + 0x10], edx
cmp dx, si
jae 0x406f2b
mov ebp, esi
lea eax, [eax + 2]
add ecx, ecx
movzx esi, word [eax]
cmp cx, si
jbe 0x406f28
sub ecx, esi
inc edx
mov dword [esp + 0x10], edx
cmp dx, bp
jb 0x406f0f
xor ebp, ebp
inc ebp
mov cl, byte [esp + 0x10]
mov byte [esp + 0x17], cl
jmp 0x406f41
push 2
pop eax
jmp 0x4071aa
mov cl, byte [esp + 0x17]
mov eax, ebp
shl ax, cl
movzx esi, ax
movzx eax, si
inc eax
mov dword [esp + 0x4c], esi
imul eax, eax, 6
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
je 0x407177
mov edx, dword [esp + 0x50]
lea ecx, [esi + 1]
add word [0x42635c], cx
lea ecx, [eax + 6]
add eax, 2
mov dword [esp + 0x40], ecx
mov dword [esp + 0x50], eax
mov dword [edx], ecx
xor edx, edx
mov dword [esp + edi*4 + 0x5c], ecx
mov dword [eax], edx
mov edx, dword [esp + 0x28]
test edi, edi
je 0x406fd2
mov al, byte [esp + 0x17]
mov esi, dword [esp + 0x38]
add al, 0x10
mov dword [esp + 0x22], ecx
mov cl, byte [esp + 0x54]
mov byte [esp + 0x20], al
sub cl, dl
movzx eax, si
shr eax, cl
imul ecx, eax, 6
mov byte [esp + 0x21], dl
mov eax, dword [esp + 0x20]
mov word [esp + edi*2 + 0xc0], si
add ecx, dword [esp + edi*4 + 0x58]
mov dword [ecx], eax
mov ax, word [esp + 0x24]
mov word [ecx + 4], ax
mov ecx, dword [esp + 0x2c]
add edx, ecx
mov eax, dword [esp + 0x18]
cmp eax, edx
jg 0x406ea4
sub al, cl
lea edx, [esp + 0xe4]
mov byte [esp + 0x21], al
mov eax, dword [esp + 0x58]
movzx eax, ax
lea eax, [edx + eax*2]
mov edx, dword [esp + 0x48]
cmp edx, eax
jb 0x40700a
mov byte [esp + 0x20], 0x63
jmp 0x40705c
movzx ecx, word [edx]
mov ax, word [esp + 0x334]
cmp cx, ax
jae 0x407032
mov eax, 0x100
mov word [esp + 0x22], cx
cmp cx, ax
setb al
add al, 0xf
mov byte [esp + 0x20], al
jmp 0x407055
movzx eax, ax
sub ecx, eax
mov eax, dword [esp + 0x33c]
mov al, byte [eax + ecx*2]
mov byte [esp + 0x20], al
mov eax, dword [esp + 0x338]
mov ax, word [eax + ecx*2]
mov word [esp + 0x22], ax
add edx, 2
mov dword [esp + 0x48], edx
mov edx, dword [esp + 0x18]
mov eax, ebp
mov esi, dword [esp + 0x2c]
mov ecx, edx
sub ecx, esi
shl ax, cl
mov cx, si
movzx eax, ax
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x38]
shr ax, cl
movzx ecx, ax
mov ax, cx
mov dword [esp + 0x10], ecx
cmp ax, word [esp + 0x4c]
jae 0x4070c7
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x34]
mov bx, word [esp + 0x24]
movzx eax, ax
add ecx, edx
imul eax, eax, 6
mov dword [esp + 0x10], ecx
add eax, dword [esp + 0x40]
mov dword [eax], esi
mov word [eax + 4], bx
mov ax, cx
cmp ax, word [esp + 0x4c]
jb 0x40709c
mov ebx, dword [esp + 0x44]
xor ebp, ebp
mov edx, dword [esp + 0x18]
inc ebp
mov esi, dword [esp + 0x38]
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 0x4070fd
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 0x4070e6
xor esi, ecx
mov edx, ebp
mov ecx, dword [esp + 0x2c]
shl edx, cl
movzx eax, si
dec edx
and edx, eax
mov dword [esp + 0x34], eax
movzx eax, word [esp + edi*2 + 0xc0]
mov dword [esp + 0x38], esi
cmp edx, eax
je 0x407147
mov esi, dword [esp + 0x28]
mov ebx, dword [esp + 0x34]
movzx eax, word [esp + edi*2 + 0xbe]
sub ecx, esi
dec edi
mov edx, ebp
shl edx, cl
dec edx
and edx, ebx
cmp edx, eax
jne 0x407129
mov ebx, dword [esp + 0x44]
mov dword [esp + 0x2c], ecx
mov esi, dword [esp + 0x3c]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
test si, si
jne 0x406e88
mov esi, dword [esp + 0x30]
add dword [esp + 0x1c], 2
inc eax
mov dword [esp + 0x18], eax
cmp eax, esi
jg 0x40719c
mov edx, dword [esp + 0x1c]
jmp 0x406e70
test edi, edi
je 0x407185
push dword [esp + 0x5c]
call fcn.004071c3
pop ecx
push 0x7d3
call fcn.004037d9
push eax
call fcn.004022e3
push 3
jmp 0x406f37
test ebx, ebx
je 0x4071a4
cmp esi, ebp
jne 0x4071a8
xor eax, eax
mov ebp, eax
mov eax, ebp
mov ecx, dword [esp + 0x324]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00408980
add esp, 0x318
ret