Skip to content

Commit

Permalink
Fix compilation with Lilu 1.4.0
Browse files Browse the repository at this point in the history
Closes #4.
  • Loading branch information
al3xtjames committed Nov 27, 2019
1 parent 52b78d4 commit 220f4d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
6 changes: 3 additions & 3 deletions NoTouchID.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "cd \"${TARGET_BUILD_DIR}\"\n\ndist=(\"$FULL_PRODUCT_NAME\")\nif [ -d \"$DWARF_DSYM_FILE_NAME\" ]; then dist+=(\"$DWARF_DSYM_FILE_NAME\"); fi\n\narchive=\"${MODULE_VERSION} ($(echo $CONFIGURATION | tr /a-z/ /A-Z/)).zip\"\nrm -rf *.zip\nif [ \"$CONFIGURATION\" == \"Release\" ]; then\n strip -x -T \"${EXECUTABLE_PATH}\" &>/dev/null || strip -x \"${EXECUTABLE_PATH}\"\nfi\nzip -qry \"${archive}\" \"${dist[@]}\"";
shellScript = "cd \"${TARGET_BUILD_DIR}\"\n\ndist=(\"$FULL_PRODUCT_NAME\")\nif [ -d \"$DWARF_DSYM_FILE_NAME\" ]; then dist+=(\"$DWARF_DSYM_FILE_NAME\"); fi\n\narchive=\"${PRODUCT_NAME}-${MODULE_VERSION}-$(echo $CONFIGURATION | tr /a-z/ /A-Z/).zip\"\nrm -rf *.zip\nif [ \"$CONFIGURATION\" == \"Release\" ]; then\n strip -x -T \"${EXECUTABLE_PATH}\" &>/dev/null || strip -x \"${EXECUTABLE_PATH}\"\nfi\nzip -qry -FS \"${archive}\" \"${dist[@]}\"\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -350,7 +350,7 @@
MODULE_NAME = xyz.racermaster.NoTouchID;
MODULE_START = "$(PRODUCT_NAME)_kern_start";
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
MODULE_VERSION = 1.0.2;
MODULE_VERSION = 1.0.3;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down Expand Up @@ -397,7 +397,7 @@
MODULE_NAME = xyz.racermaster.NoTouchID;
MODULE_START = "$(PRODUCT_NAME)_kern_start";
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
MODULE_VERSION = 1.0.2;
MODULE_VERSION = 1.0.3;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down
19 changes: 8 additions & 11 deletions NoTouchID/kern_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
#include <Headers/kern_api.hpp>

// Target framework
static const char *binPath = "/System/Library/PrivateFrameworks/BiometricKit.framework/Versions/A/BiometricKit";
static const char binPath[] = "/System/Library/PrivateFrameworks/BiometricKit.framework/Versions/A/BiometricKit";

// Accompanied processes
static const char *procList[] {
"/System/Library/Frameworks/LocalAuthentication.framework/Support/DaemonUtils.framework/Versions/A/DaemonUtils"
};
static const char procPath[] = "/System/Library/Frameworks/LocalAuthentication.framework/Support/DaemonUtils.framework/Versions/A/DaemonUtils";

static const uint8_t find[] = "board-id";
static const uint8_t repl[] = "board-ix";

static_assert(sizeof(find) == sizeof(repl), "Invalid patch size");

static UserPatcher::BinaryModPatch patch {
CPU_TYPE_X86_64,
0,
find,
repl,
strlen(reinterpret_cast<const char *>(find)),
sizeof(find) - 1,
0,
1,
UserPatcher::FileSegment::SegmentTextCstring,
Expand All @@ -38,15 +39,11 @@ UserPatcher::BinaryModInfo ADDPR(binaryMod)[] {
const size_t ADDPR(binaryModSize) = 1;

static UserPatcher::ProcInfo ADDPR(procInfo)[] {
{ procList[0], static_cast<uint32_t>(strlen(procList[0])), 1 }
{ procPath, sizeof(procPath) - 1, 1 }
};

const size_t ADDPR(procInfoSize) = 1;

static void noBioStart() {
lilu.onProcLoad(ADDPR(procInfo), ADDPR(procInfoSize), nullptr, nullptr, ADDPR(binaryMod), ADDPR(binaryModSize));
}

static const char *bootargOff[] {
"-nobiooff"
};
Expand All @@ -68,6 +65,6 @@ PluginConfiguration ADDPR(config) {
KernelVersion::HighSierra,
KernelVersion::Catalina,
[]() {
noBioStart();
lilu.onProcLoad(ADDPR(procInfo), ADDPR(procInfoSize), nullptr, nullptr, ADDPR(binaryMod), ADDPR(binaryModSize));
}
};

0 comments on commit 220f4d4

Please sign in to comment.