Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
e8cc05f5
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e8cc05f5
编写于
11月 12, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAfterBootCompatLib: Fixed `EnableSafeModeSlide` on macOS 11.0
closes acidanthera/bugtracker#1276
上级
27817dd3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
4 deletion
+40
-4
Changelog.md
Changelog.md
+1
-0
Library/OcAfterBootCompatLib/CustomSlide.c
Library/OcAfterBootCompatLib/CustomSlide.c
+39
-4
未找到文件。
Changelog.md
浏览文件 @
e8cc05f5
...
...
@@ -10,6 +10,7 @@ OpenCore Changelog
-
Allowed launching tools and entries in text mode via
`TextMode`
-
Updated builtin firmware versions for SMBIOS and the rest
-
Fixed ACPI patches not applying if tables are in locked memory
-
Fixed
`EnableSafeModeSlide`
on macOS 11.0
#### v0.6.3
-
Added support for xml comments in plist files
...
...
Library/OcAfterBootCompatLib/CustomSlide.c
浏览文件 @
e8cc05f5
...
...
@@ -636,6 +636,12 @@ AppleSlideUnlockForSafeMode (
// }
// }
//
// The even newer workaround for 11.0 a newer is to patch the test.
// if (State & BOOT_MODE_SAFE) {
// * Do roughly nothing *
// } else {
// * Setup KASLR *
//
//
// This is a reasonable maximum distance to expect between the instructions.
...
...
@@ -643,6 +649,8 @@ AppleSlideUnlockForSafeMode (
STATIC
CONST
UINTN
MaxDist
=
0x10
;
STATIC
CONST
UINT8
SearchSeqNew
[]
=
{
0xF6
,
0xC4
,
0x40
,
0x75
};
STATIC
CONST
UINT8
SearchSeqNew2
[]
=
{
0x0F
,
0xBA
,
0xE0
,
0x0E
,
0x72
};
STATIC
CONST
UINT8
SearchSeqSur
[]
=
{
0xF6
,
0xC1
,
0x01
,
0x75
};
STATIC
CONST
UINT8
SearchSeqSur2
[]
=
{
0xF6
,
0xC1
,
0x01
,
0x74
};
STATIC
CONST
UINT8
SearchSeq
[]
=
{
0x01
,
0x40
,
0x00
,
0x00
};
UINT8
*
StartOff
;
...
...
@@ -651,6 +659,7 @@ AppleSlideUnlockForSafeMode (
UINTN
SecondOff
;
UINTN
SearchSeqNewSize
;
BOOLEAN
NewWay
;
UINT8
SurWay
;
StartOff
=
ImageBase
;
...
...
@@ -658,9 +667,11 @@ AppleSlideUnlockForSafeMode (
FirstOff
=
0
;
SecondOff
=
0
;
NewWay
=
FALSE
;
do
{
NewWay
=
FALSE
;
SurWay
=
0
;
while
(
StartOff
+
FirstOff
<=
EndOff
)
{
if
(
StartOff
+
FirstOff
<=
EndOff
-
1
&&
CompareMem
(
StartOff
+
FirstOff
,
SearchSeqNew2
,
sizeof
(
SearchSeqNew2
))
==
0
)
{
...
...
@@ -673,14 +684,20 @@ AppleSlideUnlockForSafeMode (
break
;
}
else
if
(
CompareMem
(
StartOff
+
FirstOff
,
SearchSeq
,
sizeof
(
SearchSeq
))
==
0
)
{
break
;
}
else
if
(
CompareMem
(
StartOff
+
FirstOff
,
SearchSeqSur
,
sizeof
(
SearchSeqSur
))
==
0
)
{
SurWay
=
1
;
break
;
}
else
if
(
CompareMem
(
StartOff
+
FirstOff
,
SearchSeqSur2
,
sizeof
(
SearchSeqSur2
))
==
0
)
{
SurWay
=
2
;
break
;
}
FirstOff
++
;
}
DEBUG
((
DEBUG_
VERBOSE
,
"OCABC: Found
first %d
at off %X
\n
"
,
(
UINT32
)
NewWay
,
DEBUG_
INFO
,
"OCABC: Found
kaslr %a way
at off %X
\n
"
,
SurWay
?
"sur"
:
(
NewWay
?
"new"
:
"legacy"
)
,
(
UINT32
)
FirstOff
));
...
...
@@ -692,6 +709,24 @@ AppleSlideUnlockForSafeMode (
break
;
}
if
(
SurWay
==
1
)
{
//
// Here we just patch the comparison code and the check by straight nopping.
//
DEBUG
((
DEBUG_VERBOSE
,
"OCABC: Patching sur safe mode aslr check...
\n
"
));
SetMem
(
StartOff
+
FirstOff
,
sizeof
(
SearchSeqSur
)
+
1
,
0x90
);
return
;
}
if
(
SurWay
==
2
)
{
//
// Here we just patch the comparison code and the check by straight nopping.
//
DEBUG
((
DEBUG_VERBOSE
,
"OCABC: Patching sur safe mode aslr check v2...
\n
"
));
*
(
StartOff
+
FirstOff
+
3
)
=
0xEB
;
return
;
}
if
(
NewWay
)
{
//
// Here we just patch the comparison code and the check by straight nopping.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录