news 2026/4/15 16:52:40

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/3/26 22:05:51

3天打造专属语音:ChatTTS-ui音色定制实战指南

3天打造专属语音:ChatTTS-ui音色定制实战指南 【免费下载链接】ChatTTS-ui 匹配ChatTTS的web界面和api接口 项目地址: https://gitcode.com/GitHub_Trending/ch/ChatTTS-ui 想要让AI语音说出你的专属声音吗?🎙️ 在ChatTTS-ui中&#…

作者头像 李华
网站建设 2026/3/11 14:31:37

OpCore Simplify:智能OpenCore EFI配置解决方案

OpCore Simplify:智能OpenCore EFI配置解决方案 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify 还在为繁琐的黑苹果配置过程而烦恼吗&…

作者头像 李华
网站建设 2026/4/12 20:57:17

黑苹果新手福音: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 还在为复杂的黑苹果配置而烦恼吗&…

作者头像 李华
网站建设 2026/4/16 11:11:53

BiliTools AI视频总结终极指南:如何3分钟掌握B站视频核心内容

BiliTools AI视频总结终极指南:如何3分钟掌握B站视频核心内容 【免费下载链接】BiliTools A cross-platform bilibili toolbox. 跨平台哔哩哔哩工具箱,支持视频、音乐、番剧、课程下载……持续更新 项目地址: https://gitcode.com/GitHub_Trending/bil…

作者头像 李华
网站建设 2026/4/12 4:22:59

OpCore Simplify高效配置手册:零基础打造专属macOS环境

OpCore Simplify高效配置手册:零基础打造专属macOS环境 【免费下载链接】OpCore-Simplify A tool designed to simplify the creation of OpenCore EFI 项目地址: https://gitcode.com/GitHub_Trending/op/OpCore-Simplify 还在为复杂的黑苹果配置而头疼吗&a…

作者头像 李华