访问东芝笔记本电脑加速计设备驱动程序

发布于 2024-07-27 00:43:58 字数 468 浏览 13 评论 0原文

我有一台新的东芝 Satellite Pro S300 笔记本电脑(运行 Windows XP),配备 3D 加速计以保护 HDD。 我想利用这个传感器发送的数据。 较旧的东芝笔记本电脑/平板电脑有一个 DLL,可以访问该 DLL 以提取加速数据。 不幸的是,S300 似乎没有这个 DLL(DLL hack 已在其他地方记录,例如此处)。

HDD Protection 应用程序(具有与笔记本电脑的位置和运动同步旋转的旋转 HDD 的可爱 3D 可视化)似乎并不依赖于任何“非标准”/自定义 DLL(根据 DependencyWalker)。 似乎数据是通过服务和/或通过 .sys 设备驱动程序访问的。 我想我设法识别了相关文件,但我不知道如何查找、命名、访问、加载(或“反汇编”)相关函数。

如何发现和使用加速度计数据?

I have a new Toshiba Satellite Pro S300 laptop (running Windows XP) which sports a 3D accelerometer for HDD protection. I'd like to tap into the data sent by this sensor.
Older Toshiba laptop/Tablets had a DLL that could be accessed to extract the acceleration data. Unfortunately, the S300 does not seem to have this DLL (The DLL hack has been documented elsewhere, e.g. here).

The HDD Protection app (which has a cute 3D visualization of a rotating HDD that rotates in synch with the laptop's position and motion) doesn't seem to depend on any "non-standard"/custom DLLs (according to DependencyWalker).
It seems that the data is accessed either through a service and/or through a .sys device driver. I think I managed to identify the relevant files, but I have no idea how to find, name, access, load (or "disassemble") the relevant functions.

How can I discover and use the accelerometer data?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

国粹 2024-08-03 00:43:58

一般来说,您的工具将是:

  • Sysinternals Process Monitor - 可以提供您可以大致了解东芝进程的作用:它打开哪些设备 (CreateFile) 以及它发出哪些 I/O 控制请求 (DeviceIoControl)。
  • 反汇编程序 - 我最喜欢的是 IDA

你可能很幸运,发现东芝的进程包含额外的内容IDA 很乐意使用的调试信息。 然后,利用所有可用的信息,您必须自己理解事情。

祝你好运!

Generally speaking, your tools will be:

  • Sysinternals Process Monitor - can give you a general overview of what Toshiba's process does: which devices it opens (CreateFile) and which I/O control requests it makes (DeviceIoControl).
  • a disassembler -- my favorite would be IDA

You might be lucky and find out that Toshiba's process includes extra debug information which IDA would happily make use of. Then, with all the available information, you'd have to make sense of things on your own.

Good luck!

病女 2024-08-03 00:43:58

我已经能够让它与此代码一起工作(在东芝 Satellite Pro S300L-120,Windows 7 上):

void ReadAccel(float a[3])
{
    HANDLE h = CreateFile(L"\\\\.\\TVALZ", GENERIC_ALL, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
    struct dummy
    {
        unsigned long magic1; /* = 0x0000FE00 */
        unsigned long magic2; /* = 0x000000A6 */
        unsigned short x, y;
        unsigned long unknown, z;
        unsigned long direction;
    } d;
    memset(&d, 0, sizeof(d));
    unsigned long retlen;
    d.magic1 = 0x0000FE00;
    d.magic2 = 0xA6;
    d.direction = 0;

    DeviceIoControl(h, 0x222880, &d, sizeof(d), &d, sizeof(d), &retlen, NULL);
    d.magic1 = 0x0000FE00;
    d.direction = 1;
    Sleep(20); /* Doesn't seem to work without the wait */
    DeviceIoControl(h, 0x222880, &d, sizeof(d), &d, sizeof(d), &retlen, NULL);
    signed short x = (d.x & 0x7FFF) * (d.x & 0x8000?-1:1);
    signed short y = (d.y & 0x7FFF) * (d.y & 0x8000?-1:1);
    signed short z = (d.z & 0x7FFF) * (d.z & 0x8000?-1:1);
    a[2] = -(float)z * 9.8 / 205; /* this is just an estimate to go to SI units */
    a[1] = (float)y * 9.8 / 205;
    a[0] = (float)x * 9.8 / 205;
    CloseHandle(h);
}

它可能还不是很漂亮,但我们可以开始玩:)

我使用了附带的 TPCHCTL.dll顺便说一句,用东芝硬件监视器来解决这个问题。

I've been able to get it to work with this code (On a Toshiba Satellite Pro S300L-120, Windows 7):

void ReadAccel(float a[3])
{
    HANDLE h = CreateFile(L"\\\\.\\TVALZ", GENERIC_ALL, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
    struct dummy
    {
        unsigned long magic1; /* = 0x0000FE00 */
        unsigned long magic2; /* = 0x000000A6 */
        unsigned short x, y;
        unsigned long unknown, z;
        unsigned long direction;
    } d;
    memset(&d, 0, sizeof(d));
    unsigned long retlen;
    d.magic1 = 0x0000FE00;
    d.magic2 = 0xA6;
    d.direction = 0;

    DeviceIoControl(h, 0x222880, &d, sizeof(d), &d, sizeof(d), &retlen, NULL);
    d.magic1 = 0x0000FE00;
    d.direction = 1;
    Sleep(20); /* Doesn't seem to work without the wait */
    DeviceIoControl(h, 0x222880, &d, sizeof(d), &d, sizeof(d), &retlen, NULL);
    signed short x = (d.x & 0x7FFF) * (d.x & 0x8000?-1:1);
    signed short y = (d.y & 0x7FFF) * (d.y & 0x8000?-1:1);
    signed short z = (d.z & 0x7FFF) * (d.z & 0x8000?-1:1);
    a[2] = -(float)z * 9.8 / 205; /* this is just an estimate to go to SI units */
    a[1] = (float)y * 9.8 / 205;
    a[0] = (float)x * 9.8 / 205;
    CloseHandle(h);
}

It might not be very pretty yet, but we can start playing :)

I used the TPCHCTL.dll that comes with the Toshiba Hardware monitor to figure this out, btw.

朱染 2024-08-03 00:43:58

作为记录,我刚刚向 Gecko 提交了一个紧密相关的问题( Firefox 等应用程序集)加速计支持,其对多种设备的支持可能会随下一个主要版本一起提供。 :-)

For the record, I've just filed a tightly related issue into Gecko (Firefox et. al. set of applications) accelerometer support, whose support for several devices might be able to ship with the next major version. :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文