Showing posts with label Mapping Drivers Windows. Show all posts

Using Mapping drivers

Using Mapping drivers

In the debugger, WinDbg has a special opportunity - mapping driver. The debugger can catch the moment of loading the driver on a test machine and loaded into the memory copy of the driver of the car developer. This ability saves the developer from the problem of copying the driver file on the test machine, and, of course, from forgetfulness.

First of all, you need to make to the development computer environment variables setting _NT_KD_FILES, where the value of this parameter should be the full path to a special map-file, for example, c: \ driver.map.
Next, you need to create a very map-file in the chosen direction with this content:
map
\?? \ C: \ 1 \ driver32.sys

C: \ project_path \ out \ debug \ driver32.sys
In the second line of the file must specify the path to the driver on the test machine (such as VmWare) as it appears in the registry of this service. In the third line should specify the path to the file on the development machine. Preferred to use the path to the directory where the build is going to chk-driver. Then each time you load the driver will be loaded to the new version.
In the debugger, the process of loading the driver of the car at the developer's test machine looks like this:
kd> g
KD: Accessing 'C: \ project_path \ out \ debug \ driver32.sys' (\?? \ C: \ 1 \ driver32.sys)

File size 91K ..................................

MmLoadSystemImage: Pulled \?? \ C: \ 1 \ driver32.sys from kd