win7 虚拟机不能安装vm tools
vs2015支持模板导出,也可以选择制作自己的模板
创建first
目录,在此目录中创建三个文件
first.c
TARGETNAME表示名字,编译出来之后模块的名字first.sys
SOURCES表示要编译的.c文件
可能有下列情况,先尝试直接安装,直接安装不成功或者看报错信息在选择执行情况1或情况2
情况1:有可能安装IE11
需要补丁,补丁链接如下
情况2安装证书:
在win10系统上Windows键+R 弹出运行
对话框,输入certmgr.msc
,打开Windows的证书管理器
导出如下证书安装在win7系统上
32位支持内联asm汇编
64位利用在Source文件中直接添加asm文件,直接在asm文件中写汇编代码,然后将asm文件编译为OBJ文件。然后就可以在c++文件中声明asm文件中的函数后直接使用asm文件中用汇编写的函数
64位也可使用 DbgBreakPoint();
win7 x64安装驱动需要签名,这里使用64Signer
VOID DriverUnload(PDRIVER_OBJECT driver){
DbgPrint(
"first:Our driver is unloading\r\n"
);
}
NTSTATUS DriverEntry(PDRIVER_OBJECT driver,PUNICODE_STRING reg_path){
DbgPrint(
"first:Our hello my salary\r\n"
);
driver
-
>DriverUnload
=
DriverUnload;
return
STATUS_SUCCESS;
}
VOID DriverUnload(PDRIVER_OBJECT driver){
DbgPrint(
"first:Our driver is unloading\r\n"
);
}
NTSTATUS DriverEntry(PDRIVER_OBJECT driver,PUNICODE_STRING reg_path){
DbgPrint(
"first:Our hello my salary\r\n"
);
driver
-
>DriverUnload
=
DriverUnload;
return
STATUS_SUCCESS;
}
!IF
0
Module Name:
makefile .
Notes:
DO NOT EDIT THIS
FILE
!!!
!ENDIF
!INCLUDE $(NTMAKEENV)\makefile.
def
!IF
0
Module Name:
makefile .
Notes:
DO NOT EDIT THIS
FILE
!!!
!ENDIF
!INCLUDE $(NTMAKEENV)\makefile.
def
TARGETNAME
=
first
TARGETTYPE
=
DRIVER
SOURCES
=
first.c
TARGETNAME
=
first
TARGETTYPE
=
DRIVER
SOURCES
=
first.c
net start first \\启动驱动
net stop first \\停止驱动
sc delete first \\卸载驱动
net start first \\启动驱动
net stop first \\停止驱动
sc delete first \\卸载驱动
32
位
http:
/
/
www.microsoft.com
/
zh
-
cn
/
download
/
internet
-
explorer.aspx
64
位
http:
/
/
www.microsoft.com
/
zh
-
cn
/
download
/
details.aspx?
id
=
45154
32
位
http:
/
/
www.microsoft.com
/
zh
-
cn
/
download
/
internet
-
explorer.aspx
64
位
http:
/
/
www.microsoft.com
/
zh
-
cn
/
download
/
details.aspx?
id
=
45154
1.Microsoft
Root Certificate Authority
2010
;
2.Microsoft
Root Certificate Authority
2011
;
3.COMODO
RSA Certification Authority;
1.Microsoft
Root Certificate Authority
2010
;
2.Microsoft
Root Certificate Authority
2011
;
3.COMODO
RSA Certification Authority;
bcdedit
/
copy {current}
/
d
"Windwos7"
bcdedit
/
copy {current}
/
d
"Windwos7"
bcdedit
/
debug ON
bcdedit
/
bootdebug ON
bcdedit
/
debug ON
bcdedit
/
bootdebug ON
VOID DriverUnload(PDRIVER_OBJECT driver) {
DbgPrint(
"first:Our driver is unloading\r\n"
);
}
NTSTATUS DriverEntry(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path) {
DbgBreakPoint();
DbgPrint(
"first:Our hello my salary\r\n"
);
driver
-
>DriverUnload
=
DriverUnload;
return
STATUS_SUCCESS;
}
VOID DriverUnload(PDRIVER_OBJECT driver) {
DbgPrint(
"first:Our driver is unloading\r\n"
);
}
NTSTATUS DriverEntry(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path) {
DbgBreakPoint();
DbgPrint(
"first:Our hello my salary\r\n"
);
driver
-
>DriverUnload
=
DriverUnload;
return
STATUS_SUCCESS;
}
symchk.exe
/
r c:\windows\system32\
/
s SRV
*
C:\Users\test\Desktop\symblos\
*
http:
/
/
msdl.microsoft.com
/
download
/
symbols
-
/
r c:\windows\system32\ 下载system32下的符号
-
SRV
*
C:\Users\test\Desktop\symblos\ 下载符号的保存路径
-
http:
/
/
msdl.microsoft.com
/
download
/
symbols 微软的符号服务器
symchk.exe
/
r c:\windows\system32\
/
s SRV
*
C:\Users\test\Desktop\symblos\
*
http:
/
/
msdl.microsoft.com
/
download
/
symbols
-
/
r c:\windows\system32\ 下载system32下的符号
-
SRV
*
C:\Users\test\Desktop\symblos\ 下载符号的保存路径
-
http:
/
/
msdl.microsoft.com
/
download
/
symbols 微软的符号服务器
C:\Users\test\Desktop\code\test\first6\x64\Checked_win7;srv
*
C:\Users\test\Desktop\symblos
*
http:
/
/
msdl.microsoft.com
/
download
/
symbols
C:\Users\test\Desktop\code\test\first6\x64\Checked_win7;srv
*
C:\Users\test\Desktop\symblos
*
http:
/
/
msdl.microsoft.com
/
download
/
symbols
1
2
3
4
5
6
7
8
9
10
11
12
|
VOID DriverUnload(PDRIVER_OBJECT driver){
DbgPrint( "first:Our driver is unloading\r\n" );
}
NTSTATUS DriverEntry(PDRIVER_OBJECT driver,PUNICODE_STRING reg_path){
DbgPrint( "first:Our hello my salary\r\n" );
driver - >DriverUnload = DriverUnload;
return STATUS_SUCCESS;
}
|
1
2
3
4
5
6
7
|
!IF 0
Module Name:
makefile .
Notes:
DO NOT EDIT THIS FILE !!!
!ENDIF
!INCLUDE $(NTMAKEENV)\makefile. def
|
1
2
3
|
TARGETNAME = first
TARGETTYPE = DRIVER
SOURCES = first.c
|
1
2
3
|
net start first \\启动驱动
net stop first \\停止驱动
sc delete first \\卸载驱动
|
1
2
3
4
5
6
7
|
32 位
http: / / www.microsoft.com / zh - cn / download / internet - explorer.aspx
64 位
http: / / www.microsoft.com / zh - cn / download / details.aspx? id = 45154
|
1
2
3
4
5
|
1.Microsoft Root Certificate Authority 2010 ;
2.Microsoft Root Certificate Authority 2011 ;
3.COMODO RSA Certification Authority;
|
1 |
bcdedit / copy {current} / d "Windwos7"
|
1
2
|
bcdedit / debug ON
bcdedit / bootdebug ON
|
1
2
3
4
5
6
7
8
9
10
11
|
VOID DriverUnload(PDRIVER_OBJECT driver) {
DbgPrint( "first:Our driver is unloading\r\n" );
}
NTSTATUS DriverEntry(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path) {
DbgBreakPoint();
DbgPrint( "first:Our hello my salary\r\n" );
driver - >DriverUnload = DriverUnload;
return STATUS_SUCCESS;
}
|
1
2
3
4
5
|
symchk.exe / r c:\windows\system32\ / s SRV * C:\Users\test\Desktop\symblos\ * http: / / msdl.microsoft.com / download / symbols
- / r c:\windows\system32\ 下载system32下的符号
- SRV * C:\Users\test\Desktop\symblos\ 下载符号的保存路径
- http: / / msdl.microsoft.com / download / symbols 微软的符号服务器
|
1 |
C:\Users\test\Desktop\code\test\first6\x64\Checked_win7;srv * C:\Users\test\Desktop\symblos * http: / / msdl.microsoft.com / download / symbols
|
- 因最近需要编写一些xp与win7上的驱动程序,但是网上搜索环境配置要不就很老旧,要不很繁琐,最好还是能双虚拟机调试,在网上没有找到能完全满足需求的,就整合网上的一些资源编写此文档。
- 主要内容为使用vmware 双win7虚拟机调试、win7安装vs2015、使用驱动模板编译win7与xp驱动
-
创建first
目录,在此目录中创建三个文件
-
first.c
[注意]APP应用上架合规检测服务,协助应用顺利上架!