Page 1 of 1

[CLOSED] Getting firmware from a Windows driver?

Posted: 2017-03-19 07:09
by edbarx
Hi, at the moment I am trying to make a USB digital oscilloscope work under wine. I was able to install and now also run its graphical interface, but I cannot use the device as its Windows drivers cannot be used under wine. WineHQ states that wine does not use hardware directly as that would require it to access kernel space. Searching I have learnt that a Windows driver can be used by directly calling rundll32. But my impression is this individual is running wine as root which is something I do NOT want to do.

My logic tells me to rely on what WineHQ states about wine's capability to use or not use a Windows driver. I found that there is some way of extracting the hardware firmware from Windows hardware drivers.

Can anyone help me?

Re: Getting firmware from a Windows driver?

Posted: 2017-03-19 15:01
by pendrachken
Not sure if this is exactly what you are looking for but:

You can extract the "driver" from the *.exe installer with 7zip, and then the payloads are GENERALLY in the .cab files, which should also be extractable with 7zip.

Depending on what the driver actually does, I.E. just provide an abstraction layer ( service that listens for device ID and data ) for default kernel calls that WINE can also use it may be usable. BUT, if the driver actually integrates into the NT kernel like a Linux kernel module into the kernel, WINE will not be able to use it.

You will probably have MUCH better luck with a good Windows VM and device ( serial / parallel / USB ) passthrough.

Re: Getting firmware from a Windows driver?

Posted: 2017-03-19 22:23
by phenest
I learnt a trick once but it does require the use of Windows.

Start Windows, then start the driver installer. The installer should pause at the beginning because it's decompressing the contents. When that's done, leave the installer open and browse to the Temp directory which is a hidden folder in the Users' directory. In there will be a folder that will have the entire contents of what the installer decompressed. Copy that folder to somewhere else and then close the installer. You should then have everything you need.

Re: Getting firmware from a Windows driver?

Posted: 2017-03-20 09:19
by edbarx
It seems the first step at driver recognition is achieved if I am not mistaken. This is unfamiliar territory for me. Using ndiswrapper to attempt to use the Windows XP drivers, I got the following:

Code: Select all

root@edbarx-pc3:/home/edbarx# ndiswrapper -l
hantek6000b : driver installed
	device (04B5:6CDE) present
The Vendor ID agrees with what it should be. The next step is writing a .rules file for udev to provide a device node.

Re: Getting firmware from a Windows driver?

Posted: 2017-03-23 07:28
by millpond
edbarx wrote:Hi, at the moment I am trying to make a USB digital oscilloscope work under wine. I was able to install and now also run its graphical interface, but I cannot use the device as its Windows drivers cannot be used under wine. WineHQ states that wine does not use hardware directly as that would require it to access kernel space. Searching I have learnt that a Windows driver can be used by directly calling rundll32. But my impression is this individual is running wine as root which is something I do NOT want to do.

My logic tells me to rely on what WineHQ states about wine's capability to use or not use a Windows driver. I found that there is some way of extracting the hardware firmware from Windows hardware drivers.

Can anyone help me?
I dont know if this will simplify anything, but you should be able to run rundll.exe as:

/usr/lib/i386-linux-gnu/wine/fakedlls/rundll32.exe

It should run normally, as it is not a Win executable. It is a Wine spoof.

If root is somehow required, just create a wine 'bottle' or prefix, and with winetricks or playonlinux install the program direectly into it. It would contain basically only the oScope files.

I have a Tektronix on the workbench, but would love to have a scope on the system here. What are you using?

Re: Getting firmware from a Windows driver?

Posted: 2017-03-25 12:10
by edbarx
Using virtualisation of Windows XP under QEMU was next to useless. Graphics could be seen lagging, resolution was poor, dragging windows was a pain, etc. So, in short, I had to install Windows 8.1 to get the oscilloscope working as it should.

I will mark the thread as closed, not solved, as that would be misleading. I wish I could use Linux, which is the OS of choice for me, but this time, I had to make friends with the devil, so to speak.

If anyone knows of a solution that can make Linux, the kernel, recognize Hantek USB oscilloscopes, that would be very nice news to me.

Re: [CLOSED] Getting firmware from a Windows driver?

Posted: 2017-03-25 13:05
by pylkko
perhaps you already tried this, perhaps this does not pertain to the model that you have, however, I just googled "hantek usb oscillatoscope linux" and there were many guides about how to use hantek usb osciallatoscopes with linux. There is even a github hosting something called "openhantek", which apparently is a linux module for hantel devices. Other guides described how to get windows drives to work natively on linux, but they might be identical to what you already tried...?

https://github.com/OpenHantek/openhantek
http://openhantek.org/
https://flyingcarsandstuff.com/2016/03/ ... ith-linux/

etc

Re: [CLOSED] Getting firmware from a Windows driver?

Posted: 2017-03-25 16:26
by edbarx
pyllko, what is wrong with you? Why use that tone? :? phyllko, if there are some unsettled waters between us, please speek up.

Yes, I downloaded some code that after a whole week of attempts I compiled into an executable that displayed an interface but I couldn't make the driver work notwithstanding I wasted many hours spanned over several days of vain attempts. After a whole week, I decided it was time to use what is known to work. In my case, attempting to compile the source was a real pain. This project is a dead project from 2011. What I did was more like an attempt at resurrecting something that experienced Linux hackers didn't succeed to do and are still failing to succeed. Here, I am writing about cracking the Windows drivers to make them work under Linux.

Re: [CLOSED] Getting firmware from a Windows driver?

Posted: 2017-03-25 16:52
by mor
edbarx wrote:pyllko, what is wrong with you? Why use that tone? :? phyllko, if there are some unsettled waters between us, please speek up.
What tone? :shock:

Re: [CLOSED] Getting firmware from a Windows driver?

Posted: 2017-03-26 05:08
by edbarx
mor wrote:
edbarx wrote:pyllko, what is wrong with you? Why use that tone? :? phyllko, if there are some unsettled waters between us, please speek up.
What tone? :shock:
Sorry, too late. I have another lawyer. :P