Function at 0x407650
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x41c
push ebx
push esi
push edi
mov edi, ecx
mov ebx, edx
test edi, edi
je 0x40766b
mov eax, dword [edi]
jmp 0x4076a2
mov eax, dword [0x42108c]
test eax, eax
jns 0x4076a2
push str.LIBUSB_DEBUG
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
add esp, 4
test eax, eax
je 0x4076a0
push eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
add esp, 4
test eax, eax
js 0x4076a0
mov ecx, 4
cmp eax, ecx
cmovg eax, ecx
jmp 0x4076a2
xor eax, eax
cmp eax, ebx
jl case.0x4076af.0
cmp ebx, 4
ja case.default.0x4076af
jmp dword [ebx*4 + 0x4078ac]
mov esi, str.error
jmp 0x4076d7
mov esi, str.warning
jmp 0x4076d7
mov esi, str.info
jmp 0x4076d7
mov esi, str.debug
jmp 0x4076d7
mov esi, str.unknown
cmp eax, 4
jne 0x4077c7
cmp dword [0x421554], 0
jne 0x407753
mov eax, dword [0x4215b0]
mov dword [0x421554], 1
test eax, eax
je 0x407709
push str._timestamp___threadID__facility_level__function_call___message__n
push 4
push 0
call eax
jmp 0x407723
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
push str._timestamp___threadID__facility_level__function_call___message__n
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
add esp, 8
mov eax, dword [0x4215b0]
test eax, eax
je 0x407739
push str._________________________________________________________________________________n
push 4
push 0
call eax
jmp 0x407753
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
push str._________________________________________________________________________________n
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
add esp, 8
lea ecx, [esp + 0x18]
call fcn.0040bae0
mov eax, dword [esp + 0x18]
sub eax, dword [0x4215b8]
mov edx, dword [esp + 0x20]
sub edx, dword [0x4215c0]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
jns 0x40778b
sub eax, 1
add edx, 0x3b9aca00
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push dword [ebp + 8]
push esi
push eax
mov eax, 0x10624dd3
imul dword [esp + 0x20]
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
push eax
push dword [esp + 0x20]
lea eax, [esp + 0x3c]
push str.__2ld._06ld____08x__libusb:__s___s_
push 0x400
push eax
call fcn.00401010
add esp, 0x20
jmp 0x4077e2
push dword [ebp + 8]
lea eax, [esp + 0x2c]
push esi
push str.libusb:__s___s_
push 0x400
push eax
call fcn.00401010
add esp, 0x14
mov esi, eax
test esi, esi
js 0x4077f0
cmp esi, 0x400
jl 0x4077f2
xor esi, esi
push dword [ebp + 0x10]
mov eax, 0x400
push 0
push dword [ebp + 0xc]
sub eax, esi
push eax
mov dword [esp + 0x20], eax
lea eax, [esp + 0x38]
add eax, esi
push eax
call fcn.00401000
mov ecx, dword [eax]
push dword [eax + 4]
or ecx, 2
push ecx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___stdio_common_vsprintf]
mov edx, eax
add esp, 0x1c
or eax, 0xffffffff
test edx, edx
cmovs edx, eax
test edx, edx
js 0x40783d
lea ecx, [edx + esi]
cmp ecx, 0x400
jl 0x407841
mov edx, dword [esp + 0x10]
lea eax, [edx + 2]
mov ecx, 0x3fe
add eax, esi
sub ecx, esi
cmp eax, 0x400
mov eax, 0xa
cmovl ecx, edx
add ecx, esi
mov word [esp + ecx + 0x28], ax
mov eax, dword [0x4215b0]
test eax, eax
je 0x407876
lea ecx, [esp + 0x28]
push ecx
push ebx
push 0
call eax
jmp 0x407890
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
add esp, 8
test edi, edi
je case.0x4076af.0
mov eax, dword [edi + 8]
test eax, eax
je case.0x4076af.0
lea ecx, [esp + 0x28]
push ecx
push ebx
push edi
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret