Function at 0x10165eb0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x20
cmp dword [esp + 0x24], 0
push ebx
push ebp
push esi
push edi
mov edi, eax
mov ebx, ecx
mov esi, edx
jl 0x1016627f
mov eax, dword [esi + 0x28]
mov edx, dword [eax + 0x40]
lea ebp, [esi + 0x28]
mov ecx, ebp
call edx
sub eax, 0x20
cmp dword [esp + 0x34], eax
jg 0x1016627f
test ebx, ebx
jl 0x10166259
mov eax, dword [ebp]
mov edx, dword [eax + 0x3c]
mov ecx, ebp
call edx
shl eax, 5
sub eax, 0x20
cmp ebx, eax
jg 0x10166259
mov eax, dword [ebp]
mov edx, dword [eax + 0x3c]
mov esi, dword [esi + 0x10]
mov ecx, ebp
call edx
imul eax, dword [esp + 0x34]
mov edx, dword [ebp]
mov ecx, ebx
sar ecx, 5
add eax, ecx
lea esi, [esi + eax*4]
mov eax, dword [edx + 0x3c]
and ebx, 0x1f
mov ecx, ebp
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x18], 0
call eax
test ebx, ebx
mov ebp, eax
mov dword [esp + 0x28], ebp
jbe 0x10166106
mov ecx, 0x20
sub ecx, ebx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x20], 8
jmp 0x10165f68
mov ebx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x34]
mov edx, dword [esi + 4]
shl edx, cl
mov eax, dword [esi]
mov ecx, ebx
shr eax, cl
mov ecx, dword [esp + 0x34]
add edi, 8
or edx, eax
mov eax, dword [esi + ebp*4 + 4]
xor edx, dword [edi - 8]
shl eax, cl
mov ecx, ebx
mov ebx, dword [esi + ebp*4]
shr ebx, cl
lea ecx, [ebp*8]
add esi, ecx
mov ecx, dword [esi + 4]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x34]
shl dword [esp + 0x14], cl
mov ecx, dword [esp + 0x1c]
or eax, ebx
mov ebx, dword [esi]
xor eax, dword [edi - 4]
shr ebx, cl
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x24], edx
or ecx, ebx
mov ebx, dword [esi + ebp*4 + 4]
xor ecx, dword [edi]
mov ebp, dword [esi + ebp*4]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x34]
shl ebx, cl
mov ecx, dword [esp + 0x1c]
shr ebp, cl
or ebx, ebp
xor ebx, dword [edi + 4]
mov edx, ebx
shr edx, 0x10
movzx ebp, dl
movzx ebp, byte [ebp + 0x1021e308]
mov ecx, ebx
shr ecx, 0x18
movzx ecx, byte [ecx + 0x1021e308]
add ecx, ebp
mov ebp, dword [esp + 0x14]
shr ebp, 0x18
movzx ebp, byte [ebp + 0x1021e308]
add ecx, ebp
mov edx, ebx
shr edx, 8
movzx ebp, dl
movzx ebp, byte [ebp + 0x1021e308]
mov edx, dword [esp + 0x14]
add ecx, ebp
shr edx, 0x10
movzx ebp, dl
movzx ebp, byte [ebp + 0x1021e308]
mov edx, dword [esp + 0x14]
add ecx, ebp
shr edx, 8
movzx ebp, dl
movzx ebp, byte [ebp + 0x1021e308]
add ecx, ebp
mov ebp, eax
shr ebp, 0x18
movzx ebp, byte [ebp + 0x1021e308]
add ecx, ebp
mov edx, eax
shr edx, 0x10
movzx ebp, dl
movzx ebp, byte [ebp + 0x1021e308]
mov edx, dword [esp + 0x24]
add ecx, ebp
mov ebp, edx
shr ebp, 0x18
movzx ebp, byte [ebp + 0x1021e308]
add ecx, ebp
mov dword [esp + 0x24], eax
shr eax, 8
movzx ebp, al
movzx ebp, byte [ebp + 0x1021e308]
add ecx, ebp
mov eax, edx
shr eax, 0x10
movzx ebp, al
movzx ebp, byte [ebp + 0x1021e308]
add ecx, ebp
mov eax, edx
shr eax, 8
movzx ebp, al
movzx ebp, byte [ebp + 0x1021e308]
mov eax, dword [esp + 0x24]
movzx ebx, bl
movzx ebx, byte [ebx + 0x1021e308]
add ecx, ebp
mov ebp, dword [esp + 0x28]
add ecx, ebx
movzx ebx, byte [esp + 0x14]
movzx ebx, byte [ebx + 0x1021e308]
movzx eax, al
movzx eax, byte [eax + 0x1021e308]
add ecx, ebx
add ecx, eax
movzx edx, dl
movzx eax, byte [edx + 0x1021e308]
add eax, dword [esp + 0x18]
add edi, 8
add eax, ecx
lea ecx, [ebp*8]
add esi, ecx
sub dword [esp + 0x20], 1
mov dword [esp + 0x18], eax
jne 0x10165f60
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
lea edx, [ebp*8]
mov dword [esp + 0x1c], 8
mov ecx, dword [esi + ebp*4]
xor ecx, dword [edi + 4]
mov eax, dword [edi]
xor eax, dword [esi]
add esi, edx
mov edx, dword [edi + 8]
xor edx, dword [esi]
add edi, 8
mov dword [esp + 0x34], edx
mov edx, dword [esi + ebp*4]
xor edx, dword [edi + 4]
mov ebx, edx
mov dword [esp + 0x20], edx
shr edx, 0x10
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
shr ebx, 0x18
movzx ebx, byte [ebx + 0x1021e308]
add ebx, edx
mov edx, dword [esp + 0x34]
shr edx, 0x18
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, dword [esp + 0x20]
shr edx, 8
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, dword [esp + 0x34]
shr edx, 0x10
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, dword [esp + 0x34]
shr edx, 8
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, ecx
shr edx, 0x18
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, ecx
shr edx, 0x10
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, eax
shr edx, 0x18
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, ecx
shr edx, 8
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, eax
shr edx, 0x10
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
mov edx, eax
shr edx, 8
movzx edx, dl
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
movzx edx, byte [esp + 0x20]
movzx edx, byte [edx + 0x1021e308]
add ebx, edx
movzx edx, byte [esp + 0x34]
movzx edx, byte [edx + 0x1021e308]
movzx ecx, cl
add ebx, edx
movzx edx, byte [ecx + 0x1021e308]
movzx eax, al
movzx ecx, byte [eax + 0x1021e308]
add ebx, edx
add ecx, dword [esp + 0x18]
lea edx, [ebp*8]
lea eax, [ecx + ebx]
mov dword [esp + 0x18], eax
add esi, edx
add edi, 8
sub dword [esp + 0x1c], 1
jne 0x10166115
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
push ebx
push str.uint32_vfh_BitImgCue::err32__int32_xA__int32_yA__const_uint32_patchA___const
push str._s:xA___i__is_out_of_range
lea eax, [esp + 0x34]
call fcn.100595b0
add esp, 0xc
push 0x102051a0
lea edx, [esp + 0x2c]
push edx
call fcn.1017d044
mov eax, dword [esp + 0x34]
push eax
push str.uint32_vfh_BitImgCue::err32__int32_xA__int32_yA__const_uint32_patchA___const
push str._s:yA___i__is_out_of_range
lea eax, [esp + 0x34]
call fcn.100595b0
add esp, 0xc
push 0x102051a0
lea ecx, [esp + 0x2c]
push ecx
call fcn.1017d044
int3