news 2026/9/5 2:34:49

ACPI源代码分析ACPI!Store函数分析中的pterm->pdataArgs[0]和pterm->pdataArgs[1]

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI源代码分析ACPI!Store函数分析中的pterm->pdataArgs[0]和pterm->pdataArgs[1]

ACPI源代码分析ACPI!Store函数分析中的pterm->pdataArgs[0]和pterm->pdataArgs[1]

Method (VMPS, 1, NotSerialized)
{
Acquire (OEML, 0xFFFF)
IVOC (0x81, Arg0)
Store (\_SB.PCI0.OEMR, Local0)
Release (OEML)
Return (Local0)
}

Store (\_SB.PCI0.OEMR, Local0)

函数正好有两个参数

第一个参数是pterm->pdataArgs[0]

第2个参数是pterm->pdataArgs[1]


1: kd> kc
#
00 ACPI!Store
01 ACPI!ParseTerm
02 ACPI!RunContext
03 ACPI!DispatchCtxtQueue
04 ACPI!StartTimeSlicePassive
05 ACPI!ACPIWorker
06 nt!PspSystemThreadStartup
07 nt!KiThreadStartup
1: kd> dv
pctxt = 0x8997c000
pterm = 0x8997ddb0
pdata = 0x00000008
1: kd> dx -r1 ((ACPI!_term *)0x8997ddb0)
((ACPI!_term *)0x8997ddb0) : 0x8997ddb0 [Type: _term *]
[+0x000] FrameHdr [Type: _framehdr]
[+0x010] pbOpTerm : 0x899b4194 : 0x70 [Type: unsigned char *]
[+0x014] pbOpEnd : 0x0 [Type: unsigned char *]
[+0x018] pbScopeEnd : 0x899b41ad : 0x0 [Type: unsigned char *]
[+0x01c] pamlterm : 0xf7439550 [Type: _amlterm *]
[+0x020] pnsObj : 0x0 [Type: _NSObj *]
[+0x024] iArg : 2 [Type: int]
[+0x028] icArgs : 2 [Type: int]
[+0x02c] pdataArgs : 0x8997c158 [Type: _ObjData *]
[+0x030] pdataResult : 0x8997c0fc [Type: _ObjData *]
1: kd> dx -r1 ((ACPI!_ObjData *)0x8997c158)
((ACPI!_ObjData *)0x8997c158) : 0x8997c158 [Type: _ObjData *]
[+0x000] dwfData : 0x0 [Type: unsigned short]
[+0x002] dwDataType : 0x1 [Type: unsigned short]
[+0x004] dwRefCount : 0x0 [Type: unsigned long]
[+0x004] pdataBase : 0x0 [Type: _ObjData *]
[+0x008] dwDataValue : 0x0 [Type: unsigned long]
[+0x008] uipDataValue : 0x0 [Type: unsigned long]
[+0x008] pnsAlias : 0x0 [Type: _NSObj *]
[+0x008] pdataAlias : 0x0 [Type: _ObjData *]
[+0x008] powner : 0x0 [Type: void *]
[+0x00c] dwDataLen : 0x0 [Type: unsigned long]
[+0x010] pbDataBuff : 0x0 [Type: unsigned char *]
1: kd> dx -r1 ((ACPI!_ObjData *)0x8997c0fc)
((ACPI!_ObjData *)0x8997c0fc) : 0x8997c0fc [Type: _ObjData *]
[+0x000] dwfData : 0x0 [Type: unsigned short]
[+0x002] dwDataType : 0x0 [Type: unsigned short]
[+0x004] dwRefCount : 0x0 [Type: unsigned long]
[+0x004] pdataBase : 0x0 [Type: _ObjData *]
[+0x008] dwDataValue : 0x0 [Type: unsigned long]
[+0x008] uipDataValue : 0x0 [Type: unsigned long]
[+0x008] pnsAlias : 0x0 [Type: _NSObj *]
[+0x008] pdataAlias : 0x0 [Type: _ObjData *]
[+0x008] powner : 0x0 [Type: void *]
[+0x00c] dwDataLen : 0x0 [Type: unsigned long]
[+0x010] pbDataBuff : 0x0 [Type: unsigned char *]


