My device is connecting via USB

I have a device and drivers for this device. I would like to create an application that mocks a USB device to communicate with a third-party application.

In particular, I'm trying to create an application that can mock a USB device that mimics Microsoft Zune. I want to make my application register as a zune device and then communicate with the client. I added several DLLs to my application to try to identify calls that tell the software that the connected device is a legit zune, but so far I have not been very lucky.

I am new to this type of development - it imitates hardware devices and I am not very versed in importing dlls that were written in C / C ++. I am using Visual Studio 2010 (.net 4.0) to develop my application, and I would appreciate any help someone could offer me to imitate the hardware. I have device drivers that Visual Studio refuses to reference directly. I also have a physical device, so I can see which drivers it uses in the device manager.

The goal is as follows:

  • The application registers as a USB device, simulating Microsoft Zune in the same way that Virtual Clone Drive simulates a DVD player.
  • The application is recognized by the zune client as a valid microsoft zune.
  • Zune software works with the application because it is a hardware device (synchronization, etc.)
+4
source share
2 answers

Can I replace the DLLs used by the zune client software with my own DLLs? In this case, you can wrap the source DLLs with your DLLs and intercept the operations.

Update: To find out the function signatures in the DLL, see the Dependency Walker tool, which lists the exported functions (and a lot of other information). I assume that you will want to write your replacement DLL for C.


Otherwise, you will have to write drivers that register the USB device with the corresponding endpoints. I'm not sure how to do this on Windows - I only did USB encoding on the firmware side, not on the driver side. You should be able to use any tutorial to create a USB driver for Windows, for example, Getting started with a USB driver

Zune spec information may also be helpful. Perhaps this blog post and its sequels may help: Inside Zune / USB Protocol: Part 1

+2
source

I just found something called Device Simulation Framework , which may be exactly what you need. However, significant research will still be required on how USB works to complete your solution. And, probably, it is still usually executed using C or C ++.

Zune uses a modified version of the MTP protocol called MTPZ, but I found this example using a device modeling platform to simulate a regular MTP device. It is called the MTP Device Simulator . I can’t tell if the source code is available.

+3
source

All Articles