Function at 0x40b960
Capabilities:
Resume thread

Disassembly:
sub esp, 0x220
mov eax, dword [0x410004]
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 [0x413520]
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 0x40b9be
cmp dword [0x41358c], esi
jne 0x40b9be
mov eax, dword [0x413588]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov dword [0x41358c], ebp
cmp ebx, 3
je 0x40ba89
cmp ebx, 6
je 0x40ba89
cmp ebx, 4
jne 0x40ba35
mov ecx, dword [0x413544]
sub dword [0x41354c], esi
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [0x413578]
cmp eax, ebp
je 0x40ba11
mov ecx, dword [esp + 0x10]
cmp ecx, dword [eax + 0x218]
je 0x40ba0b
mov eax, dword [eax + 0x214]
cmp eax, ebp
jne 0x40b9f7
jmp 0x40ba11
mov dword [eax + 0x21c], ebp
mov edx, dword [0x413544]
push 0x41354c
push esi
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
add dword [0x41354c], esi
mov esi, dword [esp + 0x10]
call fcn.0040b800
jmp 0x40ba4d
test ebx, 0xc0000000
je 0x40ba48
push 0x41357c
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
cmp ebx, 5
je 0x40ba5b
xor ebp, ebp
test ebx, 0xc0000000
je 0x40b980
cmp dword [0x413578], ebp
pop edi
pop esi
pop ebp
pop ebx
je 0x40ba74
mov ecx, dword [0x413540]
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 [0x413524]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x413520]
push 0x214
push ecx
push edx
push eax
call dword [sym.imp.iusb3mon.dll__USB3MON_GetDeviceInfoW_20]
mov ebx, eax
cmp ebx, ebp
jne 0x40ba3d
add dword [0x413560], esi
push 0x1c
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
cmp esi, ebp
je 0x40bb03
mov ecx, dword [esp + 0x10]
mov dword [esi + 0x14], ecx
mov edx, dword [esp + 0x220]
push esi
lea edi, [esp + 0x1c]
mov dword [esi + 0x10], edx
call fcn.0040b8d0
mov edi, eax
add esp, 4
cmp edi, ebp
jne 0x40baf4
call fcn.0040b870
mov edi, esi
jmp 0x40bb05
dec dword [0x413560]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40bb05
xor edi, edi
mov eax, dword [esp + 0x18]
test al, 2
je 0x40bb1e
cmp byte [esp + 0x21c], 3
je 0x40bb1e
sub eax, 2
mov dword [esp + 0x18], eax
cmp eax, ebp
je 0x40ba4d
cmp edi, ebp
je 0x40ba4d
inc dword [0x413560]
push 0x224
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
je 0x40ba4d
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 [0x413544]
add esp, 0x10
push 0xffffffffffffffff
mov edi, 1
sub dword [0x41354c], edi
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [0x413578]
test eax, eax
jne 0x40bba8
mov dword [0x413578], esi
jmp 0x40bbf2
mov ecx, dword [esp + 0x10]
cmp dword [eax + 0x218], ecx
jne 0x40bbb6
mov ebp, edi
cmp dword [eax + 0x214], 0
je 0x40bbd9
nop
mov eax, dword [eax + 0x214]
cmp dword [eax + 0x218], ecx
jne 0x40bbd0
mov ebp, edi
cmp dword [eax + 0x214], 0
jne 0x40bbc0
test ebp, ebp
jne 0x40bbe5
mov dword [eax + 0x214], esi
jmp 0x40bbf2
sub dword [0x413560], edi
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x413544]
push 0x41354c
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
add dword [0x41354c], edi
jmp 0x40ba4d