Linux内核检查VID/PID号? [英] Linux Kernel Check VID / PID Number?

查看:145
本文介绍了Linux内核检查VID/PID号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找的是从内核模块中检查实时USB磁盘序列号的命令.

What I am looking for is the command to check the live USB disks serial number from within a kernel module.

在内核中,lsusb无法正常工作.

from within the kernel, lsusb won't work.

TMI条款:我正在为客户端开发实时USB设备,这将是我们版权保护的最新内容.

TMI Clause: I am developing a live USB device for a client, and this will be a current part of our copy protection.

推荐答案

您的程序将通过操作系统查询序列号.而且您知道,您的客户端有能力更改操作系统,因此您的程序将无法完全信任操作系统提供的信息.

如果您愿意信任客户端(不更改操作系统),请查看Linux中的hdparm程序如何获取其HDD详细信息(包括序列号),或者通过/sys/devices/层次结构进行爬网以找出答案硬盘及其详细数据(暂时无法找到,但我认为串行信息也将存在).

另一方面,如果您希望客户欺骗,那么最好不要让他们完全使用您的应用程序.

Your program would be querying the serial number via the operating system. And you know what, your client has the ability to alter the operating system, so your program would not be able to completely trust the information provided by the OS.

If you're willing to trust the client (not to alter the OS), see how the hdparm program in Linux obtains its HDD detail information (including the serial number), or alternatively crawl through the /sys/devices/ hierarchy to find out the hard disks and their detail data (couldn't find it for the moment, but I think the serial info would be there as well).

If, on the other hand, you would like to expect your clients to cheat, then you would better not let them use your application at all.

这篇关于Linux内核检查VID/PID号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