Function at 0x407e70
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov byte [esp + 0x17], dl
mov dword [esp + 0x18], 0
test edi, edi
je 0x407e91
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x407e93
xor eax, eax
push dword [eax + 0xb8]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x407eb2
mov eax, 0xfffffffa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
push 0xf0
push 1
call fcn.0041ffa1
mov esi, eax
add esp, 8
test esi, esi
je 0x407f09
lea ecx, [esi + 0xac]
mov dword [esi + 0x70], 0
push ecx
mov dword [esi + 0xc4], esi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
add esi, 0xc8
je 0x407f09
mov eax, dword [esp + 0x30]
movzx ebp, ax
lea eax, [ebp + 8]
push eax
call fcn.0042017d
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x407f18
mov ecx, esi
call fcn.004090e0
mov eax, 0xfffffff5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov al, byte [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov dl, byte [esp + 0x17]
mov byte [ebx + 1], al
mov eax, ecx
shr eax, 8
mov byte [esp + 0x21], al
mov byte [esp + 0x20], cl
movzx eax, word [esp + 0x20]
mov ecx, dword [esp + 0x28]
mov word [ebx + 2], ax
mov eax, ecx
shr eax, 8
mov byte [esp + 0x21], al
mov byte [esp + 0x20], cl
movzx eax, word [esp + 0x20]
mov ecx, dword [esp + 0x30]
mov word [ebx + 4], ax
mov eax, ecx
shr eax, 8
mov byte [esp + 0x21], al
mov byte [esp + 0x20], cl
movzx eax, word [esp + 0x20]
mov byte [ebx], dl
mov word [ebx + 6], ax
test dl, dl
js 0x407f88
push ebp
push dword [esp + 0x30]
lea eax, [ebx + 8]
push eax
call fcn.004182b0
add esp, 0xc
mov eax, dword [esp + 0x34]
mov dword [esi + 8], eax
mov dword [esi], edi
mov word [esi + 5], 0
mov dword [esi + 0x20], ebx
movzx eax, word [ebx + 6]
mov ecx, eax
mov dword [esi + 0x18], 0x407d90
and ecx, 0xffffff00
movzx eax, al
or ecx, eax
mov byte [esi + 4], 2
add ecx, 8
lea eax, [esp + 0x18]
mov dword [esi + 0x10], ecx
mov ecx, esi
mov dword [esi + 0x1c], eax
call fcn.00409560
mov ebx, eax
mov ecx, esi
test ebx, ebx
jns 0x407fe3
call fcn.004090e0
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
call fcn.00407dd0
cmp byte [esp + 0x17], 0
jge 0x408005
push dword [esi + 0x14]
mov eax, dword [esi + 0x20]
add eax, 8
push eax
push dword [esp + 0x34]
call fcn.004182b0
add esp, 0xc
mov ecx, dword [esi + 0xc]
cmp ecx, 6
ja case.default.0x408011
jmp dword [ecx*4 + 0x4080e0]
mov edi, dword [esi + 0x14]
mov ecx, esi
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffff9
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffff7
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffffc
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffff8
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
or edi, 0xffffffff
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
test edi, edi
je 0x4080b0
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x4080b2
xor eax, eax
push ecx
push str.unrecognised_status_code__d
push str.libusb_control_transfer
push 2
push eax
call fcn.00407c10
add esp, 0x14
mov ecx, esi
mov edi, 0xffffff9d
call fcn.004090e0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18