[原创]The simplest Windows driver written in rust
2023-6-26 11:18:0 Author: bbs.pediy.com(查看原文) 阅读量:15 收藏

Study rust in Windows kernel mode driver


建立本仓库的目的:
1.学习rust在Windows驱动编程上的应用。
2.WDK里的数据结构和函数原型是以C/CPP语言提供的,尽管有win32metadata和windows-rs,wdkmetadata这些仓库,但是还不熟悉和完善。
3.所以此仓库不涉及routine/api及相关sdk里的结构的使用,即使使用,也不是重点,是辅助。
4.所以,这个仓库是rust的基本用法,如:字符串等。
5.当然,这也为ida分析rust写的sys提供了条件。


摘自:https://users.rust-lang.org/t/win32-no-std-no-main-no-libc/30038/2

编译命令:cargo build

注意:编译出的文件是DLL,后缀改为SYS即可。

编译驱动这么简单。

13:57 2022/12/30


windbg调试截图:
本地路径

ida的分析截图:
本地路径
注释:默认情况下ida会忽略显示一些函数,如:系统,库,编译器等的特殊函数。


联系作者:
https://twitter.com/112426112Correy
https://github.com/kouzhudong

参考信息:
https://not-matthias.github.io/posts/kernel-driver-with-rust/ 需要:cargo install cargo-xbuild
https://codentium.com/guides/windows-dev/windows-drivers-in-rust-hello-world/ 需要:cargo install --force cargo-make,且对系统依赖严重,而且还nightly

微软的WDK相关的rust:
https://github.com/microsoft/win32metadata
https://github.com/microsoft/windows-rs
https://github.com/microsoft/wdkmetadata

冰蝎,蚁剑Java内存马查杀防御技术

最后于 2023-6-26 11:27 被correy编辑 ,原因: 还得特别的添加附件。

上传的附件:
  • WinDrv.zip (139.58kb,6次下载)

文章来源: https://bbs.pediy.com/thread-277769.htm
如有侵权请联系:admin#unsafe.sh