Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently was given a small USB flash drive as an advertising gimmick. When I plug it in, only one drive appears: a CD drive with 42kb used (just an autorun.inf file which launches the manufacturer's website). I know U3 drives also appear as CD drives, but their uninstall utility only works for their own drives.

How can I make it appear as a USB drive instead? Conversely, if I wanted to do the same thing for myself, how would I make it appear as a CD drive?

I'm sure it can be done programmatically, or else the uninstall program wouldn't work.

share|improve this question

migrated from stackoverflow.com Sep 23 '11 at 17:49

This question came from our site for professional and enthusiast programmers.

    
This is probably due to the drivers for the actual drive its self. –  Tom Anderson Jan 10 '09 at 18:11
    
You're saying it's hopeless unless I write my own drivers? –  mmyers Jan 10 '09 at 18:14
    
it is related. More to embedded programming of the device, but still programming. –  Ilya Jan 11 '09 at 11:44
    
Haven't had time to check into any of these answers; I'll check back next week, I hope. –  mmyers Jan 18 '09 at 5:02
    
...or not. (The drive is still plugged in, I just still haven't had time to mess with it.a) –  mmyers Apr 10 '09 at 21:59

3 Answers 3

This is done in hardware. The device identifies as a composite device containing two children - one for the CD drive and one for the removable storage drive.

share|improve this answer
    
Unfortunately, there isn't even a removable storage drive shown. –  mmyers Jan 10 '09 at 18:51
    
By "hardware", do you mean the actual circuitry or the firmware? –  mmyers Jan 10 '09 at 18:51
    
Firmware and/or drivers. –  Mihai Limbăşan Jan 10 '09 at 19:34
2  
Drivers usually don't play a part here since the generic OS storage drivers are used (you don't have to install anything to use U3 drives). –  On Freund Jan 10 '09 at 20:52
    
They can very much play a part - for example most composite devices (think 3G/HDSPA stick which contains a "CD drive" with the software) aren't fully recognized by the OS until they install an USB enumerator for their IDs. –  Mihai Limbăşan Jan 12 '09 at 16:36

Ok, there is 2 questions here :

1) How can I make it appear as a USB drive instead?

It's depends on device itself. I can see 2 options.

  • Device support writing, but represent itself as CDROM and read only. In this case you just need to tweak the device descriptor and you will get working storage device.
  • Device does not implement write and nothing can be done.

By tweaking device descriptor i mean filter driver that will receive device descriptor and will pass a modified one to Windows. Writing filter driver is not very hard and you can find an examples of filter driver in Driver development Kit. A basic understanding of USB protocol will be needed as well.

2) Conversely, if I wanted to do the same thing for myself, how would I make it appear as a CD drive?

Basically same, filter driver that will change the device descriptor to be recognized by CDROM device, but in additional once Windows will recognize CDROM it will send additional SCSI commands to device. Ideally device will just return unsupported command and it's OK, but from my experience most devices are not generic enough and the behavior will be undefined. In this case you will need additional filter driver that will catch this additional commands and will complete the commands without actually sending them to device.

P.S
My answer assume that you don't have access to device firmware, If you do have access to firmware it's really easy to accomplish by modifying device descriptor and making sure that not supported commands are handled correctly.

P.P.S
I don't provide any links to resources since i don't think that practically you going to implement this. If I'm wrong let me know and i will provide relevant resources. Ok one link with general information

share|improve this answer
    
Windows will load different drivers depending on the storage type (Disk.sys and its relevant filters for USB driver, and cdrom.sys and its relevant filters for a CD). I'm not sure that fooling the OS into loading a different driver stack is a good idea. –  On Freund Jan 13 '09 at 12:51
    
I did not tested it. But based on my long experience with USB and device drivers i can't see any reason why it's might not work. Any way it's the only way to do it without changing the hardware ... –  Ilya Jan 14 '09 at 8:48
    
It isn't really related to USB layer but to the storage layer. I'm not sure that DISK.sys (not to mention any 3rd party filters it might have on that machine) will gracefully handle devices that should be handled by CDROM.sys –  On Freund Jan 14 '09 at 11:24
    
There is almost no differences on device side between regular usb flash disk or usb cdrom, filter i suggest is below disk.sys or cdrom.sys layer i,e at usb layer, this filter should eliminate this difference again hard to argue without testing, but can't see how it can affect something ... –  Ilya Jan 15 '09 at 7:55
    
As I said, disk.sys and cdrom.sys have different filters (some of them could be 3rd party) that might rely on specific behavior. Of course you can have a PnP filter to change device identification (or just create an INF file for that device), but you can't guarantee how these filters will behave. –  On Freund Jan 15 '09 at 13:18

Hey guy, I have done with my usb FD serveral times to make it into 2 devices CD and usb. The only thing you must do is download chipgenius then run it,wait for it to identify your usb then go to http://flashboot.ru/files/ search your usb firmware tool. If you get the correct one i'm sure there will be no problem. I had done that and turned my usb into hiren boot cdrom, and when boot from bios you no longer choose your usb name but choose usb-cdrom option.

share|improve this answer
3  
Interesting, but frankly the .ru domain scares me. Is there any other alternative? –  mmyers Dec 22 '09 at 15:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.