Function at 0x4067a0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x580
xor eax, eax
mov ecx, 0x11
push ebx
push esi
push edi
lea edi, [esp + 0x44]
push ebp
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x598]
mov eax, dword [esp + 0x59c]
mov ecx, edx
mov esi, dword [ecx]
add ecx, 4
inc dword [esp + esi*4 + 0x48]
dec eax
jne 0x4067c7
mov eax, dword [esp + 0x59c]
cmp eax, dword [esp + 0x48]
jne 0x406807
mov ecx, dword [esp + 0x5ac]
mov ebx, dword [esp + 0x5b0]
xor eax, eax
pop ebp
pop edi
mov dword [ecx], 0
pop esi
mov dword [ebx], 0
pop ebx
add esp, 0x580
ret
mov ebx, dword [esp + 0x5b0]
mov ecx, 1
mov eax, dword [ebx]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x4c]
cmp dword [eax], 0
jne 0x406831
add eax, 4
inc ecx
lea esi, [esp + 0x88]
cmp eax, esi
jbe 0x40681d
mov dword [esp + 0x20], ecx
mov esi, ecx
cmp dword [esp + 0x10], ecx
jae 0x406841
mov dword [esp + 0x10], esi
mov edi, 0x10
lea eax, [esp + 0x88]
cmp dword [eax], 0
jne 0x40685e
sub eax, 4
dec edi
lea ebp, [esp + 0x48]
cmp eax, ebp
jne 0x40684d
mov dword [esp + 0x34], edi
cmp dword [esp + 0x10], edi
jbe 0x40686c
mov dword [esp + 0x10], edi
mov eax, dword [esp + 0x10]
mov dword [ebx], eax
mov eax, 1
shl eax, cl
mov dword [esp + 0x2c], eax
cmp ecx, edi
jae 0x40689f
lea ebx, [esp + ecx*4 + 0x48]
mov eax, dword [ebx]
sub dword [esp + 0x2c], eax
js 0x4068bb
add ebx, 4
inc ecx
mov eax, dword [esp + 0x2c]
add eax, eax
cmp ecx, edi
mov dword [esp + 0x2c], eax
jb 0x406885
lea eax, [esp + edi*4 + 0x48]
mov ecx, dword [eax]
sub dword [esp + 0x2c], ecx
jns 0x4068cb
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
add ecx, dword [esp + 0x2c]
lea ebx, [esp + 0x4c]
mov dword [eax], ecx
xor ecx, ecx
lea eax, [esp + 0x94]
dec edi
mov dword [esp + 0x90], ecx
je 0x4068f5
add ecx, dword [ebx]
add ebx, 4
mov dword [eax], ecx
add eax, 4
dec edi
jne 0x4068e8
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x406913
lea ecx, [esp + eax*4 + 0x8c]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [esp + eax*4 + 0x10c], edi
inc edi
cmp dword [esp + 0x59c], edi
ja 0x4068f7
xor edi, edi
lea eax, [esp + 0x110]
mov dword [esp + 0x18], edi
mov dword [esp + 0x8c], edi
xor edx, edx
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0xd0], edi
neg eax
mov dword [esp + 0x14], eax
cmp esi, dword [esp + 0x34]
mov dword [esp + 0x30], 0xffffffff
jg 0x406be7
mov eax, dword [esp + 0x20]
lea ecx, [esp + eax*4 + 0x48]
mov dword [esp + 0x40], ecx
mov eax, dword [ecx]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x38]
dec dword [esp + 0x38]
test eax, eax
je 0x406bd5
mov eax, dword [esp + 0x10]
add eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x20]
jge 0x406aa3
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x38]
shl esi, 2
inc eax
mov dword [esp + 0x1c], eax
add esi, 4
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x34]
inc dword [esp + 0x30]
add dword [esp + 0x14], eax
sub edi, dword [esp + 0x14]
cmp eax, edi
jae 0x4069bb
mov edi, eax
mov ebx, dword [esp + 0x20]
mov edx, 1
sub ebx, dword [esp + 0x14]
mov cl, bl
shl edx, cl
cmp edx, dword [esp + 0x1c]
jbe 0x4069f5
mov eax, dword [esp + 0x38]
inc ebx
inc eax
sub edx, eax
mov eax, dword [esp + 0x40]
cmp ebx, edi
jae 0x4069f5
mov ecx, dword [eax + 4]
add edx, edx
add eax, 4
cmp edx, ecx
jbe 0x4069f5
sub edx, ecx
inc ebx
cmp ebx, edi
jb 0x4069e2
mov edi, 1
mov cl, bl
shl edi, cl
lea eax, [edi + edi*2 + 3]
add eax, eax
push eax
call fcn.00409870
add esp, 4
test eax, eax
je 0x406c05
lea edx, [edi + 1]
mov ecx, dword [esp + 0x594]
mov ebp, dword [esp + 0x5ac]
add eax, 2
add dword [ecx + 0xc], edx
mov dword [esp + 0x5ac], eax
lea edx, [eax + 4]
test esi, esi
mov dword [ebp], edx
mov dword [esp + esi + 0xd0], edx
mov dword [eax], 0
je 0x406a91
mov eax, dword [esp + 0x18]
mov cl, byte [esp + 0x10]
add bl, 0x10
lea ebp, [esp + 0x24]
mov dword [esp + esi + 0x8c], eax
mov byte [esp + 0x25], cl
mov ecx, dword [esp + 0x14]
mov byte [esp + 0x24], bl
mov ebx, eax
sub cl, byte [esp + 0x10]
shr ebx, cl
mov dword [esp + 0x26], edx
lea ebx, [ebx + ebx*2]
mov cx, word [ebp + 4]
add ebx, ebx
add ebx, dword [esp + esi + 0xcc]
mov eax, dword [ebp]
mov dword [ebx], eax
mov word [ebx + 4], cx
mov eax, dword [esp + 0x14]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x20]
jl 0x40699e
mov bl, byte [esp + 0x14]
mov cl, byte [esp + 0x20]
sub cl, bl
mov eax, dword [esp + 0x59c]
mov byte [esp + 0x25], cl
lea ebp, [esp + eax*4 + 0x110]
cmp ebp, dword [esp + 0x3c]
ja 0x406acc
mov byte [esp + 0x24], 0x63
jmp 0x406b21
mov eax, dword [esp + 0x3c]
mov esi, dword [eax]
cmp dword [esp + 0x5a0], esi
jbe 0x406af5
mov byte [esp + 0x1c], 0x10
cmp esi, 0x100
adc byte [esp + 0x1c], 0xff
mov al, byte [esp + 0x1c]
mov byte [esp + 0x24], al
jmp 0x406b17
sub esi, dword [esp + 0x5a0]
mov eax, dword [esp + 0x5a8]
add esi, esi
mov ebp, dword [esp + 0x5a4]
mov al, byte [esi + eax]
mov si, word [esi + ebp]
mov byte [esp + 0x24], al
add dword [esp + 0x3c], 4
mov word [esp + 0x26], si
mov eax, 1
mov esi, dword [esp + 0x18]
shl eax, cl
mov cl, bl
mov dword [esp + 0x44], eax
shr esi, cl
cmp esi, edi
jae 0x406b68
lea eax, [esi + esi*2]
mov ebp, dword [esp + 0x44]
lea ecx, [edx + eax*2]
lea eax, [ebp + ebp*2]
add eax, eax
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x24]
add esi, dword [esp + 0x44]
mov ebp, dword [eax]
mov ax, word [eax + 4]
mov dword [ecx], ebp
mov word [ecx + 4], ax
add ecx, dword [esp + 0x1c]
cmp esi, edi
jb 0x406b4c
mov eax, 1
mov cl, byte [esp + 0x20]
dec cl
shl eax, cl
test dword [esp + 0x18], eax
je 0x406b88
xor dword [esp + 0x18], eax
shr eax, 1
test dword [esp + 0x18], eax
jne 0x406b7b
mov cl, bl
xor dword [esp + 0x18], eax
mov eax, dword [esp + 0x30]
lea esi, [esp + eax*4 + 0x8c]
mov eax, 1
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
je 0x40696c
sub esi, 4
mov eax, dword [esp + 0x10]
dec dword [esp + 0x30]
sub dword [esp + 0x14], eax
mov eax, 1
mov cl, byte [esp + 0x14]
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
jne 0x406bad
jmp 0x40696c
inc dword [esp + 0x20]
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x34]
jle 0x40695a
cmp dword [esp + 0x2c], 0
je 0x406c2c
cmp dword [esp + 0x34], 1
je 0x406c2c
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
cmp dword [esp + 0x30], 0
je 0x406c1c
mov eax, dword [esp + 0xd0]
push eax
call fcn.00406c40
add esp, 4
mov eax, 3
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret