Digg this topic Add to my del.icio.us Submit to SlashDot  
Reply to this topicStart new topic
> USB Vendor ID's - How to find manufacturer, USB Vid database
Rating 5 V
jaclaz
post Mar 1 2007, 07:24 PM
Post #1


Finder
***

Group: Advanced user
Posts: 1,185
Joined: 14-July 06
Member No.: 2


Italy


"pirates" down at msfn.org:
http://www.msfn.org/board/index.php?showto...3605&st=266
http://www.msfn.org/board/index.php?showto...3605&st=268

indirectly pointed me here:
http://www.usb.org/developers/tools

Where a file (usb.if) containing an "official" list of USB Vendors can be found:
http://www.usb.org/developers/tools/comp_dump

The list is supposedly maintained and kept up-to-date.

The format of the file usb.if is somewhat peculiar, so I wrote a small batch (Win2K/XP/2003 only) to convert it in a .csv file that can be opened/imported in any spreadsheet program, like OpenOffice.org or Excel.

CODE

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION

:: usbif2csv.cmd small batch file to convert file usb.if found here:
:: http://www.usb.org/developers/tools/
:: http://www.usb.org/developers/tools/comp_dump
::
:: that is a list of Vendor Id's (Vid) for USB devices
:: into a .csv file (directly importable in a spreadsheet)
::
:: by jaclaz http://home.graffiti.net/jaclaz:graffiti.net/
::
:: This file is licensed under my "CAREWARE" license
::


Set OriFILE=usb.if
Set DestFILE=usb.csv

IF NOT EXIST %OriFILE% (
More %~fx0 | FIND "::" | Find /V "More"
ECHO.
ECHO File usb.if NOT found!
PAUSE

GOTO:EOF
)

IF EXIST %DestFile% (
ECHO.
ECHO.
ECHO WARNING: File %DestFILE% will be deleted...
ECHO.
ECHO PRESS [CTRL+C] to keep it, any other key to go on.
PAUSE
del %DestFile%
)

For /F "tokens=1,* delims=^|" %%A in (%OriFILE%) DO (
CALL :ConvertBASE %%A
ECHO !HEXnum! %%B
ECHO "'!HEXnum!","%%B" >>%DestFile%
)
GOTO :EOF

:ConvertBASE
IF %1 gtr 65535 SET HEXnum=Out of Range &GOTO :EOF

SET /A Val4096=%1 / 4096
SET /A Mod4096=%1 %% 4096

SET /A Val256=%Mod4096% / 256
SET /A Mod256=%Mod4096% %% 256

SET /A Val16=%Mod256% / 16

SET /A Val1=%Mod256% %% 16

FOR %%C in (4096 256 16 1) DO CALL:HEXchar Val%%C

SET HEXnum=%Val4096%%Val256%%Val16%%Val1%
GOTO :EOF

:HEXchar
IF !%1!==10 SET %1=A
IF !%1!==11 SET %1=B
IF !%1!==12 SET %1=C
IF !%1!==13 SET %1=D
IF !%1!==14 SET %1=E
IF !%1!==15 SET %1=F
GOTO :EOF


For those interested in small batches, the file includes an easily reusable routine to convert from Decimal to Hex numbers.

Have fun. (IMG:http://www.boot-land.net/forums/style_emoticons/default/smile.gif)

jaclaz
Attached File(s)
Attached File  usbif2csv.zip ( 890bytes ) Number of downloads: 36
 
Go to the top of the page
 
+Quote Post
« Next Oldest · Submit your program · Next Newest »
 

Fast ReplyReply to this topicStart new topic

Members Who Viewed Topic Today ()

 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

RSS Lo-Fi Version Time is now: 2nd November 2007 - 10:24 PM

MKPortal ©2003-2006 mkportal.it