Function at 0x4046a0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x20
push esi
mov esi, ecx
push edi
push esi
mov dword [esp + 0x1c], esi
call fcn.00416d36
add esp, 4
test eax, eax
jne 0x404a42
cmp byte [esi + 0xea60e7], al
je 0x404a33
lea eax, [esi + 0x58]
mov dword [esp + 0x1c], 5
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], eax
mov ecx, dword [eax]
mov eax, dword [ecx - 0x20]
lea esi, [ecx - 0x58]
test eax, eax
je 0x4046f2
mov eax, dword [eax + 4]
jmp 0x4046f4
xor eax, eax
push ecx
push str.transfer__p
push str.libusb_cancel_transfer
push 4
push eax
mov dword [esp + 0x20], eax
call fcn.00407e20
add esp, 0x14
lea eax, [esi + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x30]
and al, 3
cmp al, 1
jne 0x40477b
push esi
call fcn.0040bb50
mov edi, eax
add esp, 4
test edi, edi
jns 0x404777
cmp edi, 0xfffffffb
je 0x404755
cmp edi, 0xfffffffc
je 0x404755
push edi
push str.cancel_transfer_failed_error__d
push str.libusb_cancel_transfer
push 1
push dword [esp + 0x1c]
call fcn.00407e20
add esp, 0x14
jmp 0x404777
push edi
push str.cancel_transfer_failed_error__d
push str.libusb_cancel_transfer
push 4
push dword [esp + 0x1c]
call fcn.00407e20
add esp, 0x14
cmp edi, 0xfffffffc
jne 0x404777
or dword [esi + 0x30], 4
or dword [esi + 0x30], 2
lea eax, [esi + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x10]
add eax, 4
sub dword [esp + 0x1c], 1
mov dword [esp + 0x10], eax
jne 0x4046e1
mov esi, dword [esp + 0x18]
cmp byte [esi + 0xea60e7], 0
lea edi, [esi + 0x30]
je 0x4047c3
nop dword [eax + eax]
push esi
push edi
call fcn.00416223
add esp, 8
cmp byte [esi + 0xea60e7], 0
jne 0x4047b0
mov eax, dword [esp + 0x14]
mov ecx, 5
mov dword [esp + 0x1c], ecx
mov edi, dword [eax]
test edi, edi
je 0x4049a4
mov eax, dword [edi - 0x20]
test eax, eax
je 0x4047e6
mov eax, dword [eax + 4]
jmp 0x4047e8
xor eax, eax
push edi
push str.transfer__p
push str.libusb_free_transfer
push 4
push eax
call fcn.00407e20
add esp, 0x14
test byte [edi + 4], 2
je 0x40480f
push dword [edi + 0x20]
call fcn.00420a7a
add esp, 4
lea eax, [edi - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov esi, dword [edi - 0x20]
mov dword [esp + 0x10], esi
test esi, esi
je 0x404987
or eax, 0xffffffff
lock xadd dword [esi], eax
dec eax
jne 0x404987
movzx eax, byte [esi + 0xe]
push eax
movzx eax, byte [esi + 0xc]
push eax
push str.destroy_device__d._d
push str.libusb_unref_device
push 4
push dword [esi + 4]
call fcn.00407e20
mov ecx, dword [esi + 8]
add esp, 0x18
call fcn.00407060
mov eax, dword [esi + 4]
push esi
mov eax, dword [eax + 0x128]
mov eax, dword [eax + 0x3c]
call eax
mov eax, dword [esi + 4]
add esp, 4
mov dword [esi + 0x34], 0
mov dword [esp + 0xc], eax
lea esi, [eax + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [esp + 0x10]
push esi
mov ecx, dword [edx + 0x18]
mov eax, dword [edx + 0x14]
mov dword [ecx], eax
mov ecx, dword [edx + 0x14]
mov eax, dword [edx + 0x18]
mov dword [ecx + 4], eax
mov dword [edx + 0x14], 0
mov dword [edx + 0x18], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [esp + 0xc]
cmp dword [esi + 0x78], 0
je 0x40497b
push 0x10
push 1
call fcn.00420a64
mov ecx, eax
add esp, 8
mov dword [esp + 0x20], ecx
test ecx, ecx
jne 0x4048f1
push str.error_allocating_hotplug_message
push str.usbi_hotplug_notification
push 1
push esi
call fcn.00407e20
add esp, 0x10
jmp 0x40497b
mov eax, dword [esp + 0x10]
mov dword [ecx + 4], eax
lea eax, [esi + 0xd8]
push eax
mov dword [ecx], 2
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [esi + 0xf0]
mov eax, esi
mov ecx, dword [esp + 0xc]
or eax, 8
lea edx, [ecx + 0x110]
mov dword [ecx + 0xf0], eax
mov ecx, dword [esp + 0x20]
add ecx, 8
mov dword [ecx + 4], edx
mov eax, dword [edx]
mov dword [ecx], eax
mov eax, dword [edx]
mov dword [eax + 4], ecx
mov dword [edx], ecx
test esi, esi
jne 0x404971
mov eax, dword [esp + 0xc]
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x404971
xor ecx, ecx
call fcn.0040ac00
push eax
push str.SetEvent_failed:__s
push str.usbi_signal_event
push 2
push esi
call fcn.00407e20
add esp, 0x14
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [esp + 0x10]
call fcn.00420a7a
add esp, 4
lea eax, [edi - 0xc8]
push eax
call fcn.00420a7a
mov eax, dword [esp + 0x18]
add esp, 4
mov ecx, dword [esp + 0x1c]
mov dword [eax], 0
add eax, 4
sub ecx, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], ecx
jne 0x4047d0
mov eax, dword fs:[0x2c]
mov ecx, dword [eax]
mov eax, dword [0x445954]
cmp eax, dword [ecx + 4]
jg 0x404a48
mov eax, 0x44594c
or esi, 0xffffffff
lock xadd dword [eax], esi
cmp esi, 1
jne 0x404a2f
mov al, 1
mov esi, 0x445950
xchg byte [esi], al
cmp dword [0x445948], 0
je 0x404acc
call sub.KERNEL32.dll_GetCurrentThreadId
mov ecx, dword [0x445948]
cmp ecx, eax
je 0x404ad3
push 0
push ecx
push dword [0x445944]
call fcn.00415e0f
add esp, 0xc
test eax, eax
jne 0x404ada
xorps xmm0, xmm0
xor al, al
movlpd qword [0x445944], xmm0
xchg byte [esi], al
mov esi, dword [esp + 0x18]
push esi
call fcn.00416d5b
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push eax
call fcn.004168f0
push 0x445954
call fcn.00417348
add esp, 4
cmp dword [0x445954], 0xffffffff
jne 0x4049cd
xorps xmm0, xmm0
mov dword [0x445940], 0
push ecx
movq qword [0x445944], xmm0
mov dword [0x44594c], 0
mov byte [0x445950], 0
call fcn.00407740
movzx eax, byte [0x4448d0]
neg eax
sbb eax, eax
and eax, 3
push eax
push 0
push dword [0x445940]
call fcn.004075d0
add esp, 0xc
push 0x433ca0
call fcn.0041768a
add esp, 4
push 0x445954
call fcn.004172fe
add esp, 4
jmp 0x4049cd
push 1
call fcn.0041691d
push 5
call fcn.0041691d
push 2
call fcn.0041691d
int3