WinIO3.0调用键盘实践-winxp、win7、win10下32位64位都适用

WinIO3.0:最新版Windows低级I/O操作库 WinIO 3.0是针对Windows操作系统设计的一套高级I/O库,它允许开发者直接与计算机硬件进行交互,绕过常规操作系统提供的限制。这种能力在需要高性能和即时硬件访问的应用中尤为关键,比如游戏、实时系统和数据采集领域。硬件开发调试过程中,正确选择和使用调试工具至关重要。硬件调试工具主要分为两类:软件工具和硬件工具。软件工具包括了各种模拟器、调试器、分析器和性能测试工具;而硬件工具通常指的是逻辑分析仪、示波器、JTAG调试器等。 阅读详情

目录

 

准备

步骤

第一步:Windows系统开启测试模式(针对64位系统,32系统不需要)

第二步:WinIo64.sys安装签名(针对64位系统,32系统不需要)

第三步:Java代码及c++代码实现

 第四步:执行代码


准备

开发环境:winxp、win7、win10 32位及64位

开发语言:Java和c++

必要文件:WinIo32.dll、WinIo64.dll、WinIo32.sys、WinIo64.sys

步骤

(注:有些步骤的详细做法非常简单,如果不明白请问度哥)

第一步:Windows系统开启测试模式(针对64位系统,32系统不需要)

开启测试模式:cmd执行命令:bcdedit /set testsigning on 然后重启,电脑右下角出现测试模式......

关闭测试模式:cmd执行命令:bcdedit /set testsigning off 然后重启,电脑右下角测试模式消失

参考链接如下:

win10:https://jingyan.baidu.com/article/72ee561a724b74e16138df1c.html
win7、winxp:https://jingyan.baidu.com/article/acf728fd21c3e7f8e510a3ef.html

第二步:WinIo64.sys安装签名(针对64位系统,32系统不需要)

1、打开 WinIO64.sys的属性框,翻到“数字签名”选项卡,点击“详细信息”

2、在新出来的对话框中点击“查看证书”

3、在又新出来的对话框中点击“安装证书”

4、点击“下一步”,然后选择“将所有的证书放入下列存储”

5、点击浏览,选择“受信任的根证书发布机构”

6、点击“下一步”,然后点击“完成”

7、在弹出的“安全性警告”对话框中选择“是”,才能导入成功

8、重启电脑

第三步:Java代码及c++代码实现

网上有很多人使用jnative实现的,这里使用jna实现。jnative是在jna的基础上封装的有局限性。以下是maven依赖:

<dependencies>
   <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <version>4.4.0</version>
   </dependency>
   <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna-platform</artifactId>
      <version>4.4.0</version>
   </dependency>
   <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.9</version>
   </dependency>
</dependencies>

winio代码实现

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.win32.W32APIOptions;

/**
 * author songxq
 * date 2020/6/18
 * description
 */
public interface WinIo extends Library {

    /**
     * 系统架构32位或者64位
     */
    String ARCH = System.getProperty("os.arch");
    /**
     * 使用的winio版本
     */
    String WIN_IO_LIB_NAME = "x86".equals(ARCH) ? "WinIo32" : "WinIo64";

    WinIo INSTANCE = (WinIo) Native.loadLibrary(WIN_IO_LIB_NAME, WinIo.class, W32APIOptions.DEFAULT_OPTIONS);

    /**
     * PS/2键盘的命令端口
     */
    int CONTROL_PORT = 0x64;
    /**
     * PS/2键盘的数据端口
     */
    int DATA_PORT = 0x60;

    /**
     * 初始化winiolib库
     * @param path	驱动文件绝对路径
     * @return
     */
    boolean InitializeWinIo(WString path);

    /**
     * 释放资源及开辟的内存空间
     */
    void ShutdownWinIo();

    /**
     * 读数据
     * 98/ME系列使用GetPortVal  NT/2000/XP系列可以使用_inp/_inpw/_inpd
     * @param portAddr	io地址
     * @param pPortVal	指针变量
     * @param size 数据大小
     * @return
     */
    boolean GetPortVal(int portAddr, Pointer pPortVal, int size);

