Function at 0x406040
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
mov eax, dword [0x463040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
xorps xmm0, xmm0
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov dword [ebp - 0xd4], eax
mov ebx, ecx
mov eax, dword [ebp + 0x20]
push esi
mov esi, edx
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp + 0x24]
push edi
mov edi, dword [ebp + 0x18]
mov dword [ebp - 0xb8], esi
mov dword [ebp - 0xc4], eax
movups xmmword [ebp - 0x48], xmm0
mov dword [ebp - 0x10], 0
movups xmmword [ebp - 0x38], xmm0
mov dword [ebp - 0xc], 0
movups xmmword [ebp - 0x28], xmm0
movq qword [ebp - 0x18], xmm0
nop dword [eax]
mov eax, dword [ecx]
lea ecx, [ecx + 4]
inc dword [ebp + eax*4 - 0x48]
sub edx, 1
jne 0x4060b0
cmp dword [ebp - 0x48], esi
jne 0x4060e0
mov eax, dword [ebp - 0xcc]
mov dword [eax], edx
mov dword [edi], edx
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043435c
mov esp, ebp
pop ebp
ret
mov eax, dword [edi]
mov ecx, 1
cmp dword [ebp + ecx*4 - 0x48], 0
jne 0x4060f4
inc ecx
cmp ecx, 0xf
jbe 0x4060e7
cmp eax, ecx
mov dword [ebp - 0x90], ecx
mov edx, 0xf
cmovb eax, ecx
cmp dword [ebp + edx*4 - 0x48], 0
jne 0x406110
sub edx, 1
jne 0x406104
cmp eax, edx
mov dword [ebp - 0xb0], edx
mov esi, 1
cmova eax, edx
shl esi, cl
mov dword [ebp - 0x9c], eax
mov dword [edi], eax
cmp ecx, edx
jae 0x406141
nop
sub esi, dword [ebp + ecx*4 - 0x48]
js 0x406579
inc ecx
add esi, esi
cmp ecx, edx
jb 0x406130
lea ecx, [edx*4]
mov eax, esi
sub esi, dword [ebp + ecx - 0x48]
mov dword [ebp - 0xb4], ecx
mov dword [ebp - 0xdc], esi
js 0x406579
mov dword [ebp + ecx - 0x48], eax
lea esi, [ebp - 0x44]
xor ecx, ecx
lea edi, [ebp - 0x80]
mov dword [ebp - 0x84], ecx
sub edx, 1
je 0x406189
mov eax, dword [esi]
lea esi, [esi + 4]
add ecx, eax
lea edi, [edi + 4]
mov dword [edi - 4], ecx
sub edx, 1
jne 0x406177
mov esi, dword [ebp - 0xb8]
xor ecx, ecx
mov edx, dword [ebx]
lea ebx, [ebx + 4]
mov edi, dword [ebp - 0xc4]
test edx, edx
je 0x4061b2
mov eax, dword [ebp + edx*4 - 0x88]
mov dword [edi + eax*4], ecx
inc eax
mov dword [ebp + edx*4 - 0x88], eax
inc ecx
cmp ecx, esi
jb 0x406191
mov eax, dword [ebp - 0xb4]
or edx, 0xffffffff
mov ecx, dword [ebp - 0x9c]
xor esi, esi
mov ebx, ecx
mov dword [ebp - 0x94], edi
neg ebx
mov dword [ebp - 0xa0], 0
mov eax, dword [ebp + eax - 0x88]
xor edi, edi
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp - 0x90]
mov dword [ebp - 0x88], 0
mov dword [ebp - 0x8c], edx
mov dword [ebp - 0xa4], ebx
mov dword [ebp - 0x118], 0
mov dword [ebp - 0xb8], esi
cmp eax, dword [ebp - 0xb0]
jg 0x406549
lea eax, [ebp + eax*4 - 0x48]
mov dword [ebp - 0xac], eax
mov eax, dword [ebp - 0xbc]
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0x90]
nop
mov edx, dword [ebp - 0xac]
mov edx, dword [edx]
test edx, edx
mov dword [ebp - 0xa8], edx
mov edx, dword [ebp - 0x8c]
je 0x40652f
mov eax, dword [ebp - 0xa8]
mov dword [ebp - 0xd0], eax
dec eax
mov dword [ebp - 0xa8], eax
lea eax, [ebx + ecx]
cmp dword [ebp - 0x90], eax
jle 0x4063d8
mov eax, ebx
sub eax, ecx
jmp 0x406296
mov edx, dword [ebp - 0x8c]
mov edi, dword [ebp - 0xb0]
add ebx, ecx
add eax, ecx
mov dword [ebp - 0xa4], ebx
inc edx
mov dword [ebp - 0xb4], eax
sub edi, ebx
mov dword [ebp - 0x8c], edx
mov edx, dword [ebp - 0x90]
cmp edi, ecx
mov eax, 1
cmova edi, ecx
sub edx, ebx
mov ecx, edx
shl eax, cl
cmp eax, dword [ebp - 0xd0]
jbe 0x406303
mov esi, dword [ebp - 0xac]
or ecx, 0xffffffff
sub ecx, dword [ebp - 0xa8]
add eax, ecx
cmp edx, edi
jae 0x406303
inc edx
cmp edx, edi
jae 0x406303
nop dword [eax]
mov ecx, dword [esi + 4]
lea esi, [esi + 4]
add eax, eax
cmp eax, ecx
jbe 0x406303
inc edx
sub eax, ecx
cmp edx, edi
jb 0x4062f0
mov eax, dword [ebp - 0xc8]
mov ecx, edx
mov edi, 1
shl edi, cl
mov eax, dword [eax]
lea ecx, [eax + edi]
cmp ecx, 0x5a0
ja 0x406579
mov ebx, dword [ebp - 0xd4]
lea esi, [ebx + eax*8]
mov eax, dword [ebp - 0x8c]
mov ebx, dword [ebp - 0xc8]
mov dword [ebp - 0xb8], esi
mov dword [ebp + eax*4 - 0x118], esi
mov dword [ebx], ecx
test eax, eax
je 0x4063ab
mov ecx, dword [ebp - 0x8c]
mov eax, dword [ebp - 0xa0]
mov byte [ebp - 0xc0], dl
mov edx, eax
mov dword [ebp + ecx*4 - 0x88], eax
mov eax, dword [ebp - 0x8c]
mov ecx, dword [ebp - 0x9c]
mov byte [ebp - 0xbf], cl
mov ecx, dword [ebp - 0xb4]
shr edx, cl
mov ecx, dword [ebp + eax*4 - 0x11c]
mov eax, esi
sub eax, ecx
sar eax, 3
sub eax, edx
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0xc0]
mov dword [ecx + edx*8], eax
mov eax, dword [ebp - 0x98]
mov dword [ecx + edx*8 + 4], eax
jmp 0x4063b3
mov eax, dword [ebp - 0xcc]
mov dword [eax], esi
mov ebx, dword [ebp - 0xa4]
mov ecx, dword [ebp - 0x9c]
mov edx, dword [ebp - 0x90]
lea eax, [ebx + ecx]
cmp edx, eax
mov eax, dword [ebp - 0xb4]
jg 0x406290
jmp 0x4063de
mov edx, dword [ebp - 0x90]
mov ecx, dword [ebp - 0xd8]
mov al, dl
sub al, bl
mov byte [ebp - 0xbf], al
mov eax, dword [ebp - 0xc4]
lea eax, [eax + ecx*4]
cmp dword [ebp - 0x94], eax
jb 0x406408
mov byte [ebp - 0xc0], 0xc0
jmp 0x406462
mov eax, dword [ebp - 0x94]
mov ecx, dword [eax]
add eax, 4
mov dword [ebp - 0x94], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x98], ecx
cmp ecx, eax
jae 0x40643a
cmp ecx, 0x100
sbb al, al
and al, 0xa0
add al, 0x60
mov byte [ebp - 0xc0], al
jmp 0x406462
sub ecx, eax
mov eax, dword [ebp + 0x10]
mov al, byte [eax + ecx*4]
add al, 0x50
mov byte [ebp - 0xc0], al
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + ecx*4]
mov eax, dword [ebp - 0x94]
mov dword [ebp - 0x98], ecx
mov dword [ebp - 0x94], eax
mov eax, dword [ebp - 0xa0]
mov ecx, edx
sub ecx, ebx
mov edx, 1
shl edx, cl
mov ecx, ebx
shr eax, cl
cmp eax, edi
jae 0x40649a
mov ecx, dword [ebp - 0xc0]
mov ebx, dword [ebp - 0x98]
mov dword [esi + eax*8], ecx
mov dword [esi + eax*8 + 4], ebx
add eax, edx
cmp eax, edi
jb 0x406487
mov ebx, dword [ebp - 0xa4]
mov ecx, dword [ebp - 0x90]
mov eax, 1
mov edx, dword [ebp - 0xa0]
lea ecx, [ecx - 1]
shl eax, cl
test edx, eax
je 0x4064bc
xor edx, eax
shr eax, 1
test edx, eax
jne 0x4064b4
xor edx, eax
mov ecx, ebx
mov eax, 1
mov dword [ebp - 0xa0], edx
shl eax, cl
mov ecx, dword [ebp - 0x8c]
dec eax
and eax, edx
cmp eax, dword [ebp + ecx*4 - 0x88]
je 0x40650f
mov esi, ecx
sub ebx, dword [ebp - 0x9c]
mov eax, 1
mov ecx, ebx
dec esi
shl eax, cl
dec eax
and eax, edx
cmp eax, dword [ebp + esi*4 - 0x88]
jne 0x4064e1
mov dword [ebp - 0x8c], esi
mov esi, dword [ebp - 0xb8]
mov dword [ebp - 0xa4], ebx
mov eax, dword [ebp - 0xa8]
mov ecx, dword [ebp - 0x9c]
mov edx, dword [ebp - 0x8c]
test eax, eax
jne 0x406262
mov eax, dword [ebp - 0x90]
add dword [ebp - 0xac], 4
inc eax
mov dword [ebp - 0x90], eax
cmp eax, dword [ebp - 0xb0]
jle 0x406240
cmp dword [ebp - 0xdc], 0
je 0x4060cd
cmp dword [ebp - 0xb0], 1
je 0x4060cd
mov eax, 0xfffffffb
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043435c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 0xfffffffd
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043435c
mov esp, ebp
pop ebp
ret