Function at 0x4b6350
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 0x4b63b5
mov eax, dword [eax]
test eax, eax
je case.0x4b6441.0
cmp eax, 1
jle 0x4b63a0
cmp eax, 2
jg 0x4b637f
cmp dword [esp + 0x454], 3
je case.0x4b6441.0
cmp eax, 3
jg 0x4b63d8
cmp dword [esp + 0x454], 4
jne 0x4b63d8
nop
add esp, 0x43c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esp + 0x454], 2
jne 0x4b6370
add esp, 0x43c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x5b2284]
test eax, eax
jne 0x4b6365
mov dword [esp], str.LIBUSB_DEBUG
call sub.msvcrt.dll_getenv
test eax, eax
je case.0x4b6441.0
mov dword [esp], eax
call sub.msvcrt.dll_atoi
jmp 0x4b6367
xor ebx, ebx
cmp eax, 4
lea eax, [esp + 0x28]
sete bl
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.004d8f00
test ebx, ebx
je 0x4b6406
mov edx, dword [0x5b2288]
test edx, edx
je 0x4b65a1
mov eax, dword [esp + 0x2c]
mov edx, dword [0x5b2290]
cmp eax, edx
jl 0x4b6544
mov ecx, dword [esp + 0x28]
sub ecx, dword [0x5b228c]
sub eax, edx
cmp dword [esp + 0x454], 4
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], ecx
ja case.default.0x4b6441
mov eax, dword [esp + 0x454]
jmp dword [eax*4 + 0x58807c]
mov esi, str.warning
test ebx, ebx
je 0x4b6565
call fcn.004bdd60
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 fcn.004b5f50
mov ebx, eax
cmp ebx, 0x3ff
ja 0x4b6555
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 fcn.004e0d90
test eax, eax
mov edx, eax
js 0x4b64ea
lea eax, [ebx + eax]
cmp eax, 0x3ff
jle 0x4b64ef
mov edx, ebp
lea eax, [ebx + ebp]
lea ecx, [eax + 2]
cmp ecx, 0x3ff
jbe 0x4b6502
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 sub.msvcrt.dll_fputs
jmp case.0x4b6441.0
mov esi, str.error
jmp 0x4b644d
mov esi, str.debug
jmp 0x4b644d
mov esi, str.info
jmp 0x4b644d
mov edi, dword [esp + 0x28]
add eax, 0xf4240
lea ecx, [edi - 1]
jmp 0x4b641c
mov eax, esi
mov ebp, 0x400
xor edi, edi
xor ebx, ebx
jmp 0x4b64b3
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 fcn.004b5f50
mov ebx, eax
jmp 0x4b649b
mov esi, str.unknown
jmp 0x4b644d
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 [0x5b2288], 1
call sub.msvcrt.dll_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 sub.msvcrt.dll_fwrite
jmp 0x4b6406