    /**
     * 写数据
     * @param portAddr	io地址
     * @param portVal	指针变量
     * @param size	数据大小
     * @return
     */
    boolean SetPortVal(int portAddr, int portVal, int size);
}

键盘调用代码


import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.WString;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

/**
 * author songxq
 * date 2020/6/18
 * description
 */
public class VirtualKB {

    private static final WinIo WIN_IO = WinIo.INSTANCE;

    private static final String WIN_BASE_SYSTEM32 = "C:\\Windows\\System32";

    private static final String WINIO_INSTALL_PATH = "C:\\INSTALLWINIO";

    private static final String WINIO_INSTALL_EXE = "C:\\INSTALLWINIO\\InstallWinIo.exe";

    private static final String WIN_32_SYS = "
WinIo3.0:Windows内核级I/O控制工具详解 在计算机系统中,I/O(输入/输出)控制是一项基础而关键的技术。Windows作为主流操作系统之一,其内核级I/O控制更是驱动程序开发和系统优化的基石。本章将概括介绍Windows内核级I/O控制的概念、重要性以及其在现代系统中的作用。 阅读详情

相关推荐

最新版winIO3.0已编译好lib库文件,win10 64验证Ok,所有均已亲测试。w10,w7等32位,64位已测。

注:64bit平台32应用程序,就用WinIo32.dll,WinIo32.lib,WinIo64.sys 如果是32bit平台32应用程序,就用WinIo32.dll,WinIo32.lib,WinIo32.sys。

Winio3.0完整版_支持64位操作系统

Winio3.0完整版,支持64位操作系统,包含源码及帮助 Winio3.0完整版,支持64位操作系统,包含源码及帮助

WinIO3.0库(Win32)

WinIo库允许32位和64位Windows应用程序直接访问I/O端口和物理内存。 3.0版本提供了以下特性: 支持32位和64位平台(不包括Itanium)。 WinIo现在可以被多个应用程序同时使用。 新的c#样本。 这个版本中的Bug修复: 修正了一个阻止访问超过2GB物理内存的错误。 修正了一个错误,导致WinIo驱动程序被卸载时调用ShutdownWinIo,如果驱动程序被设置为加载与InstallWinIoDriver引导。 注意:对Windows 9x/ME的支持已经被移除。

WinIo3.0在64位系统下的使用

使用时,必须进入测试模式、驱动签名,否则加载动态库失败或者调用初始化函数失败

winio3.0官方文件

由于现在网上下载不了winio3.0了,以及其他的了,特地奉献出winio3.0的官方文件,

WinIO 3.0 控件含dll 示例代码 帮助文档

WinIO程序库允许在32位的Windows应用程序中直接对I/O端口和物理内存进行存取操作。通过使用一种内核模式的设备驱动器和其它几种底层编程技巧,它绕过了Windows系统的保护机制。

系统开机时间计算器(BootRacer)V7.0.0.500英文免费安装版

BootRacer是一个用来测试和计算Windows启动速度的工具,它可以计算出Windows从启动到登录的时间,以及进入桌面的时间。软件使用超级简单,安装好了以后软件自动设置成每次Windows启动的时候都会自动启动。启动时BootRacer会显示一个计时画面,此时不要使用鼠标和键盘,等待一段时间系统启动完毕后,你就可以看到测试结果了。 软件特点 1、完全免费,并且你可以自己设置是否每次开机

从平面到立体:一张图看懂MOSFET、FinFET到GAAFET的演变史(附结构对比图)

本文深入解析了半导体晶体管从平面MOSFET到三维FinFET,再到全环绕栅极GAAFET的技术演进历程。通过结构对比图和物理原理分析,揭示了每一次创新如何解决短沟道效应等关键挑战,推动芯片性能提升。特别关注GAAFET作为最新技术突破的架构特点和性能优势。

weixin_30892037的博客 727

如何将rvt(BIM)转换为点云格式

1、为什么将BIM转换为点云格式? 如何使设计BIM与真实场景进行配准,分析在建、未建、已建构建的情况,真实场景是通过点云生产的,和点云配准需要相同的格式。 2、如何转换? 实用工具revit,转换过程如下图,这样就可以转换成三角网格形式。 3、FBX还需要进行一次转换,即转换成点云常用的类型,如bin\ply\pcd等格式。 需要软件cloudcompare.exe,软件下载地址百度云 链接:https://pan.baidu.com/s/1pflcKNc04loBnS1yKR39hw 提取码:obaf

self_Name_的博客 4499

burpsuite抓取ios数据包

1:首先在burpsuite中设置 添加proxy listeners 2:电脑开热点,手机连接,把代理设为电脑的ip和代理的端口 3:在Safari浏览器中打开网址http://burp下载证书 4:打开设置->通用->描述文件与设备管理 5:设置->通用->关于本机->证书信任设置 之后就可以正常抓包了 ...

weixin_45682070的博客 2070

mysql数据目录迁移后表不存在_mysql 直接从date 文件夹备份表,还原数据库之后提示 table doesn`t exist的原因和解决方法...

补充:正常情况下,建议数据库备份最好用工具进行备份,通过拷贝数据库表进行数据迁移,不同的环境会出现各种不同的意外问题。背景:今天在整理一个网站的时候,操作系统由于系统自动更新导致一直出现系统蓝屏死机,唉,悲剧了,于是重新安装了系统 windows server 2008 enterprise 32bit。详情:系统安装完成后,重新配置之前那个网站,appache服务配好之后,再配置数据的时候是这样...

weixin_39628271的博客 2678

ios生成海报使用dom-to-image中toPng报错isTrusted:true

主要是ios中safari浏览器解析错误,引起的报错,主要引起原因toPng会调用toSvg,toSvg直接将html标签内容通过svg中foreignObject标签直接包裹,然后转base64, 通过data:image/svg+xml;解决办法:二次生成(调用两次),判断ios or 安卓,生成第一次生成,不用参数,例如:scale: 3,在第二次生成再进行清晰度操作,避免多次生成,引起性能消耗。以上种种很多案例,使用canvase进行转换的,标签丢失,直接toPng版本的,兼容性问题。

weixin_44601570的博客 2110

【凌智视觉模块】rv1106 部署 pp-humseg 模型

人像分割技术实现摘要 人像分割是利用计算机视觉技术将图像/视频中的人物与背景分离的像素级处理技术。凌智视觉模块基于RV1106芯片开发,支持高效视觉模型部署。当前主流方法包括PP-HumanSeg、BiSeNet等深度学习模型,其中PP-HumanSegV2以96.63% mIoU精度和63FPS手机端速度成为SOTA方案。 实现流程包含: 初始化RKNN模型后端 图像预处理(尺寸调整、颜色空间转换) 执行模型推理 后处理(概率解码、动态阈值分割、形态学优化) 代码实现要点: 使用RKNPU2Backend

m0_50786932的博客 992

基于YOLOv8和时序模型的异常动作检测系统

异常动作检测是计算机视觉领域的重要应用,广泛应用于智能监控、安防系统、老人看护等场景。本项目结合YOLOv8目标检测和LSTM时序模型,实现对打架、摔倒、奔跑等异常动作的实时检测,并提供了完整的Web界面。多技术融合: 结合YOLOv8目标检测和LSTM时序建模实时检测: 支持实时视频流处理和文件分析用户友好: 提供完整的Web界面可扩展性: 模块化设计便于功能扩展高性能: 包含多种优化策略。

YOLO 768

从零开始跑通3DGS教程:(五)3DGS训练

本文介绍了在Docker环境中训练3DGS(3D Gaussian Splatting)的方法,属于《从零开始跑通3DGS教程》系列文章的第五部分。主要内容包括:Docker环境准备(基于pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime镜像)、容器内conda环境配置(安装必要依赖和3DGS相关组件)、以及训练命令执行步骤。文章提供了详细的命令行操作流程,帮助读者快速搭建3DGS训练环境。适合在Linux系统、Nvidia GPU环境下使用,完整教程可参考系列文章

诺有缸的高飞鸟的博客 1772

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

上一篇: 虚拟机硬盘序列号
下一篇: Windows7 配置filebeat为系统服务转发日志
wosongxiaoqi
博客等级 码龄14年 12粉丝 25原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值