Function at 0x140107160
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
mov rax, rsp
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x80]
sub rsp, 0x180
movaps xmmword [rax - 0x38], xmm6
mov rax, qword [0x1405921c0]
xor rax, rsp
mov qword [rbp + 0x60], rax
mov r14, rcx
xor edi, edi
cmp qword [rcx + 0x28], 0xffffffffffffffff
jne 0x1401071b3
add rcx, 0x50
lea edx, [rdi - 1]
call fcn.140104070
jmp 0x14010772c
movzx eax, word [rcx + 0xa4]
test ax, ax
jne 0x140107225
xorps xmm0, xmm0
movups xmmword [rbp + 0x40], xmm0
mov qword [rbp + 0x50], rdi
mov qword [rbp + 0x58], rdi
mov ecx, 0x30
call fcn.1400c9d40
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x50], 0x24
mov qword [rbp + 0x58], 0x2f
movups xmm0, xmmword [str.Feature_report_length_is_invalid__0_]
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14029d300]
movups xmmword [rax + 0x10], xmm1
mov ecx, dword [0x14029d310]
mov dword [rax + 0x20], ecx
mov byte [rax + 0x24], dil
lea r8, [rbp + 0x40]
mov edx, 0xfffffff4
lea rcx, [r14 + 0x50]
call fcn.140103fd0
jmp 0x14010772c
mov dword [rcx + 0xa0], edi
mov rcx, rax
call fcn.1400ca4ec
mov r15, rax
movzx r8d, word [r14 + 0xa4]
xor edx, edx
mov rcx, rax
call fcn.140279e10
mov r12d, edi
movzx esi, di
mov word [rsp + 0x20], di
lea rbx, [r14 + 0x30]
mov rcx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x140107264
mov rcx, qword [rbx]
lea rdx, [0x14029d318]
call fcn.1400d9bc4
mov r13, rax
test rax, rax
jne 0x1401072ef
lea rcx, [rsp + 0x50]
call fcn.140006e00
nop
lea rdx, [0x14029d268]
lea rcx, [rsp + 0x50]
call fcn.14000a250
mov r8, qword [rbx + 0x10]
cmp qword [rbx + 0x18], 0xf
jbe 0x1401072a2
mov rbx, qword [rbx]
mov rdx, rbx
mov rcx, rax
call fcn.14000c830
mov rcx, rax
lea rdx, str._._File_must_be_writable.
call fcn.14000a250
lea rdx, [rsp + 0x28]
lea rcx, [rsp + 0x58]
call fcn.140008e10
lea r8, [rsp + 0x28]
mov edx, 0xfffffffd
lea rcx, [r14 + 0x50]
call fcn.140103fd0
mov edi, eax
lea rcx, [rsp + 0x50]
call fcn.140004d60
jmp 0x1401073a3
lea r9, [rsp + 0x20]
movzx r8d, word [r14 + 0xa4]
mov rdx, r15
mov rcx, r14
call fcn.140106590
mov edi, eax
test eax, eax
jne 0x14010739e
movzx r12d, byte [r15 + 0xd]
shl r12d, 8
movzx eax, byte [r15 + 0xc]
add r12d, eax
shl r12d, 8
movzx eax, byte [r15 + 0xb]
add r12d, eax
shl r12d, 8
movzx eax, byte [r15 + 0xa]
add r12d, eax
jne 0x14010739e
xorps xmm0, xmm0
movups xmmword [rbp + 0x40], xmm0
xor eax, eax
mov qword [rbp + 0x50], rax
mov qword [rbp + 0x58], rax
lea ecx, [rdi + 0x30]
call fcn.1400c9d40
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x50], 0x21
mov qword [rbp + 0x58], 0x2f
movups xmm0, xmmword [str.Device_reports_DFU_length_of_zero]
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14029d290]
movups xmmword [rax + 0x10], xmm1
movzx ecx, byte [0x14029d2a0]
mov byte [rax + 0x20], cl
mov byte [rax + 0x21], sil
lea r8, [rbp + 0x40]
lea edx, [rdi - 0x14]
lea rcx, [r14 + 0x50]
call fcn.140103fd0
mov edi, eax
movzx esi, word [rsp + 0x20]
mov dword [rbp + 0x40], r12d
mov ebx, 0xffffffff
test edi, edi
jne 0x1401076f1
movzx r8d, si
xor edx, edx
lea r9, [0x14029e5e0]
test r8, r8
je 0x1401073ec
nop word [rax + rax]
movzx ecx, byte [rdx + r15]
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [r9 + rax*4]
inc rdx
cmp rdx, r8
jb 0x1401073d0
movzx r8d, si
mov r9, r13
mov edx, 1
mov rcx, r15
call fcn.1400dd204
movzx ecx, si
cmp rax, rcx
je 0x140107422
lea rcx, [r14 + 0x50]
mov edx, 0xfffffffc
call fcn.140104070
mov edi, eax
test eax, eax
jne 0x1401076f1
jmp 0x140107428
movzx eax, si
sub r12d, eax
movsd xmm6, qword [0x1405236e8]
test r12d, r12d
je 0x140107544
mov rax, qword [r14 + 8]
cmp byte [rax + 0x32], 0
je 0x140107544
mov eax, r12d
xorps xmm1, xmm1
cvtsi2sd xmm1, rax
mov eax, dword [rbp + 0x40]
xorps xmm0, xmm0
cvtsi2sd xmm0, rax
divsd xmm1, xmm0
mulsd xmm1, xmm6
movaps xmm0, xmm6
subsd xmm0, xmm1
cvttsd2si edi, xmm0
movzx esi, dil
mov rcx, qword [r14 + 0x90]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, 0x64
cmp dil, al
cmovb eax, esi
mov byte [r14 + 0x10], al
mov rcx, qword [r14 + 0x90]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea r9, [rsp + 0x20]
movzx r8d, word [r14 + 0xa4]
mov rdx, r15
mov rcx, r14
call fcn.140106590
mov edi, eax
test eax, eax
jne 0x1401076f1
movzx esi, word [rsp + 0x20]
mov r8d, esi
xor edx, edx
test rsi, rsi
je 0x140107500
lea rsi, [0x14029e5e0]
nop word [rax + rax]
movzx ecx, byte [rdx + r15]
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rsi + rax*4]
inc rdx
cmp rdx, r8
jb 0x1401074e0
movzx esi, word [rsp + 0x20]
movzx r8d, si
mov r9, r13
mov edx, 1
mov rcx, r15
call fcn.1400dd204
movzx ecx, si
cmp rax, rcx
je 0x140107539
lea rcx, [r14 + 0x50]
mov edx, 0xfffffffc
call fcn.140104070
mov edi, eax
test eax, eax
je 0x140107430
jmp 0x1401076f1
movzx eax, si
sub r12d, eax
jmp 0x140107430
test edi, edi
jne 0x1401076f1
mov rax, qword [r14 + 8]
cmp byte [rax + 0x32], dil
je 0x1401076f1
movups xmm1, xmmword [0x14029e9e0]
movups xmmword [rbp + 0x40], xmm1
movd eax, xmm1
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
lea rdx, [0x14029e5e0]
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 1
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 2
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 3
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 4
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 5
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 6
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 7
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 8
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 9
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
movdqa xmm0, xmm1
psrldq xmm0, 0xa
movd eax, xmm0
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
psrldq xmm1, 0xb
movd eax, xmm1
movzx ecx, al
mov eax, ebx
xor rcx, rax
movzx eax, cl
shr ebx, 8
xor ebx, dword [rdx + rax*4]
mov dword [rbp + 0x4c], ebx
mov r9, r13
lea edx, [rdi + 1]
lea r8d, [rdi + 0x10]
lea rcx, [rbp + 0x40]
call fcn.1400dd204
cmp rax, 0x10
je 0x1401076f1
lea rcx, [r14 + 0x50]
lea edx, [rdi - 4]
call fcn.140104070
mov edi, eax
test r13, r13
je 0x1401076fe
mov rcx, r13
call fcn.1400da540
mov rcx, r15
call fcn.1400c9d7c
test edi, edi
jne 0x14010772a
cmp byte [r14 + 0x98], dil
je 0x14010772a
mov rax, qword [r14 + 8]
cmp byte [rax + 0x32], dil
je 0x14010772a
mov rax, qword [r14]
mov dl, 1
mov rcx, r14
call qword [rax + 0x38]
jmp 0x14010772c
mov eax, edi
mov rcx, qword [rbp + 0x60]
xor rcx, rsp
call fcn.1400c9d20
lea r11, [rsp + 0x180]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
movaps xmm6, xmmword [r11 - 0x10]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret