Function at 0x10002db0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x28
mov eax, dword [esp + 0x3c]
push ebx
push ebp
movzx ebp, word [esp + 0x5c]
mov ebx, 0xa87
mov edx, dword [0x10165128]
push esi
push edi
lea eax, [eax + ebp*2]
movzx esi, byte [eax + ebp + 7]
lea ecx, [ebp*2]
mov eax, dword [esp + 0x3c]
add ecx, ebp
shl ecx, 2
mov dword [esp + 0x28], ecx
xor esi, dword [eax + 0x824]
mov eax, dword [0x10165150]
mov dword [esp + 0x24], esi
imul eax, dword [ecx + eax], 0x737
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x18], eax
mov eax, dword [0x10165124]
movzx eax, byte [eax + ecx]
mov ecx, dword [0x10165154]
sub ebx, eax
mov dword [esp + 0x10], ebx
mov eax, dword [ecx + edx*4]
inc edx
add eax, dword [0x1016514c]
mov dword [esp + 0x20], eax
mov eax, dword [0x10165114]
sub eax, dword [0x10165144]
mov dword [esp + 0x1c], eax
mov al, byte [0x10165100]
movzx edi, al
dec al
mov byte [0x10165100], al
mov eax, dword [0x101650fc]
mov dword [esp + 0x30], edi
mov edi, dword [esp + 0x58]
mov eax, dword [edi + eax*4]
mov dword [esp + 0x3c], eax
mov eax, dword [ecx + 0x29b0]
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x34], eax
mov eax, dword [0x101650f8]
mov eax, dword [ecx + eax*4]
mov ecx, dword [0x101650f4]
mov dword [esp + 0x2c], eax
mov eax, dword [0x1016512c]
mov dword [0x10165128], edx
mov edi, dword [eax + edx*8]
mov eax, dword [esp + 0x68]
or edi, edx
mov dword [esp + 0x14], edi
mov eax, dword [eax + 0x7254]
add eax, 0x11ec
mov dword [esp + 0x48], eax
cmp ecx, 0x9c8
jg 0x10002f1a
mov eax, dword [esp + 0x44]
mov edi, dword [esp + 0x1c]
lea ebx, [eax + ebx*2]
nop dword [eax]
nop dword [eax + eax]
movzx eax, byte [0x10165101]
mov edx, dword [esp + 0x20]
movzx eax, byte [eax + esi]
movzx esi, byte [edx + 0x2e7]
xor edx, edx
div esi
cdq
idiv ebp
cdq
idiv dword [esp + 0x40]
mov eax, edx
xor edx, edx
div dword [0x1016511c]
mov dword [0x1016511c], eax
mov eax, ecx
xor word [ebx], di
inc ecx
movzx esi, byte [0x10165100]
cdq
idiv esi
mov esi, dword [esp + 0x24]
mov byte [0x10165100], al
cmp ecx, 0x9c8
jle 0x10002ec0
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov eax, dword [0x10165138]
mov ecx, dword [0x10165104]
mov esi, dword [esp + 0x28]
add esi, dword [esp + 0x58]
lea ecx, [ecx + eax*4]
mov eax, 0xe4f
cdq
idiv dword [ecx]
xor edx, edx
mov dword [ecx], eax
lea eax, [ebx + ebx*2]
mov al, byte [edi + eax*2 + 6]
mov cl, byte [0x10165101]
sub al, 0x54
xor cl, al
mov byte [0x10165101], cl
movzx eax, cl
div dword [esi]
mov ecx, dword [esp + 0x3c]
mov dword [esi], eax
mov eax, dword [0x10165148]
mov edx, dword [esp + 0x40]
inc eax
mov dword [0x10165148], eax
movzx ebx, word [ecx + eax*2]
movzx eax, word [edi + ebp*2]
mov edi, 0x729
mov ecx, dword [esp + 0x18]
add ebx, eax
mov eax, dword [0x101650f8]
mov ebp, dword [esp + 0x50]
add eax, eax
sub edi, dword [ecx + eax*8]
lea eax, [edx*2]
movzx ecx, word [esp + 0x64]
add eax, ebp
movzx esi, byte [edx + eax]
dec edx
mov eax, dword [0x10165150]
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0x4c]
add esi, dword [eax + ecx*4]
mov eax, dword [0x101650f4]
inc eax
mov dword [0x101650f4], eax
movzx ecx, byte [ecx + edx]
xor edx, edx
div ecx
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x2c]
inc word [eax]
mov ax, word [eax]
movzx eax, ax
movzx eax, word [ecx + eax*2]
mov ecx, dword [0x101650fc]
sub ecx, eax
push ecx
push edx
push esi
push edi
push ebx
push dword [esp + 0x24]
call fcn.100020e0
mov ecx, dword [0x10165138]
mov ebx, dword [esp + 0x2c]
movzx esi, word [esp + 0x7c]
mov edi, dword [esp + 0x58]
mov word [ebx + ecx*8], ax
mov ecx, dword [esp + 0x48]
mov eax, dword [0x10165150]
movzx edx, byte [esi + ebp + 4]
mov ecx, dword [ecx]
sub edx, dword [eax + ecx*4]
sub edx, dword [0x1016514c]
mov ecx, dword [esp + 0x54]
add edx, edi
mov eax, dword [0x10165108]
mov dword [0x1016514c], edx
movzx edx, word [ecx + esi*2]
mov ecx, eax
dec eax
mov dword [0x10165108], eax
mov eax, dword [esp + 0x60]
mov eax, dword [eax + esi*8]
inc dword [0x10165148]
push eax
push ecx
push edx
call fcn.10001910
mov ecx, dword [0x10165148]
add esp, 0x24
mov edx, dword [esp + 0x48]
mov byte [ecx + ebp], al
mov eax, dword [0x10165134]
movzx eax, byte [eax + 0x816]
cmp dword [0x1016511c], eax
jae 0x1000309f
mov eax, dword [0x10165110]
lea ecx, [eax + eax*2]
mov eax, dword [esp + 0x34]
mov eax, dword [eax + edi*4]
cmp eax, dword [edx + ecx*4]
je 0x1000309f
inc word [ebx]
movzx eax, word [ebx]
mov ecx, dword [esp + 0x4c]
movzx eax, byte [ecx + eax*2]
cmp eax, dword [0x10165118]
jle 0x100030bf
movzx eax, word [ebx]
mov ecx, 0xd17
and word [ebx + eax*2], cx
mov eax, dword [0x10165110]
lea ecx, [edx + eax*8]
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 0x7560]
add dword [ecx], eax
pop edi
pop esi
mov eax, 0x7b5
sub eax, dword [esp + 0x14]
pop ebp
pop ebx
add esp, 0x28
ret