Function at 0x10001690
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
movzx eax, word [0x1016513c]
xor edx, edx
mov dword [esp], eax
push ebx
push ebp
mov ebp, dword [esp + 0x20]
push esi
mov esi, dword [0x10165138]
mov eax, esi
or eax, dword [0x10165144]
mov dword [esp + 0x10], eax
lea ecx, [ebp*2]
mov eax, dword [esp + 0x30]
add ecx, ebp
push edi
mov ebx, dword [esp + 0x44]
mov dword [esp + 0x20], esi
mov edi, dword [eax + ecx*4]
mov eax, dword [0x10165148]
mov ecx, dword [0x101650f8]
mov dword [esp + 0x18], eax
inc ecx
mov eax, dword [0x1016512c]
mov dword [0x101650f8], ecx
or edi, dword [0x10165144]
mov eax, dword [eax + esi*8]
div ecx
mov eax, dword [0x1016510c]
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x34], eax
movzx eax, byte [0x10165101]
and eax, 0x174a
mov dword [esp + 0x1c], edx
mov dword [esp + 0x28], eax
mov eax, 0x2ce1f4b1
mul ebx
mov eax, 0xf2b9d649
sub ebx, edx
shr ebx, 1
add ebx, edx
mul dword [ecx + 0x3120]
mov ecx, dword [0x10165128]
mov eax, edx
shr ebx, 0xc
shr eax, 7
dec ecx
mov dword [esp + 0x4c], eax
mov eax, dword [0x10165120]
mov dword [esp + 0x44], ebx
mov eax, dword [eax + ebp*4 - 4]
mov dword [0x10165128], ecx
movzx ecx, byte [ecx + esi + 0xc]
cmp eax, ecx
jge 0x10001785
nop
mov ecx, 0x1203
sub ecx, dword [0x1016514c]
mov dword [edi + eax*4], ecx
inc eax
mov ecx, dword [0x10165128]
dec ecx
mov dword [0x10165128], ecx
movzx ecx, byte [esi + ecx + 0xc]
cmp eax, ecx
jl 0x10001760
mov eax, dword [0x1016510c]
add dword [0x10165114], eax
inc byte [ebx]
movzx edx, byte [ebx]
mov eax, dword [esp + 0x2c]
mov ecx, dword [0x101650f8]
lea esi, [eax + edx*2]
shl edx, 4
lea eax, [ebx + ecx*2]
movzx eax, byte [ecx + eax]
mov ecx, 0xe3f
sub eax, dword [edx + 0x1939]
cdq
idiv ecx
movzx eax, byte [esp + 0x40]
movzx ecx, word [esi]
sub edx, eax
mov eax, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x10]
mov word [esi], dx
mov edx, dword [0x10165128]
mov eax, dword [edi + edx*4 + 0x14]
mov edi, dword [esp + 0x34]
mov dword [0x10165114], eax
movzx eax, byte [ebx]
movzx eax, word [ecx + eax*4 + 8]
mov ecx, dword [esp + 0x14]
sub ecx, eax
sub ecx, dword [0x1016511c]
dec ecx
mov dword [0x1016511c], ecx
movzx eax, byte [ebx]
mov edi, dword [edi + eax*4 + 0x28]
movzx eax, byte [ebx + 0xf7]
cmp edi, eax
je 0x100018e4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x48]
add ecx, 0x26
lea eax, [eax + ebp*2]
add eax, 6
add ebx, 0x64
lea ecx, [ecx + ebp*2]
mov dword [esp + 0x40], eax
mov ebp, dword [esp + 0x38]
mov dword [esp + 0x34], ecx
lea ebx, [ebx + edi*8]
nop
mov eax, dword [0x10165108]
inc ebp
cdq
idiv ebp
mov eax, dword [0x101650f8]
mov esi, dword [esp + 0x4c]
or edx, dword [esi + eax*4 + 4]
mov dword [ebx], edx
inc dword [0x101650f8]
mov al, byte [0x1016511c]
mov byte [ecx], al
mov eax, dword [0x101650fc]
mov esi, dword [0x10165138]
add eax, edi
push eax
movzx eax, byte [0x10165100]
dec esi
xor eax, 0xf0f
mov dword [0x10165138], esi
push eax
mov eax, dword [esp + 0x24]
movzx ecx, byte [edi + eax]
mov eax, dword [esp + 0x48]
movzx eax, word [eax]
or ecx, eax
mov eax, 0x892
cdq
idiv esi
push ecx
push eax
push 0
call fcn.10005010
mov ecx, dword [esp + 0x58]
lea ebx, [ebx + 8]
mov edx, dword [esp + 0x34]
inc edi
add esp, 0x14
movzx eax, byte [ecx]
movzx eax, byte [eax + edx]
imul eax, eax, 0x1ac1
add dword [0x10165110], eax
movzx eax, byte [ecx + 0xf7]
mov ecx, dword [esp + 0x34]
cmp edi, eax
jne 0x10001840
mov edx, dword [0x10165128]
mov ecx, dword [0x10165140]
mov eax, dword [esp + 0x28]
dec ecx
pop edi
pop esi
mov dword [0x10165140], ecx
movzx eax, byte [eax + edx*2]
pop ebp
xor eax, ecx
pop ebx
add esp, 0x14
ret