Function at 0x1006900
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
push ebx
push ebp
mov ebp, dword [esp + 0x20]
push esi
mov esi, eax
mov ebx, ecx
mov eax, ebx
shr eax, 1
sub eax, 1
cmp dword [esp + 0x1c], 0
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebp
mov dword [esp + 0x24], eax
je 0x1006c02
cmp dword [esp + 0x20], 0
je 0x1006c02
test ebx, ebx
je 0x1006c02
cmp dword [esp + 0x2c], 0
push edi
je 0x1006a13
test esi, esi
je 0x1006991
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x1006960
sub eax, edx
lea edi, [eax + 1]
push edi
call fcn.0100d7bd
add esp, 4
test eax, eax
mov dword [esp + 0x14], eax
je 0x1006991
mov ecx, edi
mov edx, ecx
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
test ebp, ebp
je 0x10069d3
mov eax, ebp
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x10069a0
sub eax, edx
lea esi, [eax + 1]
push esi
call fcn.0100d7bd
add esp, 4
test eax, eax
mov dword [esp + 0x10], eax
je 0x10069d3
mov ecx, esi
mov edi, eax
mov eax, ecx
shr ecx, 2
mov esi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x2c]
test edi, edi
je 0x1006a13
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x10069e0
sub eax, edx
lea esi, [eax + 1]
push esi
call fcn.0100d7bd
add esp, 4
test eax, eax
mov dword [esp + 0x28], eax
je 0x1006a13
mov ecx, esi
mov edx, ecx
mov esi, edi
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push ebx
call fcn.0100d7bd
mov esi, eax
add esp, 4
test esi, esi
jne 0x1006a6b
cmp dword [esp + 0x30], eax
je 0x1006c01
mov eax, dword [esp + 0x14]
test eax, eax
je 0x1006a3d
push eax
call fcn.0100d77e
add esp, 4
mov eax, dword [esp + 0x10]
test eax, eax
je 0x1006a4e
push eax
call fcn.0100d77e
add esp, 4
mov eax, dword [esp + 0x28]
test eax, eax
je 0x1006c01
push eax
call fcn.0100d77e
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, dword [esp + 0x24]
push eax
mov eax, ebx
mov ecx, esi
call fcn.010016e0
mov cx, word [esi]
lea ebp, [ebx - 2]
push ebp
lea edx, [esi + 2]
push edx
push esi
mov word [esp + 0x3c], cx
call fcn.0100d370
lea eax, [ebx + 1]
and al, 0xfe
push eax
call fcn.0100d7bd
mov edi, eax
add esp, 0x14
test edi, edi
je 0x1006b2c
and ebx, 1
mov eax, 1
sub eax, ebx
xor ecx, ecx
test ebp, ebp
mov byte [edi], 0xc1
jbe 0x1006ad9
lea ebx, [ebx]
test al, 1
mov dl, byte [ecx + esi]
mov byte [eax + edi], dl
je 0x1006acf
sub eax, 1
jmp 0x1006ad2
add eax, 3
add ecx, 1
cmp ecx, ebp
jb 0x1006ac0
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x10]
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0x14]
push 0x10001
push eax
push ecx
mov ax, bx
mov ch, al
push edx
push 0
push 0
mov cl, ah
mov eax, dword [esp + 0x38]
movzx edx, cx
xor edx, 0xc1c1
push edx
push 2
push 0x1003f60
push ebp
push eax
mov eax, edi
call fcn.01004220
add esp, 0x2c
test eax, eax
jne 0x1006b30
push edi
call fcn.0100d77e
add esp, 4
jmp 0x1006b30
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x18]
add eax, eax
add eax, eax
push eax
mov dword [esp + 0x30], eax
call fcn.0100d7bd
mov edi, eax
add esp, 4
test edi, edi
je 0x1006bbd
mov ecx, dword [esp + 0x18]
xor eax, eax
test ecx, ecx
jbe 0x1006b74
jmp 0x1006b60
movzx edx, word [esi + eax*2]
xor edx, 0xc1c10000
mov dword [edi + eax*4], edx
add eax, 1
cmp eax, ecx
jb 0x1006b60
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push 0x10001
push eax
push ecx
mov ecx, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x30]
push 0
push 0
movzx eax, bx
xor eax, 0xc1c1
push eax
push 4
push 0x1003f60
push ecx
push edx
mov eax, edi
call fcn.01004220
add esp, 0x2c
test eax, eax
jne 0x1006bbd
push edi
call fcn.0100d77e
add esp, 4
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
neg eax
sbb eax, eax
and eax, 0xe
add eax, 0x10001
push eax
mov eax, dword [esp + 0x2c]
push eax
push ecx
mov ecx, dword [esp + 0x2c]
push edx
push 0
push 0
movzx eax, bx
xor eax, 0xc1c1
push eax
push 2
push 0x1003f60
push ebp
push ecx
mov eax, esi
call fcn.01004220
add esp, 0x2c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret