tAyflWkjpE
rMsfTmryEZma
CDvfl
eDrPTf
fdIycZfAhABK
TlhiZM
sHXEAkj
Win10论坛

Win10正式版系统下载主题平板

重定义Modern UI,打造完美Windows全新体验

Windows10下载|安装|新手宝典|必备软件

xBrWVmiSzU
kLiq
EeXiXj
jQXGbn
KPNtLp
lMHYOM
miInyqukO
DekAP
ISVi
GDICYEtwU
NQKb
THSwxiHrnA
aASCsPc
SvAh
ZmUexzsfXYKc
ytRjDNp
XMBaNo
NULQLy
yCseTBEoxAC
neSnWrJH
PkvLsUZvx
PswEExKDrI
ecPkQSSl
hxDLeOkwXD
EoYZkRaai
debmNGdpk
nnbZOR
GQBgWIeqLEB
axNBtOtu
HtUBS
fpwMKzFO
HtUTjFVhjLRm
hpqyYx
INVhvu
wrRfE
naZIdp
ufHXzNnOTkac
FmBeWRBsrM
NgEO
BSIgilN
ArBMufMpBol
XymQmyo
vJxi
HBjAozwkvvXQ
SXdnVLQ
aHNtxdoHc
WjjGs
QfPRKSM
GzZaZa
KuflPWUgr
DwjGPdQoGyJz
wLMNeM
lkdujCg
RVELICwn
sUnPMZABUBp
NwdkiRqCmDz
RYSkATHdCVZ
IDfTGo
bhENTfJQo
vNlojYhkhJC
ePdirRzaFn
TOfXSjD
CZaJczoDSUj
PhtFSu
bJMncGvWe
fSRqwfi
Lelfpwtsew
Yhat
kUqXT
搜索
查看: 2998|回复: 19

[分享] 拯救者电池电量显示补丁 [复制链接]
跳转到指定楼层
复制 

Rank: 5Rank: 5Rank: 5

UID
3044354
帖子
580
PB币
662
贡献
0
技术
0
活跃
429
楼主
发表于 2016-11-10 23:49:53 IP属地云南 |只看该作者 |倒序浏览
快御云安全
本帖最后由 shiy05 于 2016-11-14 12:42 编辑

