Function at 0x6b802820
Capabilities:
Get thread local storage value
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [ebp + 8]
test edi, edi
je 0x6b802956
mov dword [esp + 0xc], 0x6b818237
mov dword [esp + 8], str.libusb_close
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [eax + 0xb4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
test eax, eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], edx
je 0x6b802ad1
mov ebx, dword [ebp - 0x1c]
mov eax, ebx
sub eax, 0xffffff80
mov dword [ebp - 0x28], eax
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebx + 0x7c]
mov eax, ebx
sub esp, 4
add eax, 0x78
lea ebx, [ecx - 4]
mov edx, dword [ebx + 8]
cmp eax, ecx
lea esi, [edx - 4]
je 0x6b8028dc
mov ecx, edi
mov edi, eax
jmp 0x6b8028c2
mov esi, edx
cmp ecx, dword [ebx + 0x48]
je 0x6b802960
mov eax, dword [esi + 8]
mov ebx, esi
lea esi, [esi + 4]
cmp edi, esi
lea edx, [eax - 4]
jne 0x6b8028c0
mov edi, ecx
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x20]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x1c]
sub esp, 4
lea ebx, [eax + 0x3c]
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x20]
mov ecx, dword [edi + 0x1c]
sub esp, 4
mov dword [eax], ecx
mov ecx, dword [edi + 0x1c]
mov dword [ecx + 4], eax
mov dword [edi + 0x1c], 0
mov dword [edi + 0x20], 0
mov dword [esp], ebx
call esi
sub esp, 4
mov dword [esp], edi
call dword [0x6b81b6c4]
mov eax, dword [edi + 0x24]
mov dword [esp], eax
call sym.libusb_1.0.dll_libusb_unref_device
sub esp, 4
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
sub esp, 4
mov dword [esp], edi
call sym._free
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x6b802a4b
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 4
lea eax, [ebx + 0x2c]
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], eax
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
test byte [ebx + 0x24], 4
mov ecx, dword [ebp - 0x30]
je 0x6b8029f0
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x30], ecx
add ebx, 0x48
mov dword [esp], eax
call dword [ebp - 0x20]
mov eax, dword [ebx - 0x44]
mov edx, dword [ebx - 0x40]
sub esp, 4
mov ecx, dword [ebp - 0x30]
mov dword [edx], eax
mov eax, dword [ebx - 0x44]
mov dword [ebp - 0x2c], ecx
mov dword [eax + 4], edx
mov dword [ebx - 0x44], 0
mov dword [ebx - 0x40], 0
mov dword [ebx], 0
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.Removed_transfer__p_from_the_in_flight_list_because_device_handle__p_closed
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov ecx, dword [ebp - 0x2c]
jmp 0x6b8028cb
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], str.Device_handle_closed_while_transfer_was_still_being_processed__but_the_device_is_still_connected_as_far_as_we_know
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 1
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_log
test byte [ebx + 0x24], 2
mov ecx, dword [ebp - 0x30]
je 0x6b802aa3
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], str.A_cancellation_for_an_in_flight_transfer_hasnt_completed_but_closing_the_device_handle
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 2
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_log
mov ecx, dword [ebp - 0x30]
jmp 0x6b80297e
mov edi, dword [ebp - 0x1c]
lea ebx, [edi + 0xd4]
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0xf0]
sub esp, 4
mov dword [ebp - 0x24], eax
sub eax, 1
test eax, eax
mov dword [edi + 0xf0], eax
je 0x6b802b33
mov eax, dword [edi + 0xec]
test eax, eax
je 0x6b802b5d
mov dword [esp], ebx
call dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
sub esp, 4
mov dword [ebp + 8], eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp sym.libusb_1.0.dll_libusb_unlock_events
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], str.A_cancellation_hasnt_even_been_scheduled_on_the_transfer_for_which_the_device_is_closing
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 1
mov dword [ebp - 0x30], ecx
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_log
mov ecx, dword [ebp - 0x30]
jmp 0x6b80297e
mov esi, dword [ebp - 0x1c]
lea ebx, [esi + 0xd4]
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, esi
sub esp, 4
mov esi, dword [esi + 0xec]
mov eax, dword [edx + 0xf0]
lea ecx, [eax + 1]
test eax, eax
mov dword [edx + 0xf0], ecx
jne 0x6b802b0c
mov eax, esi
or eax, 0x20
mov dword [edx + 0xec], eax
test esi, esi
je 0x6b802b4d
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp], ebx
mov dword [ebp - 0x20], eax
call eax
mov eax, dword [ebp - 0x1c]
sub esp, 4
mov dword [esp], eax
call sym.libusb_1.0.dll_libusb_lock_events
sub esp, 4
jmp 0x6b802887
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ecx + 0xec]
mov dword [ebp - 0x24], eax
and eax, 0xffffffdf
mov dword [ecx + 0xec], eax
jmp 0x6b802a80
mov eax, dword [ebp - 0x1c]
add eax, 0xc
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_signal_event
jmp 0x6b802b10
mov eax, dword [ebp - 0x1c]
add eax, 0xc
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_clear_event
jmp 0x6b802a88