if ((rc = ValidateTarget(&pterm->pdataArgs[1], OBJTYPE_DATAOBJ,&pdata)) ==
STATUS_SUCCESS)
{
MoveObjData(pterm->pdataResult, &pterm->pdataArgs[0]);
rc = WriteObject(pctxt, pdata, pterm->pdataResult);
}


1: kd> dv pdata
pdata = 0x8997de34

1: kd> dx -r1 ((ACPI!_ObjData *)0x8997de34)
((ACPI!_ObjData *)0x8997de34) : 0x8997de34 [Type: _ObjData *]
[+0x000] dwfData : 0x0 [Type: unsigned short]
[+0x002] dwDataType : 0x0 [Type: unsigned short]
[+0x004] dwRefCount : 0x0 [Type: unsigned long]
[+0x004] pdataBase : 0x0 [Type: _ObjData *]
[+0x008] dwDataValue : 0x0 [Type: unsigned long]
[+0x008] uipDataValue : 0x0 [Type: unsigned long]
[+0x008] pnsAlias : 0x0 [Type: _NSObj *]
[+0x008] pdataAlias : 0x0 [Type: _ObjData *]
[+0x008] powner : 0x0 [Type: void *]
[+0x00c] dwDataLen : 0x0 [Type: unsigned long]
[+0x010] pbDataBuff : 0x0 [Type: unsigned char *]


MoveObjData(pterm->pdataResult, &pterm->pdataArgs[0]);

1: kd> dx -r1 ((ACPI!_ObjData *)0x8997c0fc)
((ACPI!_ObjData *)0x8997c0fc) : 0x8997c0fc [Type: _ObjData *]
[+0x000] dwfData : 0x0 [Type: unsigned short]
[+0x002] dwDataType : 0x1 [Type: unsigned short]
[+0x004] dwRefCount : 0x0 [Type: unsigned long]
[+0x004] pdataBase : 0x0 [Type: _ObjData *]
[+0x008] dwDataValue : 0x0 [Type: unsigned long]
[+0x008] uipDataValue : 0x0 [Type: unsigned long]
[+0x008] pnsAlias : 0x0 [Type: _NSObj *]
[+0x008] pdataAlias : 0x0 [Type: _ObjData *]
[+0x008] powner : 0x0 [Type: void *]
[+0x00c] dwDataLen : 0x0 [Type: unsigned long]
[+0x010] pbDataBuff : 0x0 [Type: unsigned char *]

rc = WriteObject(pctxt, pdata, pterm->pdataResult);


1: kd> dv
pctxt = 0x8997c000
pdataObj = 0x8997de34
pdataSrc = 0x8997c0fc
pafu = 0x00000008


1: kd> dv pterm
pterm = 0x8997ddb0
1: kd> dx -r1 ((ACPI!_term *)0x8997ddb0)
((ACPI!_term *)0x8997ddb0) : 0x8997ddb0 [Type: _term *]
[+0x000] FrameHdr [Type: _framehdr]
[+0x010] pbOpTerm : 0x899b4194 : 0x70 [Type: unsigned char *]
[+0x014] pbOpEnd : 0x0 [Type: unsigned char *]
[+0x018] pbScopeEnd : 0x899b41ad : 0x0 [Type: unsigned char *]
[+0x01c] pamlterm : 0xf7439550 [Type: _amlterm *]
[+0x020] pnsObj : 0x0 [Type: _NSObj *]
[+0x024] iArg : 2 [Type: int]
[+0x028] icArgs : 2 [Type: int]
[+0x02c] pdataArgs : 0x8997c158 [Type: _ObjData *]
[+0x030] pdataResult : 0x8997c0fc [Type: _ObjData *]

