Function at 0x140107890
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x90]
sub rsp, 0x190
mov rax, qword [0x1405921c0]
xor rax, rsp
mov qword [rbp + 0x80], rax
movzx ebx, dl
mov byte [rsp + 0x21], bl
mov r15, rcx
mov qword [rsp + 0x28], rcx
mov r13d, ebx
xor r12d, r12d
mov dword [rsp + 0x3c], r12d
lea ecx, [r12 + 0x10]
lea r14d, [r12 - 0xe]
call fcn.1400c9d40
mov rdi, rax
mov qword [rsp + 0x30], rax
xor eax, eax
mov qword [rdi], rax
mov qword [rdi + 8], rax
mov qword [rsp + 0x60], rdi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea rcx, [rdi + 8]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
nop
xor r13d, 1
inc r13d
mov dword [rsp + 0x40], r13d
test bl, bl
je 0x140107938
mov ecx, dword [r15 + 0xa0]
call qword [sym.imp.KERNEL32.dll_Sleep]
mov dword [rsp + 0x38], r12d
test r13d, r13d
je 0x140107ae4
movzx esi, byte [rsp + 0x20]
movzx ebx, byte [rsp + 0x20]
cmp r14d, 0xfffffff2
jne 0x140107ae4
lea r13, [r15 + 0xa0]
movzx r15d, bl
movzx r12d, sil
mov ecx, 7
call fcn.1400ca4ec
mov rdi, rax
xor r14d, r14d
mov dword [rax + 1], r14d
mov word [rax + 5], r14w
mov byte [rax], 2
lea r8d, [r14 + 7]
mov rdx, rax
mov rsi, qword [rsp + 0x28]
mov rcx, qword [rsi + 0x28]
call qword [sym.imp.HID.DLL_HidD_GetFeature]
test al, al
jne 0x140107b24
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
xorps xmm0, xmm0
movups xmmword [rbp + 0x60], xmm0
mov qword [rbp + 0x70], r14
mov qword [rbp + 0x78], r14
lea ecx, [r14 + 0x30]
call fcn.1400c9d40
mov rcx, rax
mov qword [rbp + 0x60], rax
mov qword [rbp + 0x70], 0x2d
mov qword [rbp + 0x78], 0x2f
movups xmm0, xmmword [str.Failed_to_get_feature_information__GetStatus_]
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14029d330]
movups xmmword [rax + 0x10], xmm1
movsd xmm0, qword [0x14029d340]
movsd qword [rax + 0x20], xmm0
mov eax, dword [0x14029d348]
mov dword [rcx + 0x28], eax
movzx eax, byte [0x14029d34c]
mov byte [rcx + 0x2c], al
mov byte [rcx + 0x2d], r14b
mov r9d, ebx
lea r8, [rbp + 0x60]
lea edx, [r14 - 0xc]
mov rcx, rsi
call fcn.14010df70
mov r14d, eax
mov rdx, qword [rbp + 0x78]
cmp rdx, 0xf
jbe 0x140107a64
inc rdx
mov rcx, qword [rbp + 0x60]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140107a5f
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140107cee
call fcn.1400c9d7c
mov rcx, rdi
call fcn.1400c9d7c
movzx esi, r12b
movzx ebx, r15b
mov eax, r14d
cmp r14d, 0xfffffff4
jne 0x140107abe
lea rcx, [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rcx, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x30]
sub rcx, qword [rdi]
mov eax, 0
cmovns rax, rcx
imul rax, rax, 0x3e8
cqo
idiv qword [rdi + 8]
cmp eax, dword [r13]
jae 0x140107acb
cmp byte [rsp + 0x21], 0
je 0x140107961
jmp 0x140107acb
test eax, eax
je 0x140107b4e
mov rdi, qword [rsp + 0x30]
mov r15, qword [rsp + 0x28]
mov eax, dword [rsp + 0x38]
inc eax
mov dword [rsp + 0x38], eax
cmp eax, dword [rsp + 0x40]
jb 0x140107950
mov edx, reloc.OLEAUT32.dll_SafeArrayGetDim
mov rcx, rdi
call fcn.1400c9d7c
mov eax, r14d
mov rcx, qword [rbp + 0x80]
xor rcx, rsp
call fcn.1400c9d20
lea r11, [rsp + 0x190]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
movzx ebx, byte [rdi + 1]
movzx esi, byte [rdi + 5]
movzx ecx, byte [rdi + 4]
shl ecx, 8
movzx eax, byte [rdi + 3]
add ecx, eax
shl ecx, 8
movzx eax, byte [rdi + 2]
add ecx, eax
mov dword [r13], ecx
mov rcx, rdi
call fcn.1400c9d7c
movzx eax, sil
test bl, bl
jne 0x140107cb6
cmp sil, 4
jne 0x140107bc5
mov eax, dword [rsp + 0x40]
dec eax
cmp dword [rsp + 0x38], eax
jae 0x140107bdd
lea rcx, [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rcx, qword [rsp + 0x58]
mov rdi, qword [rsp + 0x30]
sub rcx, qword [rdi]
mov eax, 0
cmovns rax, rcx
imul rax, rax, 0x3e8
cqo
idiv qword [rdi + 8]
mov ecx, dword [r13]
cmp eax, ecx
jae 0x140107baa
sub ecx, eax
call qword [sym.imp.KERNEL32.dll_Sleep]
mov r15, qword [rsp + 0x28]
lea rcx, [r15 + 0x50]
mov edx, 0xfffffff2
call fcn.140104070
mov r14d, eax
jmp 0x140107ad0
test al, al
je 0x140107ac6
cmp al, 2
je 0x140107cdf
cmp al, 5
je 0x140107ac6
lea rcx, [rsp + 0x70]
call fcn.140006e00
nop
lea rdx, str.Upgrade_failed__DFU_status_code_
lea rcx, [rsp + 0x70]
call fcn.14000a250
movzx edx, bl
mov rcx, rax
call fcn.140007340
mov rcx, rax
lea rdx, [0x14029d184]
call fcn.14000a250
mov r15, qword [rsp + 0x28]
lea rdx, [rbp + 0x60]
lea rcx, [rsp + 0x78]
call fcn.140008e10
or dword [rsp + 0x3c], 1
lea r8, [rbp + 0x60]
mov edx, 0xfffffff8
lea rcx, [r15 + 0x50]
call fcn.140103fd0
mov r14d, eax
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rsp + rcx + 0x70], rax
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov dword [rsp + rcx + 0x6c], edx
lea rcx, [rsp + 0x78]
call fcn.140006ae0
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
mov qword [rsp + rcx + 0x70], rax
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x10]
mov dword [rsp + rcx + 0x6c], edx
lea rax, vtable.std::ios_base.0
mov qword [rbp - 8], rax
lea rcx, [rbp - 8]
call fcn.1400c7f20
nop
mov rdi, qword [rsp + 0x30]
jmp 0x140107ad0
cmp bl, 0xa
jne 0x140107bdd
mov r15, qword [rsp + 0x28]
lea rcx, [r15 + 0x50]
mov edx, 0xfffffff0
call fcn.140104070
mov r14d, eax
mov rdi, qword [rsp + 0x30]
jmp 0x140107ad0
mov r15, qword [rsp + 0x28]
mov rdi, qword [rsp + 0x30]
jmp 0x140107ad0
call fcn.1400d4b64
int3