Function at 0x1000d840
Capabilities:
Encode data using xor

Disassembly:
push ebp
xor edx, edx
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
sub esp, 0x58
mov eax, dword [ebp + 0x10]
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0x18]
mov ecx, dword [eax]
mov ebx, dword [edi + 0x2c]
mov eax, ecx
div ebx
test esi, esi
je 0x1000d9d0
add eax, 1
imul eax, ebx
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x1000dbc5
cmp eax, dword [ebp + 0x14]
ja 0x1000d9ef
cmp ecx, eax
jae 0x1000dbd7
mov ebx, dword [ebp + 0xc]
mov edx, eax
mov esi, eax
sub edx, ecx
mov byte [ebx + ecx], dl
lea ebx, [ecx + 1]
mov dword [esp + 0x1c], ebx
cmp eax, ebx
jbe 0x1000dbd7
mov edx, dword [ebp + 0x10]
add ebx, dword [ebp + 0xc]
mov dword [esp + 0x20], ebx
add edx, 4
cmp ebx, edx
mov edx, dword [ebp + 0xc]
setae byte [esp + 0x24]
movzx ebx, byte [esp + 0x24]
add edx, eax
cmp dword [ebp + 0x10], edx
mov dword [esp + 0x24], edx
setae dl
or bl, dl
je 0x1000dbe9
mov edx, eax
sub edx, ecx
sub edx, 2
cmp edx, 0xe
jbe 0x1000dbe9
not ecx
movd xmm1, eax
mov edx, dword [esp + 0x20]
movdqu xmm5, xmmword [0x1002d1d0]
lea ebx, [ecx + eax]
mov ecx, dword [ebp + 0x10]
punpcklbw xmm1, xmm1
punpcklwd xmm1, xmm1
movd xmm7, dword [ecx]
mov ecx, ebx
pshufd xmm1, xmm1, 0
and ecx, 0xfffffff0
pshufd xmm2, xmm7, 0
add ecx, edx
movdqu xmm3, xmm2
punpckhwd xmm3, xmm2
punpcklwd xmm2, xmm2
movdqu xmm4, xmm2
punpckhwd xmm4, xmm3
nop
movdqu xmm0, xmm2
movdqu xmm6, xmm1
add edx, 0x10
punpcklwd xmm0, xmm3
punpcklwd xmm0, xmm4
pand xmm0, xmm5
packuswb xmm0, xmm0
psubb xmm6, xmm0
movups xmmword [edx - 0x10], xmm6
cmp edx, ecx
jne 0x1000d930
mov edx, dword [esp + 0x1c]
mov ecx, ebx
and ecx, 0xfffffff0
add edx, ecx
cmp ebx, ecx
je 0x1000d989
mov dword [ebp + 8], edi
mov ebx, esi
mov edi, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
lea esi, [esi]
mov ecx, ebx
sub cl, byte [edi]
mov byte [esi + edx], cl
add edx, 1
cmp eax, edx
ja 0x1000d978
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0x10]
mov dword [esi], eax
mov esi, dword [ebp + 0x20]
mov dword [esp + 0x18], 0
not esi
mov eax, dword [edi + 0x14]
cmp eax, 2
je 0x1000db80
cmp eax, 4
je 0x1000dac0
cmp eax, 1
je 0x1000da10
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0x80090008
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test edx, edx
je 0x1000d86b
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0x80090005
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [ebp + 0x10]
mov dword [esi], eax
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0xea
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [edi + 0x2c]
xor eax, eax
test edx, edx
je 0x1000da2f
mov edx, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x20]
nop
movzx ecx, byte [ebx + eax]
xor byte [edx + eax], cl
add eax, 1
cmp dword [edi + 0x2c], eax
ja 0x1000da20
mov eax, dword [ebp + 0xc]
lea ebx, [esp + 0x28]
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edi + 0xc]
mov dword [esp + 0x1c], ebx
mov dword [esp], eax
call sym._encrypt_block_impl
mov eax, dword [edi + 0x2c]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x20]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [edi + 0x2c]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [edi + 0x2c]
add dword [esp + 0x18], eax
add dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x10]
mov ebx, dword [esp + 0x18]
cmp dword [eax], ebx
ja 0x1000d99b
mov eax, 1
jmp 0x1000d9c4
mov eax, dword [edi + 0x2c]
lea ebx, [esp + 0x28]
mov dword [esp + 0x24], 0
mov dword [esp + 0x1c], ebx
test eax, eax
je 0x1000da7d
mov esi, esi
lea edi, [edi]
lea eax, [esp + 0x40]
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x20]
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 8], eax
mov eax, dword [edi + 0xc]
mov dword [esp], eax
call sym._encrypt_block_impl
mov ebx, dword [esp + 0x24]
mov eax, dword [ebp + 0xc]
mov edx, dword [esp + 0x1c]
movzx eax, byte [eax + ebx]
xor al, byte [esp + 0x40]
cmp dword [edi + 0x2c], 1
mov byte [esp + 0x20], al
mov byte [edx + ebx], al
je 0x1000dbc0
mov eax, dword [ebp + 0x20]
add eax, 1
nop
lea esi, [esi]
movzx edx, byte [eax]
mov ebx, eax
add eax, 1
mov byte [eax - 2], dl
mov ecx, dword [edi + 0x2c]
lea edx, [ecx - 1]
lea ecx, [esi + eax]
cmp edx, ecx
ja 0x1000db40
movzx eax, byte [esp + 0x20]
add dword [esp + 0x24], 1
mov byte [ebx], al
mov ebx, dword [esp + 0x24]
mov eax, dword [edi + 0x2c]
cmp eax, ebx
ja 0x1000dae0
jmp 0x1000da7d
lea eax, [esp + 0x28]
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 8], eax
mov eax, dword [edi + 0xc]
mov dword [esp], eax
call sym._encrypt_block_impl
mov eax, dword [edi + 0x2c]
jmp 0x1000da7d
mov ebx, dword [ebp + 0x20]
jmp 0x1000db58
mov esi, dword [ebp + 0x10]
mov dword [esi], eax
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [ebp + 0x10]
mov dword [esi], eax
test eax, eax
jne 0x1000d98e
jmp 0x1000daad
mov edx, dword [esp + 0x20]
mov ecx, esi
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x20], eax
mov esi, dword [ebp + 0x10]
lea esi, [esi]
mov eax, ecx
sub al, byte [esi]
add edx, 1
mov byte [edx - 1], al
cmp edx, ebx
jne 0x1000dc00
mov eax, dword [esp + 0x20]
jmp 0x1000d989