Function at 0x10016393
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0x18
pop eax
call fcn.1005ead0
mov eax, dword [0x100a4120]
xor eax, dword [ebp + 4]
cmp dword [ebp + 0x1c], 1
mov ecx, dword [ebp + 0x18]
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push 0x10
mov edi, eax
mov dword [ebp + 0x10], ecx
pop ebx
jne 0x10016471
cmp eax, ebx
jb 0x10016410
shr eax, 4
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
sub ecx, eax
mov dword [ebp + 0x1c], ecx
mov ecx, esi
sub ecx, eax
mov dword [ebp + 0x10], ebx
mov edx, dword [ebp + 0x1c]
mov dl, byte [edx + eax]
xor dl, byte [eax]
mov byte [ecx + eax], dl
inc eax
dec dword [ebp + 0x10]
jne 0x100163e3
push dword [ebp + 0x14]
push esi
push esi
call sym.LIBEAY32.dll_AES_encrypt
add dword [ebp + 8], ebx
mov dword [ebp + 0x10], esi
add esp, 0xc
sub edi, ebx
add esi, ebx
dec dword [ebp - 8]
jne 0x100163d1
test edi, edi
je 0x10016502
jbe 0x1001643d
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
sub ecx, eax
mov dword [ebp + 0x1c], ecx
mov ecx, esi
sub ecx, eax
mov dword [ebp - 8], edi
mov edx, dword [ebp + 0x1c]
mov dl, byte [eax + edx]
xor dl, byte [eax]
mov byte [eax + ecx], dl
inc eax
dec dword [ebp - 8]
jne 0x1001642c
cmp edi, ebx
jae 0x1001645c
mov eax, dword [ebp + 0x10]
sub eax, esi
mov dword [ebp + 0x10], eax
mov eax, ebx
lea ecx, [edi + esi]
sub eax, edi
mov edx, dword [ebp + 0x10]
mov dl, byte [edx + ecx]
mov byte [ecx], dl
inc ecx
dec eax
jne 0x10016450
push dword [ebp + 0x14]
push esi
push esi
call sym.LIBEAY32.dll_AES_encrypt
add esp, 0xc
mov dword [ebp + 0x10], esi
jmp 0x10016502
cmp dword [ebp + 8], esi
je 0x1001650b
cmp eax, ebx
jb 0x100164ba
shr eax, 4
mov dword [ebp + 0x1c], eax
push dword [ebp + 0x14]
push esi
push dword [ebp + 8]
call sym.LIBEAY32.dll_AES_decrypt
mov ecx, dword [ebp + 0x10]
add esp, 0xc
mov eax, esi
sub ecx, esi
mov dword [ebp + 0x10], ebx
mov dl, byte [eax + ecx]
xor byte [eax], dl
inc eax
dec dword [ebp + 0x10]
jne 0x1001649d
mov eax, dword [ebp + 8]
add dword [ebp + 8], ebx
sub edi, ebx
add esi, ebx
dec dword [ebp + 0x1c]
mov dword [ebp + 0x10], eax
jne 0x10016484
test edi, edi
je 0x10016502
push dword [ebp + 0x14]
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 8]
call sym.LIBEAY32.dll_AES_decrypt
add esp, 0xc
xor ecx, ecx
test edi, edi
jbe 0x100164fc
mov edx, dword [ebp + 0x10]
lea eax, [ebp - 0x18]
sub edx, eax
lea eax, [ebp - 0x18]
mov dword [ebp + 0x10], edx
sub esi, eax
jmp 0x100164eb
mov edx, dword [ebp + 0x10]
lea eax, [ebp + ecx - 0x18]
mov dl, byte [edx + eax]
xor dl, byte [eax]
inc ecx
cmp ecx, edi
mov byte [esi + eax], dl
jb 0x100164e8
mov eax, dword [ebp + 8]
mov dword [ebp + 0x10], eax
push ebx
push dword [ebp + 0x10]
jmp 0x100165bf
cmp eax, ebx
jb 0x10016561
sub ecx, esi
shr eax, 4
mov dword [ebp + 0x10], ecx
mov dword [ebp + 0x1c], eax
push ebx
push dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
call sub.MSVCR70.dll_memcpy
push dword [ebp + 0x14]
push esi
push dword [ebp + 8]
call sym.LIBEAY32.dll_AES_decrypt
add esp, 0x18
mov eax, ebx
mov ecx, dword [ebp + 0x10]
mov cl, byte [ecx + esi]
xor byte [esi], cl
inc esi
dec eax
jne 0x10016538
push ebx
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 0x18]
call sub.MSVCR70.dll_memcpy
add dword [ebp + 8], ebx
sub dword [ebp + 0x10], ebx
add esp, 0xc
sub edi, ebx
dec dword [ebp + 0x1c]
jne 0x1001651a
test edi, edi
je 0x100165ca
push ebx
push dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
call sub.MSVCR70.dll_memcpy
push dword [ebp + 0x14]
lea eax, [ebp - 0x18]
push esi
push eax
call sym.LIBEAY32.dll_AES_decrypt
add esp, 0x18
test edi, edi
jbe 0x1001659b
mov ecx, dword [ebp + 0x18]
mov eax, esi
sub ecx, esi
mov dword [ebp + 0x10], edi
mov dl, byte [eax + ecx]
xor byte [eax], dl
inc eax
dec dword [ebp + 0x10]
jne 0x10016590
cmp edi, ebx
jae 0x100165ba
lea eax, [edi + esi]
lea esi, [ebp + edi - 0x18]
mov ecx, ebx
sub ecx, edi
mov edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push ebx
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 0x18]
call sub.MSVCR70.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 4]
xor ecx, dword [ebp + 4]
pop edi
pop esi
pop ebx
call fcn.1005eb3e
leave
ret