USB_UDE_Sample
USB_UDE_Sample copied to clipboard
build drivers
Hi I installed Visual Studio Enterprise 2017 with WDK then try to build the source but faced error [stampinf.exe is invalid] so i copied [stampinf.exe] from [C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\stampinf.exe] to [C:\Program Files (x86)\Windows Kits\10\bin\x86\stampinf.exe] so the error was fixed then try to rebuild and no errors appeared but the output log was:
1>------ Build started: Project: UDEFX2, Configuration: Debug ARM ------ 1>Building 'UDEFX2' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform. 1>Stamping ARM\Debug\UDEFX2.inf 1>Stamping [Version] section with DriverVer=06/19/2018,4.52.59.813 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
so i don't know what the error. could you please solve this problem to me or upload a ready compiled drivers on your PC ?
thanks in advance
Hello! You’re building for ARM, I think that’s the reason for the build break.
If you build Debug/x64, I think it will just work
Sent from my iPhone
On Jun 18, 2018, at 7:02 PM, breakersvd <[email protected]mailto:[email protected]> wrote:
Hi I installed Visual Studio Enterprise 2017 with WDK then try to build the source but faced error [stampinf.exe is invalid] so i copied [stampinf.exe] from [C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\stampinf.exe] to [C:\Program Files (x86)\Windows Kits\10\bin\x86\stampinf.exe] so the error was fixed then try to rebuild and no errors appeared but the output log was:
1>------ Build started: Project: UDEFX2, Configuration: Debug ARM ------ 1>Building 'UDEFX2' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform. 1>Stamping ARM\Debug\UDEFX2.inf 1>Stamping [Version] section with DriverVer=06/19/2018,4.52.59.813 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
so i don't know what the error. could you please solve this problem to me or upload a ready compiled drivers on your PC ?
thanks in advance
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fxxandy%2FUSB_UDE_Sample%2Fissues%2F6&data=02%7C01%7C%7C56e9f7e6b1674cf804d508d5d588b724%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636649705513660004&sdata=T%2BykVX099JAEhqKVLvmBOTkZgWphwCYJLZEAIpRxUiE%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARXBeSOpPOytjV1SaVse8BunCQufT7kkks5t-Fu2gaJpZM4Usu7T&data=02%7C01%7C%7C56e9f7e6b1674cf804d508d5d588b724%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636649705513660004&sdata=5AxC%2FN%2FM6jx4SfIr4zigWdTwX5KNuL%2BQy3tG2zeW2nE%3D&reserved=0.
Thanks for your respond, I changed to x64 but it is the same:
1>------ Build started: Project: UDEFX2, Configuration: Debug x64 ------ 1>Building 'UDEFX2' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform. 1>Stamping x64\Debug\UDEFX2.inf 1>Stamping [Version] section with DriverVer=06/19/2018,23.46.27.109 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What can i do ? @xxandy
Hi @xxandy Finally i compiled the project successfully, Now please i just want to know how to create a virtual usb devices with Hardware IDS.
Is the way to use installem.bat after edit it with PID value (devcon.exe) ?
Please i need it
Helllllllllllllo ! @xxandy
hey I'm so sorry I didn't get back, I've been busy with my day job. No need to get violent, dude.
First, you need to disable signature requirements by running these 2 commands within an admin window. *** Important: if you have bitlocker on, be sure to save your recovery key bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS bcdedit.exe -set TESTSIGNING ON Then reboot your system (if you have bitlocker on, it will ask you for your key)
Then you can just run installem.bat from an administrator command window. You will need to get devcon.exe from the DDK.
I'm very sorry for my words, Forgive me.
I already disabled signature verification and run the "installem.bat" script then i found UDEX Device in "Device Management"
But my question is how to create a custom USB device with specified PID & VID values.
ex. if i want to create this device:
USB\VID_04E8&PID_6860&REV_0400&ADB USB\VID_04E8&PID_6860&ADB USB\SAMSUNG_MOBILE&ADB USB\SAMSUNG_MOBILE&MI_03 USB\Vid_04E8&Pid_6860&MI_03 USB\Vid_04E8&Pid_6860&Class_FF&SubClass_42&Prot_01 USB\SAMSUNG_MOBILE&Class_FF&SubClass_42&Prot_01
Where must i put that values ?
I tried to edit "installem.bat" like this:
devcon.exe install hostude.inf "USB\VID_04E8&PID_6860&REV_0400&ADB" devcon.exe install hostude.inf "USB\VID_04E8&PID_6860&ADB" devcon.exe install hostude.inf "USB\SAMSUNG_MOBILE&ADB" devcon.exe install hostude.inf "USB\SAMSUNG_MOBILE&MI_03" devcon.exe install hostude.inf "USB\Vid_04E8&Pid_6860&MI_03" devcon.exe install hostude.inf "USB\Vid_04E8&Pid_6860&Class_FF&SubClass_42&Prot_01" devcon.exe install hostude.inf "USB\SAMSUNG_MOBILE&Class_FF&SubClass_42&Prot_01"
But all the above codes return with Failed result
So what i need to do to install virtual USB Device like that ?
I'm so sorry again, and thanks for answering. @xxandy
Any answer please @xxandy
Hi @breakersvd , You can't create a custom USB device with an arbitrary hardware ID. The hardware ID you pass as a parameter to devcon.exe must match the hardware id that is defined within hostude.inf (or whatever inf file you use). Please examine installem.bat and my inf files carefully - you will see that they have matching hardware ids.
So what is the solution to create a custom USB device (i already see Flexihub program using the same idea to create a virtual usb device)
some of my tests i found this installed in Device Manager
@xxandy
@breakersvd if you build the code in this repo and you use installem.bat without changing it at all, it will create a virtual USB device. You will see it in DeviceManager too.
That will be a test device, however, It only understand a few specific write/read requests, which are sent by the test application that builds together with this project.
So it is unclear to me what you are looking for. Are you perhaps trying to make the device perform a specific function? The code in this repo is not the solution for that.
@xxandy
all what i want is create device like this
@xxandy I'm waiting you my friend, Excuse me but i need that
@xxandy 😔
@breakersvd , what function do you want the device to perform? For example, do you want the device to act as a communication gateway to your Android phone? Do you want the device to write to a USB disk? That's the question I attempted to ask 10 days ago...
@xxandy Yes i want the device to be like a "SAMSUNG ADB Interface" as you see in the above photos,
some of my tries the virtual ADB device created successfully but it shows me Error Code 10
i have all device PID & VID and just want to create USB device with the SAME Values and same description
how to perform that by using INF files or anything else ?
Here is the real physical device:
And this is the virtual created device with Error Code 10:
thanks for answering
@breakersvd , you didn't really answer my question, which is key for me to giving you the correct answer.
I understand this: you want to create the device with the same description/pid/vid ans the Samsung ADB
I don't understand this: do you also want it to perform the same functions as the physical device? -> The answer I want from you is only "yes" (you want it to perform the functions) or "no" (you don't needed it to perform the functions).
If your answer is "yes":
- this GitHub project is not enough for your needs. You can't do that just by changing INF files. You would have to first reverse-engineer the device firmware (or its communication with the host), and then re-implement its logic inside the device-side version of this project (UDEFX2 sub-folder). This requires you to capture the USB traffic and then re-create it message by message (by changing the cpp and h files and recompiling them). It is a big job that requires both tools (USB analyzer) and experience, which you may or may not have.
If your answer is "no"
- Then the job is slightly easier. You still can't do it with just INF files. You'll have to debug the initialization problem you are having now by enabling trace, and recompile the h and cpp files so that they match the changes you made to the INF file. HOWEVER: I don't understand what purpose that virtual driver serves... if it lies about its identity and pid/vid, but doesn't perform the functions of the real device, then it is rather useless. In other words: if you don't need it to perform any specific function, you might as well leave the INF file alone, with the same description, VID and PID that I left in this GitHub project, by default.
I understand It's a lot of text above... please make an effort to go through it all, and ask me questions if any piece of it is unclear.
@xxandy Thanks for your info,
I thought this github repository give me what i want,
anyway My CLEAR request was a way to create a virtual device in the same way that this device does Flexihub
another question if you don't mind: how can i use the same INF files to create the same virtual USB device but with more than one Hardware ID not just one ID
Thanks for your answers and excuse me for my requests
@breakersvd I understand your request.
In theory, you can use this project as a starting point (I mean, really as a starting point) to do something like Flexihub. But you can't do that just by changing INF files, you would have to write a lot of C/C++ code to do two things:
- On one side (where physical device is connected), fake the USB host: USB_UDE_Sample can not help you with that. It's totally different code.
- On the other side (where virtual device is to appear), fake the USB device: USB_UDE_Sample is the starting point for that (for Windows platform anyway).
how can i use the same INF files to create the same virtual USB device but with more than one Hardware ID not just one ID?
I have never done this, so I can't really help you much. If I were to do it, I would just create multiple INF files, though.
@xxandy 1 - On the side that physical device is connected there is no problem i can control with it (open - close - send from/to) also i have an internet server to transfer data from PC to another.
2 - On the side that Virtual device must be created i need to exactly these things (Create Virtual USB device with exact description and PID & VID - codes to transfer data from/to it)
So now the number one object i have it For number 2 could you help me please to know what i need to do (codes, guide or links) ?
@breakersvd , are you sure you have #1 covered? having a server (open/close/send/rcv) is only one small part of the work. You must also create a filter driver for the physical USB controller on that PC, and intercept USB traffic to and from the physical device and convert that into TCP traffic for your server, so it goes over the network. All of this is very difficult, it is not the kind of thing I can guide you on a forum.
As for #2, you must create a TCP client, to handle the traffic of the USB servers, and then you change the code in USB_UDE_Sample to create a virtual device whenever a physical device enumerates on the other side. The VID/PID will not come from INF files at all, it will come from the network, sent by your "virtual" (filtered) USB controller on the #1 (Remote) side. Then you must continuously intercept all Usb Request over the network and send them to the virtual device.
The entire thing is very C++ intensive, and requires lots of knowledge about WDK and about the USB protocol. INF files are the least of your concern.
I don't think I can help you much in that regard. This is not specific advice or a question, it's more like doing project planning ....