|
本帖最后由 wintoflash 于 2023-4-10 22:32 编辑
挖坟。我看 49# CodeHz 的程序里面就是直接读的注册表啊?(http://bbs.wuyou.net/forum.php?m ... 4287&fromuid=487838)
firmware.tjs
- int getctrl(wchar_t *entry) {
- HKEY scoped(pcloseKey) control;
- CheckReg(RegOpenKey(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control", &control));
- LocalBuffer(wchar_t, device, 4096);
- DWORD xtype = REG_SZ;
- CheckReg(RegQueryValueEx(control, entry, 0, &xtype, (LPBYTE) device, &device_len));
- ...
- }
- #define ReportCtrl(name) ({ wprintf(L" [+] key: %s\n", name); int code = getctrl(name); if (code != 0) wprintf(L"failed to read %s: %08X\n", name, code); })
- #define ReportStatus(msg, action) ({ wprintf(L" [+] %s\n", msg); int code = action; if (code != 0) wprintf(L"failed to %s: %08X\n", msg, code); })
- int main() {
- ReportCtrl(L"FirmwareBootDevice");
- ReportCtrl(L"SystemBootDevice");
- }
复制代码 |
|