1010#include < Headers/kern_api.hpp>
1111
1212// Target framework
13- static const char * binPath = " /System/Library/PrivateFrameworks/BiometricKit.framework/Versions/A/BiometricKit" ;
13+ static const char binPath[] = " /System/Library/PrivateFrameworks/BiometricKit.framework/Versions/A/BiometricKit" ;
1414
1515// Accompanied processes
16- static const char *procList[] {
17- " /System/Library/Frameworks/LocalAuthentication.framework/Support/DaemonUtils.framework/Versions/A/DaemonUtils"
18- };
16+ static const char procPath[] = " /System/Library/Frameworks/LocalAuthentication.framework/Support/DaemonUtils.framework/Versions/A/DaemonUtils" ;
1917
2018static const uint8_t find[] = " board-id" ;
2119static const uint8_t repl[] = " board-ix" ;
2220
21+ static_assert (sizeof (find) == sizeof (repl), " Invalid patch size" );
22+
2323static UserPatcher::BinaryModPatch patch {
2424 CPU_TYPE_X86_64,
25+ 0 ,
2526 find,
2627 repl,
27- strlen ( reinterpret_cast < const char *>( find)) ,
28+ sizeof ( find) - 1 ,
2829 0 ,
2930 1 ,
3031 UserPatcher::FileSegment::SegmentTextCstring,
@@ -38,15 +39,11 @@ UserPatcher::BinaryModInfo ADDPR(binaryMod)[] {
3839const size_t ADDPR (binaryModSize) = 1;
3940
4041static UserPatcher::ProcInfo ADDPR (procInfo)[] {
41- { procList[ 0 ], static_cast < uint32_t >( strlen (procList[ 0 ])) , 1 }
42+ { procPath, sizeof (procPath) - 1 , 1 }
4243};
4344
4445const size_t ADDPR (procInfoSize) = 1;
4546
46- static void noBioStart () {
47- lilu.onProcLoad (ADDPR (procInfo), ADDPR (procInfoSize), nullptr , nullptr , ADDPR (binaryMod), ADDPR (binaryModSize));
48- }
49-
5047static const char *bootargOff[] {
5148 " -nobiooff"
5249};
@@ -68,6 +65,6 @@ PluginConfiguration ADDPR(config) {
6865 KernelVersion::HighSierra,
6966 KernelVersion::Catalina,
7067 []() {
71- noBioStart ( );
68+ lilu. onProcLoad ( ADDPR (procInfo), ADDPR (procInfoSize), nullptr , nullptr , ADDPR (binaryMod), ADDPR (binaryModSize) );
7269 }
7370};
0 commit comments