Function at 0x406630
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.00406f40
test eax, eax
jns 0x4066af
cmp byte [0x4448d0], 0
je 0x4066af
push 2
call fcn.0041fd7c
add esp, 4
push eax
push str.ps3eye:
call fcn.0041ffbf
add esp, 8
push str.Error_Device_scan
push 2
call fcn.0041fd7c
add esp, 4
push eax
call fcn.00401750
push 2
call fcn.0041fd7c
add esp, 0xc
push eax
push 0x43ae88
call fcn.0041ffbf
add esp, 8
mov eax, dword [esp + 0x14]
mov edi, dword [eax]
test edi, edi
je 0x406836
add eax, 4
mov esi, 0x1415
mov dword [esp + 0x10], eax
nop dword [eax]
push 0x43b384
push str.libusb_get_device_descriptor
push 4
push dword [edi + 4]
call fcn.00407e20
movups xmm0, xmmword [edi + 0x20]
add esp, 0x10
pextrw eax, xmm0, 4
movaps xmmword [esp + 0x30], xmm0
cmp ax, si
jne 0x40681a
mov eax, dword [esp + 0x38]
shr eax, 0x10
cmp eax, 0x2000
jne 0x40681a
lea edx, [esp + 0x18]
mov ecx, edi
call fcn.004070d0
mov esi, eax
test esi, esi
jne 0x4067c6
mov ecx, dword [esp + 0x18]
call fcn.004073b0
push 0xef615c
call fcn.0041741e
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.00401780
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 0x40678b
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 0x4067c1
lea edx, [esp + 0x28]
push edx
push ecx
mov ecx, eax
call fcn.00406a30
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x4067c1
or eax, 0xffffffff
lock xadd dword [esi + 4], eax
jne 0x4067c1
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
or eax, 0xffffffff
lock xadd dword [esi + 8], eax
jne 0x4067c1
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
lock inc dword [edi]
jmp 0x406815
cmp byte [0x4448d0], 0
je 0x406815
push 2
call fcn.0041fd7c
add esp, 4
push eax
push str.ps3eye:
call fcn.0041ffbf
push 2
call fcn.0041fd7c
add esp, 0xc
push esi
push str.failed_open_device:__d
push eax
call fcn.00401750
add esp, 0xc
push 2
call fcn.0041fd7c
add esp, 4
push eax
push 0x43ae88
call fcn.0041ffbf
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 0x4066d0
mov eax, dword [esp + 0x14]
mov esi, dword [ebp + 8]
test eax, eax
je 0x4069cf
mov edi, dword [eax]
test edi, edi
je 0x4069bb
nop dword [eax + eax]
add eax, 4
mov dword [esp + 0x24], eax
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
jne 0x4069a9
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.00407e20
mov ecx, dword [edi + 8]
add esp, 0x18
call fcn.00407060
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 0x4069a0
push 0x10
push 1
call fcn.00420a64
add esp, 8
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40691a
push str.error_allocating_hotplug_message
push str.usbi_hotplug_notification
push 1
push esi
call fcn.00407e20
add esp, 0x10
jmp 0x4069a0
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 0x406996
mov eax, dword [esp + 0x10]
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x406996
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 + 0x20]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push edi
call fcn.00420a7a
add esp, 4
mov eax, dword [esp + 0x24]
mov edi, dword [eax]
test edi, edi
jne 0x406850
mov eax, dword [esp + 0x14]
push eax
call fcn.00420a7a
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