Jump to content
  • Advertisement
Sign in to follow this  
Ingrater

[WinApi] Ways of wirting to a usb device

This topic is 3347 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What ways are there to write to a usb device using the winapi? I know of the CreateFile, WriteFile method if you have the correct device name. Are there ways which don't use the CreateFile api call?

Share this post


Link to post
Share on other sites
Advertisement
You can use the User-mode driver framework to write a driver that runs in user-mode, or (more difficult, and not usually worth the bother - at least, not for USB devices) the Kernel-mode driver framework to write a kernel-mode driver.

Note that if you're using CreateFile already, then that means the device must already have a driver installed. A device can only have one driver at a time, so the above solutions won't work if there's already a driver installed for it.

Share this post


Link to post
Share on other sites
And all other methods invoke CreateFile WriteFile?

Because I hooked a app which is writing to a usb device. With a older version of the app it worked. But after a update it seems that the app is not longer using CreateFile / WriteFile for writing to that usb device. Could it be possible that the app is directly communicating with the device driver?

Share this post


Link to post
Share on other sites
Quote:
Original post by Ingrater
Because I hooked a app which is writing to a usb device. With a older version of the app it worked. But after a update it seems that the app is not longer using CreateFile / WriteFile for writing to that usb device. Could it be possible that the app is directly communicating with the device driver?

Why are you asking this?

The first comment seems like you were asking about how you programmed a USB device. That simple answer is that the device exposes an interface and you use it. It may be a file interface or some other stream, or it may operate as a file system, or as any number of HID devices like a mouse, flight yoke, or graphics tablet. The device drivers provide an interface and you use it.


The second comment seems like you are trying to hack a program that you don't have source for. That is a very different question, as the program may have expected just about any possible kind of interface.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ingrater
Because I hooked a app which is writing to a usb device. With a older version of the app it worked. But after a update it seems that the app is not longer using CreateFile / WriteFile for writing to that usb device. Could it be possible that the app is directly communicating with the device driver?
It's definitely possible, yes. It's hard to know. If they're using a custom driver, then there could be many different ways of communicating with it (limited only by the developer's imagination, really).

By the way, these forums aren't exactly friendly to people who discuss hacking or other things which may be illegal in certain justisdictions... you should probably clarify what you're trying to do before somebody gets heavy-handed :-)

Share this post


Link to post
Share on other sites
I just wanted to record all data which is send from a certain aplication to a certain usb device. I thougt that I'm allowed to do that as I'm also allowed to record the data output of my radio. Am I mistaken?

Would it be legal if I found out the protocoll of the device by brute force try and error?

Regards Ingrater

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!