Function at 0x40b5e0
Capabilities:
Resume thread

Disassembly:
sub esp, 0x220
mov eax, dword [0x40f004]
xor eax, esp
mov dword [esp + 0x21c], eax
push ebx
push ebp
push esi
xor ebp, ebp
push edi
mov dword [esp + 0x14], ebp
mov edi, edi
mov edx, dword [0x412520]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x14]
push ecx
push edx
call dword [sym.imp.iusb3mon.dll__USB3MON_DeviceChange_12]
mov ebx, eax
mov esi, 1
cmp dword [esp + 0x14], ebp
jne 0x40b63e
cmp dword [0x41258c], esi
jne 0x40b63e
mov eax, dword [0x412588]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov dword [0x41258c], ebp
cmp ebx, 3
je 0x40b709
cmp ebx, 6
je 0x40b709
cmp ebx, 4
jne 0x40b6b5
mov ecx, dword [0x412544]
sub dword [0x41254c], esi
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [0x412578]
cmp eax, ebp
je 0x40b691
mov ecx, dword [esp + 0x10]
cmp ecx, dword [eax + 0x218]
je 0x40b68b
mov eax, dword [eax + 0x214]
cmp eax, ebp
jne 0x40b677
jmp 0x40b691
mov dword [eax + 0x21c], ebp
mov edx, dword [0x412544]
push 0x41254c
push esi
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
add dword [0x41254c], esi
mov esi, dword [esp + 0x10]
call fcn.0040b490
jmp 0x40b6cd
test ebx, 0xc0000000
je 0x40b6c8
push 0x41257c
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
cmp ebx, 5
je 0x40b6db
xor ebp, ebp
test ebx, 0xc0000000
je 0x40b600
cmp dword [0x412578], ebp
pop edi
pop esi
pop ebp
pop ebx
je 0x40b6f4
mov ecx, dword [0x412540]
push ecx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [esp + 0x21c]
xor ecx, esp
call fcn.00401000
add esp, 0x220
ret
mov ecx, dword [0x412524]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x412520]
push 0x214
push ecx
push edx
push eax
call dword [sym.imp.iusb3mon.dll__USB3MON_GetDeviceInfoW_20]
mov ebx, eax
cmp ebx, ebp
jne 0x40b6bd
add dword [0x412560], esi
push 0x18
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
cmp esi, ebp
je 0x40b783
mov ecx, dword [esp + 0x10]
mov dword [esi + 0x10], ecx
mov edx, dword [esp + 0x220]
push esi
lea edi, [esp + 0x1c]
mov dword [esi + 0xc], edx
call fcn.0040b560
mov edi, eax
add esp, 4
cmp edi, ebp
jne 0x40b774
call fcn.0040b500
mov edi, esi
jmp 0x40b785
dec dword [0x412560]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40b785
xor edi, edi
mov eax, dword [esp + 0x18]
test al, 2
je 0x40b79e
cmp byte [esp + 0x21c], 3
je 0x40b79e
sub eax, 2
mov dword [esp + 0x18], eax
cmp eax, ebp
je 0x40b6cd
cmp edi, ebp
je 0x40b6cd
inc dword [0x412560]
push 0x224
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
je 0x40b6cd
push 0x214
lea ecx, [esp + 0x1c]
push ecx
mov dword [esi + 0x21c], 1
mov eax, dword [esp + 0x18]
push 0x214
push esi
mov dword [esi + 0x218], eax
mov dword [esi + 0x220], edi
call fcn.0040127e
mov edx, dword [0x412544]
add esp, 0x10
push 0xffffffffffffffff
mov edi, 1
sub dword [0x41254c], edi
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [0x412578]
test eax, eax
jne 0x40b828
mov dword [0x412578], esi
jmp 0x40b872
mov ecx, dword [esp + 0x10]
cmp dword [eax + 0x218], ecx
jne 0x40b836
mov ebp, edi
cmp dword [eax + 0x214], 0
je 0x40b859
nop
mov eax, dword [eax + 0x214]
cmp dword [eax + 0x218], ecx
jne 0x40b850
mov ebp, edi
cmp dword [eax + 0x214], 0
jne 0x40b840
test ebp, ebp
jne 0x40b865
mov dword [eax + 0x214], esi
jmp 0x40b872
sub dword [0x412560], edi
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x412544]
push 0x41254c
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
add dword [0x41254c], edi
jmp 0x40b6cd