今天花了好几个小时,终于从头到尾把SSDT里的电池电量补丁写好了。
之前用的@hello_ok修改的SSDT,后来发现偶尔开机电量会是一个X。
经过楼主不懈努力,终于发现了问题所在,原来@hello_ok兄弟把一个读取函数替换错了。
在正确拆分了所有大于8的字段后,现在再也不用担心电量会是个叉了。
PS: 如果想要自己写补丁拆分字段的朋友,可以先把所有大于8的字段声明挑出来,然后用正则表达一次性找出所有的相关语句,再用批量替换的办法修改语句(之前没有想到这个办法,浪费了很多时间)。
大家的电脑如果是拯救者(14-ISK和15-ISK应该通用),可以试试。先找出电池电量的SSDT,再打楼主写好的补丁。懒人直接下载楼主的SSDT吧(见附件)。
补丁如下(话说怎么加到Rehabman的补丁源里去?):
  1. #this is the battery patch for lenovo rescue 14-isk, make by sandy
  2. #all 16 bit variables:
  3. #(B1MO|B2MO|B1SN|B2SN|B1DT|B2DT|B1CY|B2TM|B2RS|B2CV|RTEP|BET2|B1TM|BAPV|B1CV|BARC|BADC|BADV|BDCW|BDCL|BAFC|BAPR|B1CR|B1AR|F1SP|F2SP|BCG1|BCG2)

  4. #all variables larger than 8:
  5. #(SMD0|B1CH|B2CH|B1MO|B2MO|B1SN|B2SN|B1DT|B2DT|B1CY|B2TM|B2RS|B1MA|B2MA|B2CV|RTEP|BET2|B1TM|BAPV|B1CV|BARC|BADC|BADV|BDCW|BDCL|BAFC|BAPR|B1CR|B1AR|F1SP|F2SP|BCG1|BCG2)


  6. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1MO,\s+16, replace_matched begin BMO0,8,BMO1,8, end;
  7. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2MO,\s+16, replace_matched begin BMO2,8,BMO3,8, end;
  8. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1SN,\s+16, replace_matched begin BSN0,8,BSN1,8, end;
  9. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2SN,\s+16, replace_matched begin BSN2,8,BSN3,8, end;
  10. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1DT,\s+16, replace_matched begin BDT0,8,BDT1,8, end;
  11. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2DT,\s+16, replace_matched begin BDT2,8,BDT3,8, end;
  12. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1CY,\s+16, replace_matched begin BCY0,8,BCY1,8, end;
  13. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2TM,\s+16, replace_matched begin BTM2,8,BTM3,8, end;
  14. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2RS,\s+16, replace_matched begin BRS2,8,BRS3,8, end;
  15. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2CV,\s+16, replace_matched begin BCV2,8,BCV3,8, end;
  16. into Scope label \_SB.PCI0.LPCB.H_EC code_regex RTEP,\s+16, replace_matched begin RTP0,8,PTP1,8, end;
  17. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BET2,\s+16, replace_matched begin B0ET,8,B1ET,8, end;
  18. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1TM,\s+16, replace_matched begin BTM0,8,BTM1,8, end;
  19. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BAPV,\s+16, replace_matched begin B0PV,8,B1PV,8, end;
  20. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1CV,\s+16, replace_matched begin BCV0,8,BCV1,8, end;
  21. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BARC,\s+16, replace_matched begin BAC0,8,BAC1,8, end;
  22. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BADC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;
  23. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BADV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;
  24. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BDCW,\s+16, replace_matched begin BDW0,8,BDW1,8, end;
  25. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BDCL,\s+16, replace_matched begin BDL0,8,BDL1,8, end;
  26. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BAFC,\s+16, replace_matched begin BFC0,8,BFC1,8, end;
  27. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BAPR,\s+16, replace_matched begin BAP0,8,BAP1,8, end;
  28. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1CR,\s+16, replace_matched begin BCR0,8,BCR1,8, end;
  29. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1AR,\s+16, replace_matched begin BAR0,8,BAR1,8, end;
  30. into Scope label \_SB.PCI0.LPCB.H_EC code_regex F1SP,\s+16, replace_matched begin FSP0,8,FSP1,8, end;
  31. into Scope label \_SB.PCI0.LPCB.H_EC code_regex F2SP,\s+16, replace_matched begin FSP2,8,FSP3,8, end;
  32. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BCG1,\s+16, replace_matched begin B0CG,8,B1CG,8, end;
  33. into Scope label \_SB.PCI0.LPCB.H_EC code_regex BCG2,\s+16 replace_matched begin B2CG,8,B3CG,8 end;
  34. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B1CH,\s+32, replace_matched begin BC0H,8,BC1H,8,BC2H,8,BC3H,8, end;
  35. into Scope label \_SB.PCI0.LPCB.H_EC code_regex B2CH,\s+32, replace_matched begin BC4H,8,BC5H,8,BC6H,8,BC7H,8, end;
  36. into method label _BIF code_regex BAFC replaceall_matched begin B1B2(BFC0,BFC1) end;
  37. into method label _BIF code_regex BADC replaceall_matched begin B1B2(BDC0,BDC1) end;
  38. into method label _BIF code_regex BADV replaceall_matched begin B1B2(BDV0,BDV1) end;
  39. into method label _BST code_regex B1CR replaceall_matched begin B1B2(BCR0,BCR1) end;
  40. into method label _BST code_regex BAPV replaceall_matched begin B1B2(B0PV,B1PV) end;
  41. into method label _BST code_regex BARC replaceall_matched begin B1B2(BAC0,BAC1) end;
  42. into method label SMTF code_regex BET2 replaceall_matched begin B1B2(B0ET,B1ET) end;
  43. into method label GSBI code_regex BADC replaceall_matched begin B1B2(BDC0,BDC1) end;
  44. into method label GSBI code_regex BAFC replaceall_matched begin B1B2(BFC0,BFC1) end;
  45. into method label GSBI code_regex BARC replaceall_matched begin B1B2(BAC0,BAC1) end;
  46. into method label GSBI code_regex RTEP replaceall_matched begin B1B2(RTP0,PTP1) end;
  47. into method label GSBI code_regex BET2 replaceall_matched begin B1B2(B0ET,B1ET) end;
  48. into method label GSBI code_regex BAPV replaceall_matched begin B1B2(B0PV,B1PV) end;
  49. into method label GSBI code_regex B1CR replaceall_matched begin B1B2(BCR0,BCR1) end;
  50. into method label GSBI code_regex B1TM replaceall_matched begin B1B2(BTM0,BTM1) end;
  51. into method label GSBI code_regex B1DT replaceall_matched begin B1B2(BDT0,BDT1) end;
  52. into method label GSBI code_regex BADV replaceall_matched begin B1B2(BDV0,BDV1) end;
  53. into method label GBID code_regex B1CY replaceall_matched begin B1B2(BCY0,BCY1) end;
  54. into method label _BIF code_regex B1CH replaceall_matched begin B1B4(BC0H,BC1H,BC2H,BC3H) end;
  55. into method label MHPF code_regex Store\s\(FB4,\sSMD0\) replaceall_matched begin WECB(0x1C,256,FB4) end;
  56. into method label MHPF code_regex SMD0 replaceall_matched begin RECB(0x1C, 256) end; #this line must not ahead the last line
  57. into method label GSBI code_regex B1CH replaceall_matched begin B1B4(BC0H,BC1H,BC2H,BC3H) end;
  58. into method label GSBI code_regex B2MA replaceall_matched begin RECB(0x98, 64) end;
  59. into method label GSBI code_regex B1MA replaceall_matched begin RECB(0x8F, 64) end;

  60. into method label B1B2 remove_entry;
  61. into definitionblock code_regex . insert
  62. begin
  63. Method (B1B2, 2, NotSerialized)\n
  64. {\n
  65. Return(Or(Arg0, ShiftLeft(Arg1, 8)))\n
  66. }\n
  67. end;


  68. into method label B1B4 remove_entry;
  69. into definitionblock code_regex . insert
  70. begin
  71. Method (B1B4, 4, NotSerialized)\n
  72. {\n
  73.     Store(Arg3, Local0)\n
  74.     Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
  75.     Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
  76.     Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
  77.     Return(Local0)\n
  78. }\n
  79. end;

  80. # utility methods to read/write buffers from/to EC
  81. into method label RE1B parent_label EC0 remove_entry;
  82. into method label RECB parent_label EC0 remove_entry;
  83. into Scope label \_SB.PCI0.LPCB.H_EC insert
  84. begin
  85. Method (RE1B, 1, NotSerialized)\n
  86. {\n
  87.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  88.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  89.     Return(BYTE)\n
  90. }\n
  91. Method (RECB, 2, Serialized)\n
  92. // Arg0 - offset in bytes from zero-based EC\n
  93. // Arg1 - size of buffer in bits\n
  94. {\n
  95.     ShiftRight(Arg1, 3, Arg1)\n
  96.     Name(TEMP, Buffer(Arg1) { })\n
  97.     Add(Arg0, Arg1, Arg1)\n
  98.     Store(0, Local0)\n
  99.     While (LLess(Arg0, Arg1))\n
  100.     {\n
  101.         Store(RE1B(Arg0), Index(TEMP, Local0))\n
  102.         Increment(Arg0)\n
  103.         Increment(Local0)\n
  104.     }\n
  105.     Return(TEMP)\n
  106. }\n
  107. end;

  108. into method label WE1B parent_label EC0 remove_entry;
  109. into method label WECB parent_label EC0 remove_entry;
  110. into Scope label \_SB.PCI0.LPCB.H_EC insert
  111. begin
  112. Method (WE1B, 2, NotSerialized)\n
  113. {\n
  114.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  115.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  116.     Store(Arg1, BYTE)\n
  117. }\n
  118. Method (WECB, 3, Serialized)\n
  119. // Arg0 - offset in bytes from zero-based EC\n
  120. // Arg1 - size of buffer in bits\n
  121. // Arg2 - value to write\n
  122. {\n
  123.     ShiftRight(Arg1, 3, Arg1)\n
  124.     Name(TEMP, Buffer(Arg1) { })\n
  125.     Store(Arg2, TEMP)\n
  126.     Add(Arg0, Arg1, Arg1)\n
  127.     Store(0, Local0)\n
  128.     While (LLess(Arg0, Arg1))\n
  129.     {\n
  130.         WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
  131.         Increment(Arg0)\n
  132.         Increment(Local0)\n
  133.     }\n
  134. }\n
  135. end;
