There are several programs for Windows that will extract the device drivers from a Windows installation [b]when[/b] Windows is running. I use Driver Genius myself.
This program works great at both extracting the devise drivers from an old installation and installing them on a new installation.
What I am looking at is about the same but I want to use Linux as the OS to extract the drivers from an HD in which the Windows installation is to badly damage, infected, whatever, to either boot or safely boot.
Because I came name three programs that can do this with a running Windows installation, I am forced to the conclusion that the information is contained in the registry. Meaning that I should be able to Linux to load and scan the registry to determine the drivers, determine their load order, and pack them into a self installing executable.
I have looked at the open source offerings and can find nothing that can do this. The key is to determine where in the registry these files are listed. MSDN itself offers no relevant help for many of the files. Although some can be found in HKLM\HARDWARE\*, not all of them can be. Even when the files are listed in the registry, the file names often are not, but they have to be there somewhere.