Function at 0x40caba
Capabilities:
Read file on windows

Disassembly:
push rbp
mov rbp, rsp
add rsp, 0xffffffffffffff80
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
mov dword [rbp - 0x14], 0
mov dword [rbp - 0x18], 0xffffffff
mov rax, qword [rbp + 0x10]
add rax, 0x88
mov rcx, rax
call sym.usbi_mutex_lock
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x80]
sub rax, 8
mov qword [rbp - 0x10], rax
jmp 0x40cb13
add dword [rbp - 0x14], 1
mov rax, qword [rbp - 0x10]
mov rax, qword [rax + 0x10]
sub rax, 8
mov qword [rbp - 0x10], rax
mov rax, qword [rbp - 0x10]
lea rdx, [rax + 8]
mov rax, qword [rbp + 0x10]
add rax, 0x78
cmp rdx, rax
jne 0x40caff
mov eax, dword [rbp - 0x14]
shl rax, 3
mov rcx, rax
call sym.malloc
mov qword [rbp - 0x28], rax
cmp qword [rbp - 0x28], 0
jne 0x40cb5e
mov rax, qword [rbp + 0x10]
add rax, 0x88
mov rcx, rax
call sym.usbi_mutex_unlock
mov eax, 0xfffffff5
jmp 0x40ce51
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x80]
sub rax, 8
mov qword [rbp - 0x10], rax
jmp 0x40cbeb
mov rax, qword [rbp - 0x10]
mov qword [rbp - 0x38], rax
mov rax, qword [rbp - 0x38]
mov eax, dword [rax]
mov dword [rbp - 0x3c], eax
add dword [rbp - 0x18], 1
mov eax, dword [rbp - 0x18]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp - 0x28]
add rdx, rax
mov eax, dword [rbp - 0x3c]
mov dword [rdx], eax
mov eax, dword [rbp - 0x18]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp - 0x28]
add rdx, rax
mov rax, qword [rbp - 0x38]
movzx eax, word [rax + 4]
mov word [rdx + 4], ax
mov eax, dword [rbp - 0x18]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp - 0x28]
add rax, rdx
mov word [rax + 6], 0
mov rax, qword [rbp - 0x10]
mov rax, qword [rax + 0x10]
sub rax, 8
mov qword [rbp - 0x10], rax
mov rax, qword [rbp - 0x10]
lea rdx, [rax + 8]
mov rax, qword [rbp + 0x10]
add rax, 0x78
cmp rdx, rax
jne 0x40cb73
mov rax, qword [rbp + 0x10]
add rax, 0x88
mov rcx, rax
call sym.usbi_mutex_unlock
mov rax, qword [rbp + 0x18]
mov eax, dword [rax]
imul edx, eax, 0x3e8
mov rax, qword [rbp + 0x18]
mov eax, dword [rax + 4]
movsxd rcx, eax
imul rcx, rcx, 0x10624dd3
shr rcx, 0x20
sar ecx, 6
sar eax, 0x1f
sub ecx, eax
mov eax, ecx
add eax, edx
mov dword [rbp - 0x1c], eax
mov rax, qword [rbp + 0x18]
mov edx, dword [rax + 4]
movsxd rax, edx
imul rax, rax, 0x10624dd3
shr rax, 0x20
mov ecx, eax
sar ecx, 6
mov eax, edx
sar eax, 0x1f
sub ecx, eax
mov eax, ecx
imul eax, eax, 0x3e8
sub edx, eax
mov eax, edx
test eax, eax
je 0x40cc7b
add dword [rbp - 0x1c], 1
mov ecx, dword [rbp - 0x1c]
mov edx, dword [rbp - 0x14]
mov rax, qword [rbp - 0x28]
mov r8d, ecx
mov rcx, rax
call sym.usbi_poll
mov dword [rbp - 4], eax
cmp dword [rbp - 4], 0
jne 0x40ccb3
mov rax, qword [rbp - 0x28]
mov rcx, rax
call sym.free
mov rcx, qword [rbp + 0x10]
call sym.handle_timeouts
jmp 0x40ce51
cmp dword [rbp - 4], 0xffffffff
jne 0x40ccdf
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
cmp eax, 4
jne 0x40ccdf
mov rax, qword [rbp - 0x28]
mov rcx, rax
call sym.free
mov eax, 0xfffffff6
jmp 0x40ce51
cmp dword [rbp - 4], 0
jns 0x40cd2d
mov rax, qword [rbp - 0x28]
mov rcx, rax
call sym.free
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
mov dword [rsp + 0x28], eax
mov eax, dword [rbp - 4]
mov dword [rsp + 0x20], eax
lea r9, str.poll_failed__d_err_d_n
lea r8, str.handle_events
mov edx, 3
mov rcx, qword [rbp + 0x10]
call sym.usbi_log
mov eax, 0xffffffff
jmp 0x40ce51
mov rax, qword [rbp - 0x28]
movzx eax, word [rax + 6]
test ax, ax
je 0x40cd5a
cmp dword [rbp - 4], 1
jne 0x40cd4c
mov dword [rbp - 4], 0
jmp 0x40ce42
mov rax, qword [rbp - 0x28]
mov word [rax + 6], 0
sub dword [rbp - 4], 1
mov ecx, 1
call sym.libusb_has_capability
test eax, eax
je 0x40cde5
mov rax, qword [rbp - 0x28]
add rax, 8
movzx eax, word [rax + 6]
test ax, ax
je 0x40cde5
mov rax, qword [rbp + 0x10]
mov eax, dword [rax + 0x58]
lea rdx, [rbp - 0x50]
mov r8d, 0x10
mov ecx, eax
call sym.read
mov dword [rbp - 0x2c], eax
cmp dword [rbp - 0x2c], 0xf
ja 0x40cda6
mov dword [rbp - 0x2c], 0xffffff9d
jmp 0x40ce42
mov edx, dword [rbp - 0x50]
mov rax, qword [rbp - 0x48]
mov rcx, rax
call sym.usbi_hotplug_match
mov eax, dword [rbp - 0x50]
cmp eax, 2
jne 0x40cdc9
mov rax, qword [rbp - 0x48]
mov rcx, rax
call sym.libusb_unref_device
mov rax, qword [rbp - 0x28]
add rax, 8
mov word [rax + 6], 0
mov eax, dword [rbp - 4]
lea edx, [rax - 1]
mov dword [rbp - 4], edx
cmp eax, 1
je 0x40ce3e
mov rax, qword [0x00514e50]
mov rax, qword [rax]
mov r10, qword [rax + 0xb8]
mov ecx, dword [rbp - 4]
mov edx, dword [rbp - 0x14]
mov rax, qword [rbp - 0x28]
mov r9d, ecx
mov r8d, edx
mov rdx, rax
mov rcx, qword [rbp + 0x10]
call r10
mov dword [rbp - 4], eax
cmp dword [rbp - 4], 0
je 0x40ce41
mov eax, dword [rbp - 4]
mov dword [rsp + 0x20], eax
lea r9, str.backend_handle_events_failed_with_error__d
lea r8, str.handle_events
mov edx, 3
mov rcx, qword [rbp + 0x10]
call sym.usbi_log
jmp 0x40ce42
nop
jmp 0x40ce42
nop
mov rax, qword [rbp - 0x28]
mov rcx, rax
call sym.free
mov eax, dword [rbp - 4]
sub rsp, 0xffffffffffffff80
pop rbp
ret