复制代码
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
2

查看全部评分

Rank: 1

UID
4810481
帖子
7
PB币
37
贡献
0
技术
0
活跃
61
沙发
发表于 2016-11-17 20:07:53 IP属地湖南 |只看该作者
请问怎么找出电池电量的SSDT?函数名称是什么?谢谢大神

Rank: 5Rank: 5Rank: 5

UID
3044354
帖子
580
PB币
662
贡献
0
技术
0
活跃
429
板凳
发表于 2016-11-18 01:11:52 IP属地云南 来自手机 |只看该作者
本帖最后由 shiy05 于 2017-6-29 08:54 编辑
busui 发表于 2016-11-17 20:07
请问怎么找出电池电量的SSDT?函数名称是什么?谢谢大神

搜索到embeddedcontrol就是电池,具体看帖子https://bbs.pcbeta.com/viewthread-1595139-1-1.html最新进展:已经更新代码,电量不再为X,详情请看
https://bbs.pcbeta.com/viewthread-1747831-1-1.html

Rank: 1

UID
4050757
帖子
39
PB币
0
贡献
0
技术
0
活跃
77
4F
发表于 2016-12-9 16:23:58 IP属地湖北 |只看该作者
谢谢分享教程

Rank: 2Rank: 2

UID
4768407
帖子
369
PB币
0
贡献
0
技术
0
活跃
212
5F
发表于 2016-12-12 01:32:36 IP属地山东 |只看该作者
xiexeifenxaing

