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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x43c
mov eax, dword [esp + 0x450]
test eax, eax
je 0x4bec35
mov eax, dword [eax]
test eax, eax
je case.0x4becc1.0
cmp eax, 1
jle 0x4bec20
cmp eax, 2
jg 0x4bebff
cmp dword [esp + 0x454], 3
je case.0x4becc1.0
cmp eax, 3
jg 0x4bec58
cmp dword [esp + 0x454], 4
jne 0x4bec58
nop
add esp, 0x43c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esp + 0x454], 2
jne 0x4bebf0
add esp, 0x43c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x5bd1c4]
test eax, eax
jne 0x4bebe5
mov dword [esp], str.LIBUSB_DEBUG
call sym._getenv
test eax, eax
je case.0x4becc1.0
mov dword [esp], eax
call sym._atoi
jmp 0x4bebe7
xor ebx, ebx
cmp eax, 4
lea eax, [esp + 0x28]
sete bl
mov dword [esp + 4], 0
mov dword [esp], eax
call dbg.gettimeofday
test ebx, ebx
je 0x4bec86
mov edx, dword [0x5bd1c8]
test edx, edx
je 0x4bee21
mov eax, dword [esp + 0x2c]
mov edx, dword [0x5bd1d0]
cmp eax, edx
jl 0x4bedc4
mov ecx, dword [esp + 0x28]
sub ecx, dword [0x5bd1cc]
sub eax, edx
cmp dword [esp + 0x454], 4
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], ecx
ja case.default.0x4becc1
mov eax, dword [esp + 0x454]
jmp dword [eax*4 + 0x5936dc]
mov esi, str.warning
test ebx, ebx
je 0x4bede5
call dbg.usbi_get_tid
mov edi, dword [esp + 0x458]
mov dword [esp + 0x18], esi
lea esi, [esp + 0x30]
mov dword [esp + 8], str.__2d._06d____08x__libusb:__s___s_
mov dword [esp + 4], 0x400
mov dword [esp + 0x1c], edi
mov dword [esp], esi
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0xc], eax
call sym._snprintf.constprop.2
mov ebx, eax
cmp ebx, 0x3ff
ja 0x4bedd5
mov ebp, 0x400
mov edi, ebx
sub ebp, ebx
lea eax, [esi + ebx]
mov edx, dword [esp + 0x460]
mov byte [esp + ebx + 0x30], 0
mov dword [esp + 4], ebp
mov dword [esp], eax
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x45c]
mov dword [esp + 8], edx
call dbg.__mingw_vsnprintf
test eax, eax
mov edx, eax
js 0x4bed6a
lea eax, [ebx + eax]
cmp eax, 0x3ff
jle 0x4bed6f
mov edx, ebp
lea eax, [ebx + ebp]
lea ecx, [eax + 2]
cmp ecx, 0x3ff
jbe 0x4bed82
add edx, 0x3fe
sub edx, eax
add edx, edi
mov eax, 0xa
mov word [esi + edx], ax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp], esi
add eax, 0x40
mov dword [esp + 4], eax
call sym._fputs
jmp case.0x4becc1.0
mov esi, str.error
jmp 0x4beccd
mov esi, str.debug
jmp 0x4beccd
mov esi, str.info
jmp 0x4beccd
mov edi, dword [esp + 0x28]
add eax, 0xf4240
lea ecx, [edi - 1]
jmp 0x4bec9c
mov eax, esi
mov ebp, 0x400
xor edi, edi
xor ebx, ebx
jmp 0x4bed33
mov eax, dword [esp + 0x458]
mov dword [esp + 0xc], esi
lea esi, [esp + 0x30]
mov dword [esp + 8], str.libusb:__s___s_
mov dword [esp + 4], 0x400
mov dword [esp + 0x10], eax
mov dword [esp], esi
call sym._snprintf.constprop.2
mov ebx, eax
jmp 0x4bed1b
mov esi, str.unknown
jmp 0x4beccd
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x40
mov dword [esp + 4], 1
mov dword [esp], str._timestamp___threadID__facility_level__function_call___message__n
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [0x5bd1c8], 1
call sym._fwrite
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x51
mov dword [esp + 4], 1
mov dword [esp], str._________________________________________________________________________________n
add eax, 0x40
mov dword [esp + 0xc], eax
call sym._fwrite
jmp 0x4bec86