Function at 0x401a90
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, ecx
mov ebx, dword [edi + 0x24]
test ebx, ebx
je 0x401df4
cmp byte [edi + 0x13], 0
je 0x401bdd
cmp dword [edi], 0
lea esi, [edi + 0xef6110]
jne 0x401b01
push 0x1f4
push 1
push esi
push 0xe0
push 0
push 1
mov dl, 0x40
mov byte [esi], 9
mov ecx, ebx
call fcn.00408080
test eax, eax
jns 0x401ade
mov dword [edi], eax
cmp dword [edi], 0
jne 0x401b01
mov ecx, dword [edi + 0x24]
mov dl, 0xc0
push 0x1f4
push 1
push esi
push 0x21
push 0
push 1
call fcn.00408080
test eax, eax
jns 0x401b33
mov dword [edi], eax
xor al, al
cmp dword [edi], 0
jne 0x401b2f
push 0x1f4
push 1
push esi
push 0x21
or al, 0x80
mov dl, 0x40
push 0
mov byte [esi], al
mov ecx, dword [edi + 0x24]
push 1
call fcn.00408080
test eax, eax
jns 0x401b2a
mov dword [edi], eax
cmp dword [edi], 0
je 0x401b37
xor al, al
jmp 0x401b5b
mov al, byte [esi]
jmp 0x401b03
mov ecx, dword [edi + 0x24]
mov dl, 0xc0
push 0x1f4
push 1
push esi
push 0x23
push 0
push 1
call fcn.00408080
test eax, eax
jns 0x401b59
mov dword [edi], eax
xor al, al
jmp 0x401b5b
mov al, byte [esi]
cmp dword [edi], 0
jne 0x401ba5
push 0x1f4
push 1
push esi
push 0x23
and al, 0x7f
mov dl, 0x40
push 0
mov byte [esi], al
mov ecx, dword [edi + 0x24]
push 1
call fcn.00408080
test eax, eax
jns 0x401b82
mov dword [edi], eax
cmp dword [edi], 0
jne 0x401ba5
mov ecx, dword [edi + 0x24]
mov dl, 0xc0
push 0x1f4
push 1
push esi
push 0x21
push 0
push 1
call fcn.00408080
test eax, eax
jns 0x401be9
mov dword [edi], eax
xor al, al
and al, 0x7f
cmp dword [edi], 0
jne 0x401bce
push 0x1f4
push 1
push esi
push 0x21
push 0
mov byte [esi], al
mov dl, 0x40
mov ecx, dword [edi + 0x24]
push 1
call fcn.00408080
test eax, eax
jns 0x401bce
mov dword [edi], eax
lea ecx, [edi + 0x28]
call fcn.004046a0
mov ebx, dword [edi + 0x24]
mov byte [edi + 0x13], 0
test ebx, ebx
je 0x401bed
mov eax, dword [ebx + 0x24]
mov eax, dword [eax + 4]
jmp 0x401bef
mov al, byte [esi]
jmp 0x401ba7
xor eax, eax
push 0
push str.interface__d
push str.libusb_release_interface
push 4
push eax
call fcn.00407e20
add esp, 0x14
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test byte [ebx + 0x18], 1
je 0x401c32
mov eax, dword [ebx + 0x24]
push 0
push ebx
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x128]
mov eax, dword [eax + 0x2c]
call eax
add esp, 8
test eax, eax
jne 0x401c32
and dword [ebx + 0x18], 0xfffffffe
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [edi + 0x24]
mov ebx, 0x24
test esi, esi
je 0x401c4d
mov eax, dword [esi + 0x24]
mov eax, dword [eax + 4]
jmp 0x401c4f
xor eax, eax
push 0
push str.interface__d
push str.libusb_attach_kernel_driver
push 4
push eax
call fcn.00407e20
mov eax, dword [esi + ebx]
add esp, 0x14
mov eax, dword [eax + 0x34]
mov eax, dword [edi + 0x24]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x401df4
mov eax, dword [eax + 0x24]
push 0x43b384
push str.libusb_close
push 4
mov ebx, dword [eax + 4]
push ebx
call fcn.00407e20
add esp, 0x10
push dword [ebx + 0xb8]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
xor ecx, ecx
lea edx, [ebx + 0xd8]
test eax, eax
setne cl
mov dword [ebp - 0x10], ecx
lea ecx, [ebx + 0xf4]
mov dword [ebp - 8], ecx
test eax, eax
jne 0x401d49
push edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebx + 0xf4]
test ecx, ecx
mov eax, dword [ebx + 0xf0]
mov dword [ebp - 4], eax
lea eax, [ecx + 1]
mov ecx, dword [ebp - 4]
mov dword [ebx + 0xf4], eax
jne 0x401cf3
mov eax, ecx
or eax, 0x20
mov dword [ebx + 0xf0], eax
test ecx, ecx
jne 0x401d22
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x401d22
xor ecx, ecx
call fcn.0040ac00
push eax
push str.SetEvent_failed:__s
push str.usbi_signal_event
push 2
push 0
call fcn.00407e20
add esp, 0x14
lea eax, [ebx + 0xd8]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call eax
lea eax, [ebx + 0x9c]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebx + 0xb4], 1
jmp 0x401d4c
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0xc]
mov ecx, ebx
call fcn.004071c0
cmp dword [ebp - 0x10], 0
jne 0x401df4
lea eax, [ebx + 0xd8]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 8]
add dword [eax], 0xffffffff
jne 0x401d7c
and dword [ebx + 0xf0], 0xffffffdf
cmp dword [ebx + 0xf0], 0
jne 0x401db0
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
jne 0x401db0
xor ecx, ecx
call fcn.0040ac00
push eax
push str.ResetEvent_failed:__s
push str.usbi_clear_event
push 2
push 0
call fcn.00407e20
add esp, 0x14
mov esi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebx + 0xd8]
push eax
call esi
lea eax, [ebx + 0x9c]
mov dword [ebx + 0xb4], 0
push eax
call esi
lea esi, [ebx + 0xbc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebx + 0xd4]
push eax
call dword [sym.imp.KERNEL32.dll_WakeAllConditionVariable]
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call eax
mov dword [edi], 0
mov dword [edi + 0x24], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret