Function at 0x5fe840
Capabilities:
Query environment variable
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x41c
mov edi, dword [esp + 0x430]
lea eax, [esp + 0x440]
mov dword [esp + 8], eax
lea ebp, [esp + 0x1c]
push 0x400
push 0
push ebp
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
add esp, 0xc
test edi, edi
jne 0x5fe87a
mov edi, dword [0x9b7180]
test edi, edi
jne 0x5fe884
mov edi, dword [0x9b7184]
mov ecx, dword [esp + 0x434]
test edi, edi
je 0x5fe89a
mov eax, dword [edi]
cmp eax, ecx
jae 0x5fe8d6
jmp case.0x5fe8e0.0
mov esi, ecx
push str.LIBUSB_DEBUG
call sub.api_ms_win_crt_environment_l1_1_0.dll_getenv
add esp, 4
test eax, eax
je 0x5fe8ca
push eax
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
add esp, 4
cmp eax, 4
mov ecx, 4
cmovl ecx, eax
xor eax, eax
test ecx, ecx
cmovg eax, ecx
jmp 0x5fe8cc
xor eax, eax
mov ecx, esi
cmp eax, ecx
jb case.0x5fe8e0.0
cmp ecx, 4
ja case.default.0x5fe8e0
mov ebx, str.error
jmp dword [ecx*4 + 0x8c3430]
mov ebx, str.warning
jmp case.0x5fe8e0.1
mov ebx, 0x8c3f48
jmp case.0x5fe8e0.1
mov ebx, 0x8c3f3d
jmp case.0x5fe8e0.1
mov ebx, str.debug
mov ecx, dword [esp + 0x43c]
mov edx, dword [esp + 0x438]
cmp eax, 4
jne 0x5fe94d
mov dword [esp + 4], 0
mov dword [esp], 0
cmp byte [0x9b717c], 0
jne 0x5fe9c6
mov byte [0x9b717c], 1
mov eax, dword [0x9b714c]
test eax, eax
je 0x5fe976
push str._timestamp___threadID__facility_level__function_call___message__n
push 4
push 0
call eax
jmp 0x5fe993
sub esp, 0x14
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], ebx
mov dword [esp], ebp
mov dword [esp + 8], str.libusb:__s___s_
mov esi, ecx
call fcn.006008f0
mov ecx, esi
add esp, 0x14
mov esi, eax
jmp 0x5fea65
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
push 1
push 0x40
push str._timestamp___threadID__facility_level__function_call___message__n
call fcn.005fe788
add esp, 0x10
mov eax, dword [0x9b714c]
test eax, eax
je 0x5fe9a9
push str._________________________________________________________________________________n
push 4
push 0
call eax
jmp 0x5fe9c6
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
push 1
push 0x51
push str._________________________________________________________________________________n
call fcn.005fe788
add esp, 0x10
mov eax, esp
push eax
call fcn.007584a0
add esp, 4
movq xmm1, qword [esp]
movq xmm0, qword [0x9b7170]
psubd xmm1, xmm0
pshufd xmm0, xmm1, 0x55
movd eax, xmm0
test eax, eax
jns 0x5fe9f7
paddd xmm1, xmmword [0x8c3420]
movdqu xmmword [esp + 0xc], xmm1
movq qword [esp], xmm1
pshufd xmm0, xmm1, 0x55
movd eax, xmm0
mov ecx, 0x10624dd3
imul ecx
mov esi, edx
mov eax, edx
shr eax, 0x1f
sar esi, 6
add esi, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
sub esp, 0x20
mov ecx, dword [esp + 0x458]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], esi
movups xmm0, xmmword [esp + 0x2c]
movss dword [esp + 0xc], xmm0
mov dword [esp], ebp
mov dword [esp + 8], str.__2ld._06ld____08x__libusb:__s___s_
call fcn.006008f0
add esp, 0x20
mov esi, eax
mov ecx, dword [esp + 0x43c]
xor eax, eax
cmp esi, 0x400
cmovae esi, eax
lea ebp, [esp + esi]
add ebp, 0x1c
mov ebx, 0x400
sub ebx, esi
lea eax, [esp + 0x440]
push eax
push ecx
push ebx
push ebp
call fcn.0052a2b0
add esp, 0x10
lea ecx, [esi + eax]
cmp ecx, 0x400
mov ecx, eax
cmovge ecx, ebx
test eax, eax
cmovs ecx, ebx
lea eax, [ecx + esi]
cmp eax, 0x3fe
lea eax, [ecx + esi - 0x3fe]
mov edx, 0
cmovb eax, edx
sub ecx, eax
mov word [ebp + ecx], 0xa
mov eax, dword [0x9b714c]
test eax, eax
je 0x5feae5
lea esi, [esp + 0x1c]
push esi
mov ebx, dword [esp + 0x438]
push ebx
push 0
call eax
mov ecx, ebx
test edi, edi
jne 0x5feb09
jmp case.0x5fe8e0.0
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
lea esi, [esp + 0x20]
push esi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fputs
add esp, 8
mov ecx, dword [esp + 0x434]
test edi, edi
je case.0x5fe8e0.0
mov eax, dword [edi + 8]
test eax, eax
je case.0x5fe8e0.0
push esi
push ecx
push edi
call eax
add esp, 0x41c
pop esi
pop edi
pop ebx
pop ebp
ret