1: kd> dt _ObjData 0x8997c158+14//每一个参数占0X14个字节
ACPI!_ObjData
+0x000 dwfData : 0
+0x002 dwDataType : 0x81
+0x004 dwRefCount : 0
+0x004 pdataBase : (null)
+0x008 dwDataValue : 0x8997de34
+0x008 uipDataValue : 0x8997de34
+0x008 pnsAlias : 0x8997de34 _NSObj
+0x008 pdataAlias : 0x8997de34_ObjData
+0x008 powner : 0x8997de34 Void
+0x00c dwDataLen : 0
+0x010 pbDataBuff : (null)
1: kd> ?0x8997c158+14
Evaluate expression: -1986543252 = 8997c16c
1: kd> dx -r1 ((ACPI!_ObjData *)0x8997de34)
((ACPI!_ObjData *)0x8997de34) : 0x8997de34 [Type: _ObjData *]
[+0x000] dwfData : 0x0 [Type: unsigned short]
[+0x002] dwDataType : 0x1 [Type: unsigned short]
[+0x004] dwRefCount : 0x0 [Type: unsigned long]
[+0x004] pdataBase : 0x0 [Type: _ObjData *]
[+0x008] dwDataValue : 0x0 [Type: unsigned long]
[+0x008] uipDataValue : 0x0 [Type: unsigned long]
[+0x008] pnsAlias : 0x0 [Type: _NSObj *]
[+0x008] pdataAlias : 0x0 [Type: _ObjData *]
[+0x008] powner : 0x0 [Type: void *]
[+0x00c] dwDataLen : 0x0 [Type: unsigned long]
[+0x010] pbDataBuff : 0x0 [Type: unsigned char *]

typedef enum _OBJTYPES {
OBJTYPE_UNKNOWN = 0,
OBJTYPE_INTDATA,
OBJTYPE_STRDATA,
OBJTYPE_BUFFDATA,
OBJTYPE_PKGDATA,
OBJTYPE_FIELDUNIT,
OBJTYPE_DEVICE,
OBJTYPE_EVENT,
OBJTYPE_METHOD,
OBJTYPE_MUTEX,
OBJTYPE_OPREGION,
OBJTYPE_POWERRES,
OBJTYPE_PROCESSOR,
OBJTYPE_THERMALZONE,
OBJTYPE_BUFFFIELD,
OBJTYPE_DDBHANDLE,
OBJTYPE_DEBUG,
//These are internal object types (not to be exported to the ASL code)
OBJTYPE_INTERNAL = 0x80,
OBJTYPE_OBJALIAS = 0x80,
OBJTYPE_DATAALIAS,
OBJTYPE_BANKFIELD,

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/9/4 20:05:32

OpCore Simplify:一键解决黑苹果配置难题的终极方案

OpCore Simplify:一键解决黑苹果配置难题的终极方案 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify 还在为复杂的OpenCore EFI配置而头疼吗…

作者头像 李华
网站建设 2026/9/4 17:59:34

猫抓Cat-Catch终极指南:10大实用技巧助你高效捕获网页媒体资源

猫抓Cat-Catch终极指南:10大实用技巧助你高效捕获网页媒体资源 【免费下载链接】cat-catch 猫抓 chrome资源嗅探扩展 项目地址: https://gitcode.com/GitHub_Trending/ca/cat-catch 猫抓Cat-Catch是一款革命性的Chrome浏览器扩展,专为普通用户设计…

作者头像 李华
网站建设 2026/9/4 13:18:19

BiliTools智能视频总结:5倍速获取B站核心知识的革命性工具

BiliTools智能视频总结:5倍速获取B站核心知识的革命性工具 【免费下载链接】BiliTools A cross-platform bilibili toolbox. 跨平台哔哩哔哩工具箱,支持视频、音乐、番剧、课程下载……持续更新 项目地址: https://gitcode.com/GitHub_Trending/bilit/…

作者头像 李华
网站建设 2026/9/5 14:34:19

OpCore Simplify:智能化黑苹果EFI配置解决方案深度解析

OpCore Simplify:智能化黑苹果EFI配置解决方案深度解析 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify OpCore Simplify作为一款革命性的黑…

作者头像 李华
网站建设 2026/9/5 15:09:28

OpCore Simplify完整指南:5步快速构建完美Hackintosh系统

OpCore Simplify完整指南:5步快速构建完美Hackintosh系统 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify 还在为复杂的OpenCore配置而头疼…

作者头像 李华
网站建设 2026/9/5 16:01:03

终极指南:如何用AI文字生成专业CAD图纸

终极指南:如何用AI文字生成专业CAD图纸 【免费下载链接】text-to-cad-ui A lightweight UI for interfacing with the Zoo text-to-cad API, built with SvelteKit. 项目地址: https://gitcode.com/gh_mirrors/te/text-to-cad-ui 还在为复杂的CAD软件操作而烦…

作者头像 李华