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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x48
lea edx, [esp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], 0
mov ecx, dword [ecx]
call fcn.00406d00
test eax, eax
jns 0x4064cf
cmp byte [0x4448d0], 0
je 0x4064cf
push 2
call fcn.0041a17b
add esp, 4
push eax
push str.ps3eye:
call fcn.0041f4fd
add esp, 8
push str.Error_Device_scan
push 2
call fcn.0041a17b
add esp, 4
push eax
call fcn.00401030
push 2
call fcn.0041a17b
add esp, 0xc
push eax
push 0x43aeb8
call fcn.0041f4fd
add esp, 8
mov eax, dword [esp + 0x14]
mov edi, dword [eax]
test edi, edi
je 0x406656
add eax, 4
mov esi, 0x1415
mov dword [esp + 0x10], eax
nop dword [eax]
push 0x43b354
push str.libusb_get_device_descriptor
push 4
push dword [edi + 4]
call fcn.00407c10
movups xmm0, xmmword [edi + 0x20]
add esp, 0x10
pextrw eax, xmm0, 4
movaps xmmword [esp + 0x30], xmm0
cmp ax, si
jne 0x40663a
mov eax, dword [esp + 0x38]
shr eax, 0x10
cmp eax, 0x2000
jne 0x40663a
lea edx, [esp + 0x18]
mov ecx, edi
call fcn.00406e90
mov esi, eax
test esi, esi
jne 0x4065e6
mov ecx, dword [esp + 0x18]
call fcn.004071a0
push 0xef615c
call fcn.00416dd5
mov esi, eax
add esp, 4
lea ecx, [esi + 0xc]
mov dword [esi + 4], 1
push edi
mov dword [esi + 8], 1
mov dword [esi], vtable.std::_Ref_count_obj2_struct_ps3eye::camera_.0
call fcn.004016a0
mov eax, dword [ebp + 8]
lea edx, [esi + 0xc]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], esi
mov ecx, dword [eax + 4]
cmp ecx, dword [eax + 8]
je 0x4065ab
mov dword [ecx], edx
mov dword [ecx + 4], esi
add dword [eax + 4], 8
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
jmp 0x4065e1
lea edx, [esp + 0x28]
push edx
push ecx
mov ecx, eax
call fcn.00406850
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x4065e1
or eax, 0xffffffff
lock xadd dword [esi + 4], eax
jne 0x4065e1
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
or eax, 0xffffffff
lock xadd dword [esi + 8], eax
jne 0x4065e1
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
lock inc dword [edi]
jmp 0x406635
cmp byte [0x4448d0], 0
je 0x406635
push 2
call fcn.0041a17b
add esp, 4
push eax
push str.ps3eye:
call fcn.0041f4fd
push 2
call fcn.0041a17b
add esp, 0xc
push esi
push str.failed_open_device:__d
push eax
call fcn.00401030
add esp, 0xc
push 2
call fcn.0041a17b
add esp, 4
push eax
push 0x43aeb8
call fcn.0041f4fd
add esp, 8
mov esi, 0x1415
mov eax, dword [esp + 0x10]
mov edi, dword [eax]
add eax, 4
mov dword [esp + 0x10], eax
test edi, edi
jne 0x4064f0
mov eax, dword [esp + 0x14]
mov esi, dword [ebp + 8]
test eax, eax
je 0x4067ef
mov edi, dword [eax]
test edi, edi
je 0x4067db
nop dword [eax + eax]
add eax, 4
mov dword [esp + 0x24], eax
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
jne 0x4067c9
movzx eax, byte [edi + 0xe]
push eax
movzx eax, byte [edi + 0xc]
push eax
push str.destroy_device__d._d
push str.libusb_unref_device
push 4
push dword [edi + 4]
call fcn.00407c10
mov ecx, dword [edi + 8]
add esp, 0x18
call fcn.00406e20
mov eax, dword [edi + 4]
push edi
mov eax, dword [eax + 0x128]
mov eax, dword [eax + 0x3c]
call eax
mov eax, dword [edi + 4]
add esp, 4
mov dword [esp + 0x10], eax
mov dword [edi + 0x34], 0
lea esi, [eax + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [edi + 0x18]
mov eax, dword [edi + 0x14]
push esi
mov dword [ecx], eax
mov ecx, dword [edi + 0x14]
mov eax, dword [edi + 0x18]
mov dword [ecx + 4], eax
mov dword [edi + 0x14], 0
mov dword [edi + 0x18], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [esp + 0x10]
cmp dword [esi + 0x78], 0
je 0x4067c0
push 0x10
push 1
call fcn.0041ffa1
add esp, 8
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40673a
push str.error_allocating_hotplug_message
push str.usbi_hotplug_notification
push 1
push esi
call fcn.00407c10
add esp, 0x10
jmp 0x4067c0
mov dword [eax], 2
mov dword [eax + 4], edi
lea eax, [esi + 0xd8]
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [esi + 0xf0]
mov eax, esi
mov ecx, dword [esp + 0x10]
or eax, 8
lea edx, [ecx + 0x110]
mov dword [ecx + 0xf0], eax
mov ecx, dword [esp + 0x1c]
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 0x4067b6
mov eax, dword [esp + 0x10]
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x4067b6
xor ecx, ecx
call fcn.0040a9e0
push eax
push str.SetEvent_failed:__s
push str.usbi_signal_event
push 2
push esi
call fcn.00407c10
add esp, 0x14
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push edi
call fcn.0041ffac
add esp, 4
mov eax, dword [esp + 0x24]
mov edi, dword [eax]
test edi, edi
jne 0x406670
mov eax, dword [esp + 0x14]
push eax
call fcn.0041ffac
mov eax, dword [ebp + 8]
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
pop edi
mov eax, esi
pop esi
mov esp, ebp
pop ebp
ret 4