Function at 0x1002defa
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov al, byte [edi + 8]
mov ebx, dword [edi]
mov dword [ebp - 8], ebx
test al, al
jne 0x1002e152
mov edx, dword [ebp + 0x10]
test edx, edx
je 0x1002df23
movzx ecx, word [edx + 8]
jmp 0x1002df25
xor ecx, ecx
mov al, byte [edi + 9]
mov esi, dword [ebp + 0xc]
mov dword [ebp - 4], ecx
cmp al, 8
jae 0x1002e099
movzx eax, al
sub eax, 1
je 0x1002e032
sub eax, 1
je 0x1002dfc3
dec eax
sub eax, 1
jne 0x1002e08c
imul eax, ecx, 0x11
push 4
movzx edx, ax
lea eax, [ebx - 1]
mov ecx, eax
mov dword [ebp - 4], edx
shr ecx, 1
and eax, 1
add ecx, esi
shl eax, 2
mov dword [ebp - 0x10], ecx
lea ecx, [esi - 1]
add ecx, ebx
mov dword [ebp - 0xc], ecx
pop ecx
sub ecx, eax
mov dword [ebp - 0x14], ecx
test ebx, ebx
je 0x1002e089
mov edi, dword [ebp - 0x10]
mov esi, ebx
mov ebx, ecx
mov dl, byte [edi]
mov cl, bl
shr dl, cl
mov ecx, dword [ebp - 0xc]
mov al, dl
and al, 0xf
shl dl, 4
xor al, dl
push 4
mov byte [ecx], al
dec ecx
mov dword [ebp - 0xc], ecx
lea eax, [edi - 1]
pop ecx
cmp ebx, ecx
cmovne eax, edi
mov edi, eax
xor eax, eax
cmp ebx, ecx
cmovne eax, ecx
mov ebx, eax
sub esi, 1
jne 0x1002df8b
jmp 0x1002e080
imul eax, ecx, 0x55
push 3
movzx eax, ax
mov dword [ebp - 4], eax
lea eax, [ebx - 1]
mov ecx, eax
shr ecx, 2
add ecx, esi
mov dword [ebp - 0x10], ecx
lea ecx, [esi - 1]
add ecx, ebx
mov dword [ebp - 0x18], ecx
pop ecx
and eax, ecx
sub ecx, eax
add ecx, ecx
mov dword [ebp - 0x14], ecx
test ebx, ebx
je 0x1002e08c
mov edi, dword [ebp - 0x10]
mov esi, dword [ebp - 0x18]
mov dword [ebp - 0xc], ebx
mov ebx, ecx
mov dl, byte [edi]
mov cl, bl
shr dl, cl
and dl, 3
mov al, dl
shl al, 2
or al, dl
shl al, 2
or al, dl
shl al, 2
or al, dl
mov byte [esi], al
cmp ebx, 6
jne 0x1002e026
xor ebx, ebx
dec edi
jmp 0x1002e029
add ebx, 2
dec esi
sub dword [ebp - 0xc], 1
jne 0x1002e000
jmp 0x1002e080
imul eax, ecx, 0xff
push 7
pop edx
movzx eax, ax
mov dword [ebp - 4], eax
lea eax, [ebx - 1]
mov ecx, eax
and eax, 7
shr ecx, 3
sub edx, eax
add ecx, esi
mov dword [ebp - 0x18], ecx
lea ecx, [esi - 1]
add ecx, ebx
test ebx, ebx
je 0x1002e089
mov edi, dword [ebp - 0x18]
mov esi, ecx
mov al, byte [edi]
mov cl, dl
shr al, cl
and al, 1
neg al
sbb al, al
mov byte [esi], al
cmp edx, 7
jne 0x1002e079
xor edx, edx
dec edi
jmp 0x1002e07a
inc edx
dec esi
sub ebx, 1
jne 0x1002e061
mov esi, dword [ebp + 0xc]
mov ebx, dword [ebp - 8]
mov edi, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
mov byte [edi + 9], 8
mov al, 8
mov byte [edi + 0xb], 8
mov dword [edi + 4], ebx
test edx, edx
je 0x1002e2a5
cmp al, 8
jne 0x1002e0d6
lea edx, [esi - 1]
lea esi, [esi + ebx*2]
add edx, ebx
dec esi
test ebx, ebx
je 0x1002e13e
mov edi, ebx
movzx eax, byte [edx]
sub ax, word [ebp - 4]
neg ax
sbb al, al
mov byte [esi], al
lea esi, [esi - 2]
mov al, byte [edx]
dec edx
mov byte [esi + 1], al
sub edi, 1
jne 0x1002e0b8
jmp 0x1002e13b
cmp al, 0x10
jne 0x1002e13e
mov eax, dword [edi + 4]
lea ecx, [eax - 1]
lea eax, [eax*2 - 1]
add ecx, esi
add eax, esi
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], eax
test ebx, ebx
je 0x1002e13e
mov eax, dword [ebp - 4]
mov edi, dword [ebp - 0x18]
movzx ecx, ax
mov dword [ebp - 0xc], ebx
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 0x10], ecx
movzx edx, byte [edi - 1]
movzx eax, byte [edi]
shl edx, 8
or edx, eax
sub edx, ecx
mov ecx, dword [ebp - 0x10]
neg edx
sbb dl, dl
sub dword [ebp - 0xc], 1
mov byte [ebx], dl
lea ebx, [ebx - 4]
mov byte [ebx + 3], dl
mov al, byte [edi]
lea edi, [edi - 2]
mov byte [ebx + 2], al
mov al, byte [edi + 1]
mov byte [ebx + 1], al
jne 0x1002e107
mov ebx, dword [ebp - 8]
mov edi, dword [ebp + 8]
push 4
pop eax
mov byte [edi + 8], al
mov al, byte [edi + 9]
mov byte [edi + 0xa], 2
add al, al
jmp 0x1002e296
cmp al, 2
jne 0x1002e2a5
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x1002e2a5
mov al, byte [edi + 9]
cmp al, 8
jne 0x1002e1d1
mov ecx, dword [ebp + 0xc]
lea edx, [ecx - 1]
add edx, dword [edi + 4]
lea ecx, [ecx + ebx*4]
dec ecx
test ebx, ebx
je 0x1002e288
mov dword [ebp - 8], ebx
movzx eax, byte [edx - 2]
cmp ax, word [esi + 2]
jne 0x1002e1a5
movzx eax, byte [edx - 1]
cmp ax, word [esi + 4]
jne 0x1002e1a5
movzx eax, byte [edx]
cmp ax, word [esi + 6]
jne 0x1002e1a5
xor al, al
jmp 0x1002e1a7
or al, 0xff
mov byte [ecx], al
or edi, 0xffffffff
mov al, byte [edx]
mov dword [ebp - 0xc], ecx
mov byte [edi + ecx], al
mov al, byte [edx - 1]
mov byte [ecx - 2], al
mov al, byte [edx - 2]
sub edx, 3
mov byte [ecx - 3], al
sub ecx, 4
sub dword [ebp - 8], 1
jne 0x1002e184
jmp 0x1002e285
cmp al, 0x10
jne 0x1002e288
mov ecx, dword [ebp + 0xc]
lea esi, [ecx - 1]
add esi, dword [edi + 4]
lea edx, [ecx - 1]
lea edx, [edx + ebx*8]
test ebx, ebx
je 0x1002e288
mov edi, dword [ebp + 0x10]
movzx ecx, byte [esi - 5]
movzx eax, byte [esi - 4]
shl ecx, 8
or ecx, eax
mov dword [ebp - 0x18], edx
movzx eax, word [edi + 2]
cmp ecx, eax
jne 0x1002e238
movzx ecx, byte [esi - 3]
movzx eax, byte [esi - 2]
shl ecx, 8
or ecx, eax
movzx eax, word [edi + 4]
cmp ecx, eax
jne 0x1002e238
movzx ecx, byte [esi - 1]
movzx eax, byte [esi]
shl ecx, 8
or ecx, eax
movzx eax, word [edi + 6]
cmp ecx, eax
jne 0x1002e238
xor al, al
jmp 0x1002e23a
or al, 0xff
mov edi, dword [ebp - 0x18]
dec edx
or dword [ebp - 0xc], 0xffffffff
mov ecx, edx
mov byte [edi], al
mov byte [edx], al
mov al, byte [esi]
mov edx, dword [ebp - 0xc]
mov edi, dword [ebp + 0x10]
mov byte [edx + ecx], al
add edx, ecx
mov al, byte [esi - 1]
mov byte [edx - 1], al
mov al, byte [esi - 2]
mov byte [edx - 2], al
mov al, byte [esi - 3]
mov byte [edx - 3], al
mov al, byte [esi - 4]
mov byte [edx - 4], al
mov al, byte [esi - 5]
sub esi, 6
mov byte [edx - 5], al
sub edx, 6
sub ebx, 1
jne 0x1002e1f3
mov ebx, dword [ebp - 8]
mov edi, dword [ebp + 8]
mov al, byte [edi + 9]
mov byte [edi + 8], 6
mov byte [edi + 0xa], 4
shl al, 2
mov byte [edi + 0xb], al
movzx eax, al
imul eax, ebx
shr eax, 3
mov dword [edi + 4], eax
pop edi
pop esi
pop ebx
leave
ret