Function at 0x10164c50
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [esp + 0x10]
push ebp
push esi
test ebx, ebx
push edi
je 0x10165098
mov ebp, dword [esp + 0x14]
mov ecx, dword [ebp + 0x14]
lea eax, [ecx + ebx*8]
cmp eax, ecx
jae 0x10164c71
inc dword [ebp + 0x18]
mov edx, dword [ebp + 0x18]
mov ecx, ebx
shr ecx, 0x1d
mov dword [ebp + 0x14], eax
mov eax, dword [ebp + 0x5c]
add edx, ecx
test eax, eax
mov dword [ebp + 0x18], edx
je 0x10164f0e
mov edi, eax
mov ecx, eax
add eax, ebx
lea edx, [ebp + 0x1c]
sar edi, 2
and ecx, 3
cmp eax, 0x40
mov dword [esp + 0x1c], edx
jb 0x10164d98
mov eax, dword [edx + edi*4]
cmp ecx, 3
ja case.default.0x10164cb0
jmp dword [ecx*4 + 0x101650a0]
mov esi, dword [esp + 0x18]
xor eax, eax
xor ecx, ecx
mov al, byte [esi]
mov cl, byte [esi + 1]
shl eax, 0x18
inc esi
shl ecx, 0x10
or eax, ecx
inc esi
xor ecx, ecx
mov ch, byte [esi]
or eax, ecx
inc esi
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x10164d21
mov esi, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [esi]
shl ecx, 0x10
or eax, ecx
inc esi
xor ecx, ecx
mov ch, byte [esi]
or eax, ecx
inc esi
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x10164d21
mov esi, dword [esp + 0x18]
xor ecx, ecx
mov ch, byte [esi]
or eax, ecx
inc esi
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x10164d21
mov esi, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x10164d21
mov esi, dword [esp + 0x18]
mov dword [edx + edi*4], eax
inc edi
cmp edi, 0x10
jge 0x10164d79
mov eax, 0x10
lea ecx, [edx + edi*4]
sub eax, edi
mov dword [esp + 0x18], eax
xor eax, eax
xor edx, edx
mov al, byte [esi]
mov dl, byte [esi + 1]
xor eax, esi
add ecx, 4
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [ecx - 4], eax
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x18], eax
jne 0x10164d38
mov edx, dword [esp + 0x1c]
mov eax, dword [ebp + 0x5c]
push 0x40
push edx
push ebp
lea ebx, [ebx + eax - 0x40]
call fcn.10161c90
add esp, 0xc
mov dword [ebp + 0x5c], 0
jmp 0x10164f12
lea esi, [ecx + ebx]
mov dword [ebp + 0x5c], eax
cmp esi, 4
jae 0x10164e03
mov esi, dword [edx + edi*4]
sub ecx, 0
je 0x10164db9
dec ecx
je 0x10164dcd
dec ecx
je 0x10164df0
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebp, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [ebp]
mov esi, ecx
shl esi, 0x18
inc ebp
dec ebx
je 0x10164dfb
jmp 0x10164dd1
mov ebp, dword [esp + 0x18]
xor eax, eax
mov al, byte [ebp]
shl eax, 0x10
or esi, eax
inc ebp
dec ebx
test ebx, ebx
je 0x10164dfb
xor ecx, ecx
mov ch, byte [ebp]
or esi, ecx
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebp, dword [esp + 0x18]
xor ecx, ecx
mov ch, byte [ebp]
or esi, ecx
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebp, dword [edx + edi*4]
mov esi, eax
and eax, 3
sar esi, 2
mov ebx, eax
cmp ecx, 3
mov dword [esp + 0x1c], ebx
ja case.default.0x10164e19
jmp dword [ecx*4 + 0x101650b0]
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
mov ebp, ecx
xor ecx, ecx
mov cl, byte [eax + 1]
shl ebp, 0x18
inc eax
shl ecx, 0x10
or ebp, ecx
inc eax
xor ecx, ecx
mov ch, byte [eax]
or ebp, ecx
inc eax
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x10164e8c
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
shl ecx, 0x10
or ebp, ecx
inc eax
xor ecx, ecx
mov ch, byte [eax]
or ebp, ecx
inc eax
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x10164e8c
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov ch, byte [eax]
or ebp, ecx
inc eax
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x10164e8c
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x10164e8c
mov eax, dword [esp + 0x18]
mov dword [edx + edi*4], ebp
inc edi
cmp edi, esi
jge 0x10164ed4
sub esi, edi
lea ebp, [edx + edi*4]
add edi, esi
xor ecx, ecx
xor ebx, ebx
mov cl, byte [eax]
mov bl, byte [eax + 1]
xor ecx, eax
add ebp, 4
shl ecx, 0x18
inc eax
xor ebx, eax
shl ebx, 0x10
or ecx, ebx
inc eax
xor ebx, ebx
mov bl, byte [eax]
xor ebx, eax
shl ebx, 8
or ecx, ebx
inc eax
xor ebx, ebx
mov bl, byte [eax]
xor ebx, eax
or ecx, ebx
inc eax
mov dword [ebp - 4], ecx
dec esi
jne 0x10164e9b
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x10165098
mov ecx, ebx
xor esi, esi
add eax, ebx
dec ecx
je 0x10164efc
dec ecx
je 0x10164ef2
dec ecx
jne 0x10164f06
dec eax
xor ecx, ecx
mov ch, byte [eax]
mov esi, ecx
dec eax
xor ecx, ecx
mov cl, byte [eax]
shl ecx, 0x10
or esi, ecx
xor ecx, ecx
mov cl, byte [eax - 1]
shl ecx, 0x18
or esi, ecx
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov esi, dword [esp + 0x18]
cmp ebx, 0x40
lea edi, [ebp + 0x1c]
jb 0x1016501c
mov eax, ebx
shr eax, 6
mov dword [esp + 0x18], eax
mov ecx, 4
xor eax, eax
xor edx, edx
mov al, byte [esi]
mov dl, byte [esi + 1]
xor eax, esi
add edi, 4
shl eax, 0x18
inc esi
add edi, 4
xor edx, esi
add edi, 4
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 0xc], eax
xor eax, eax
mov al, byte [esi]
xor edx, edx
mov dl, byte [esi + 1]
xor eax, esi
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 8], eax
xor eax, eax
mov al, byte [esi]
xor edx, edx
mov dl, byte [esi + 1]
xor eax, esi
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 4], eax
xor eax, eax
mov al, byte [esi]
xor edx, edx
mov dl, byte [esi + 1]
xor eax, esi
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
add edi, 4
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 4], eax
dec ecx
jne 0x10164f2c
lea edi, [ebp + 0x1c]
push 0x40
push edi
push ebp
call fcn.10161c90
mov eax, dword [esp + 0x24]
add esp, 0xc
sub ebx, 0x40
dec eax
mov dword [esp + 0x18], eax
jne 0x10164f27
mov eax, ebx
mov dword [ebp + 0x5c], ebx
sar eax, 2
and ebx, 3
xor edx, edx
test eax, eax
jle 0x1016506e
mov ecx, edi
mov ebp, eax
mov dword [esp + 0x18], eax
xor eax, eax
xor edx, edx
mov al, byte [esi]
mov dl, byte [esi + 1]
xor eax, esi
add ecx, 4
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [ecx - 4], eax
dec ebp
jne 0x10165035
mov edx, dword [esp + 0x18]
mov ecx, ebx
xor eax, eax
add esi, ebx
dec ecx
je 0x1016508b
dec ecx
je 0x10165081
dec ecx
jne 0x10165095
mov ah, byte [esi - 1]
dec esi
dec esi
xor ecx, ecx
mov cl, byte [esi]
shl ecx, 0x10
or eax, ecx
xor ecx, ecx
mov cl, byte [esi - 1]
shl ecx, 0x18
or eax, ecx
mov dword [edi + edx*4], eax
pop edi
pop esi
pop ebp
pop ebx
ret