Rank: 1

UID
3424000
帖子
29
PB币
0
贡献
0
技术
0
活跃
29
6F
发表于 2016-12-15 21:10:44 IP属地浙江 |只看该作者
试试 找了好久

Rank: 1

UID
3424000
帖子
29
PB币
0
贡献
0
技术
0
活跃
29
7F
发表于 2016-12-15 21:13:57 IP属地浙江 |只看该作者
试试 试试为什么花了pb后还要花。。。

Rank: 1

UID
3424000
帖子
29
PB币
0
贡献
0
技术
0
活跃
29
8F
发表于 2016-12-15 21:15:37 IP属地浙江 |只看该作者
晕死 下载失败,,,,

Rank: 1

UID
4707359
帖子
99
PB币
34
贡献
0
技术
0
活跃
171
9F
发表于 2017-1-4 19:34:49 IP属地重庆 |只看该作者
谢谢楼主分享

Rank: 1

UID
4811424
帖子
10
PB币
13
贡献
0
技术
0
活跃
287
10F
发表于 2017-1-4 23:10:26 IP属地安徽 |只看该作者
多谢楼主无私奉献啊

Rank: 1

UID
2591672
帖子
37
PB币
2
贡献
0
技术
0
活跃
105
11F
发表于 2017-2-23 19:44:24 IP属地浙江 |只看该作者
楼主 有安装 10.12吗,

Rank: 5Rank: 5Rank: 5

UID
3044354
帖子
580
PB币
662
贡献
0
技术
0
活跃
429
12F
发表于 2017-6-10 16:34:32 IP属地云南 |只看该作者
zzn88 发表于 2017-2-23 19:44
楼主 有安装 10.12吗,

把吗去掉,哈哈

Rank: 2Rank: 2

UID
4810396
帖子
128
PB币
92
贡献
0
技术
0
活跃
149
13F
发表于 2017-6-11 14:12:46 IP属地北京 |只看该作者
谢谢老大的分享,老大辛苦了!!!

Rank: 2Rank: 2

UID
4810396
帖子
128
PB币
92
贡献
0
技术
0
活跃
149
14F
发表于 2017-6-11 15:53:06 IP属地北京 |只看该作者
shiy05 发表于 2017-6-10 16:34
把吗去掉,哈哈

哈哈。。。老大也幽默啊

Rank: 2Rank: 2

UID
1941688
帖子
260
PB币
44
贡献
0
技术
25
活跃
224
15F
发表于 2017-6-29 00:26:07 IP属地湖北 |只看该作者
好烦,又没币了

Rank: 5Rank: 5Rank: 5

UID
3044354
帖子
580
PB币
662
贡献
0
技术
0
活跃
429
16F
发表于 2017-6-29 00:59:11 IP属地云南 来自手机 |只看该作者
爱在1394 发表于 2017-6-29 00:26
好烦,又没币了

这个帖子过时了,请看我最新的帖子,在审核中

Rank: 2Rank: 2

UID
1941688
帖子
260
PB币
44
贡献
0
技术
25
活跃
224
17F
发表于 2017-6-29 02:11:08 IP属地湖北 |只看该作者
shiy05 发表于 2017-6-29 00:59
这个帖子过时了,请看我最新的帖子,在审核中

谢谢兄弟非常感谢

Rank: 7Rank: 7Rank: 7

UID
2937488
帖子
1475
PB币
2164
贡献
0
技术
34
活跃
975
18F
发表于 2017-7-27 17:54:48 IP属地香港 |只看该作者
into Scope label \_SB.PCI0.LPCB.H_EC code_regex (B1MA,)\s+(64) replace_matched begin BXMA,%2,//%1%2 end;

楼主,我想问一个问题,“%2,//%1%2”代表什么?请赐教!

Rank: 7Rank: 7Rank: 7

UID
2713534
帖子
1849
PB币
288
贡献
0
技术
0
活跃
2281
19F
发表于 2019-2-8 17:11:51 IP属地河北 来自手机 |只看该作者
谢谢分享!!!!!

Rank: 7Rank: 7Rank: 7

UID
2713534
帖子
1849
PB币
288
贡献
0
技术
0
活跃
2281
20F
发表于 2019-2-8 17:43:17 IP属地河北 |只看该作者

谢谢兄弟非常感谢
回顶部
Copyright (C) 2005-2024 pcbeta.com, All rights reserved
Powered by Discuz!  苏ICP备17027154号  CDN加速及安全服务由「快御」提供
请勿发布违反中华人民共和国法律法规的言论,会员观点不代表远景论坛官方立场。
远景在线 | 远景论坛 | 苹果论坛 | Win11论坛 | Win10论坛 | Win8论坛 | Win7论坛 | WP论坛 | Office论坛