From 2d0705041104e6b8bb13830967f9ea93856f96b2 Mon Sep 17 00:00:00 2001 From: J P Date: Sat, 11 Jan 2020 20:24:40 +0100 Subject: [PATCH] Fixup + readme --- LICENSE | 1 + .../project.pbxproj | 42 ++++++++++--------- .../kern_start.cpp | 8 +++- README.md | 6 ++- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/LICENSE b/LICENSE index d6d29e9..823fa5d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License Copyright (c) 2018 Goldfish64 +Copyright (c) 2020 IOIIIO Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MacProMemoryNotificationDisabler.xcodeproj/project.pbxproj b/MacProMemoryNotificationDisabler.xcodeproj/project.pbxproj index 887e8d9..e717de5 100644 --- a/MacProMemoryNotificationDisabler.xcodeproj/project.pbxproj +++ b/MacProMemoryNotificationDisabler.xcodeproj/project.pbxproj @@ -34,7 +34,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 4120B1B62198DC9B00888F5A /* SystemProfilerMemoryFixup.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SystemProfilerMemoryFixup.kext; sourceTree = BUILT_PRODUCTS_DIR; }; + 4120B1B62198DC9B00888F5A /* MacProMemoryNotificationDisabler.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MacProMemoryNotificationDisabler.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 4120B1BB2198DC9B00888F5A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 4120B1C32198DCF000888F5A /* libkmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libkmod.a; path = Lilu.kext/Contents/Resources/Library/libkmod.a; sourceTree = SOURCE_ROOT; }; 4120B1C42198DCF000888F5A /* plugin_start.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = plugin_start.cpp; path = Lilu.kext/Contents/Resources/Library/plugin_start.cpp; sourceTree = SOURCE_ROOT; }; @@ -78,7 +78,7 @@ isa = PBXGroup; children = ( 4120B1C12198DCD200888F5A /* SDK */, - 4120B1B82198DC9B00888F5A /* SystemProfilerMemoryFixup */, + 4120B1B82198DC9B00888F5A /* MacProMemoryNotificationDisabler */, 4120B1B72198DC9B00888F5A /* Products */, ); sourceTree = ""; @@ -86,18 +86,18 @@ 4120B1B72198DC9B00888F5A /* Products */ = { isa = PBXGroup; children = ( - 4120B1B62198DC9B00888F5A /* SystemProfilerMemoryFixup.kext */, + 4120B1B62198DC9B00888F5A /* MacProMemoryNotificationDisabler.kext */, ); name = Products; sourceTree = ""; }; - 4120B1B82198DC9B00888F5A /* SystemProfilerMemoryFixup */ = { + 4120B1B82198DC9B00888F5A /* MacProMemoryNotificationDisabler */ = { isa = PBXGroup; children = ( 4120B1BB2198DC9B00888F5A /* Info.plist */, 4120B1F22198DE3F00888F5A /* kern_start.cpp */, ); - path = SystemProfilerMemoryFixup; + path = MacProMemoryNotificationDisabler; sourceTree = ""; }; 4120B1C12198DCD200888F5A /* SDK */ = { @@ -180,9 +180,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 4120B1B52198DC9B00888F5A /* SystemProfilerMemoryFixup */ = { + 4120B1B52198DC9B00888F5A /* MacProMemoryNotificationDisabler */ = { isa = PBXNativeTarget; - buildConfigurationList = 4120B1BE2198DC9B00888F5A /* Build configuration list for PBXNativeTarget "SystemProfilerMemoryFixup" */; + buildConfigurationList = 4120B1BE2198DC9B00888F5A /* Build configuration list for PBXNativeTarget "MacProMemoryNotificationDisabler" */; buildPhases = ( 4120B1B12198DC9B00888F5A /* Headers */, 4120B1B22198DC9B00888F5A /* Sources */, @@ -193,9 +193,9 @@ ); dependencies = ( ); - name = SystemProfilerMemoryFixup; + name = MacProMemoryNotificationDisabler; productName = SystemProfilerMemoryFixup; - productReference = 4120B1B62198DC9B00888F5A /* SystemProfilerMemoryFixup.kext */; + productReference = 4120B1B62198DC9B00888F5A /* MacProMemoryNotificationDisabler.kext */; productType = "com.apple.product-type.kernel-extension"; }; /* End PBXNativeTarget section */ @@ -205,7 +205,7 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1010; - ORGANIZATIONNAME = Goldfish64; + ORGANIZATIONNAME = IOIIIO; TargetAttributes = { 4120B1B52198DC9B00888F5A = { CreatedOnToolsVersion = 10.1; @@ -213,7 +213,7 @@ }; }; }; - buildConfigurationList = 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "SystemProfilerMemoryFixup" */; + buildConfigurationList = 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "MacProMemoryNotificationDisabler" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = en; hasScannedForEncodings = 0; @@ -225,7 +225,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 4120B1B52198DC9B00888F5A /* SystemProfilerMemoryFixup */, + 4120B1B52198DC9B00888F5A /* MacProMemoryNotificationDisabler */, ); }; /* End PBXProject section */ @@ -304,7 +304,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -357,7 +357,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; @@ -367,6 +367,7 @@ 4120B1BF2198DC9B00888F5A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( "MODULE_VERSION=$(MODULE_VERSION)", @@ -374,13 +375,13 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; - INFOPLIST_FILE = SystemProfilerMemoryFixup/Info.plist; + INFOPLIST_FILE = MacProMemoryNotificationDisabler/Info.plist; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Lilu.kext/Contents/Resources/Library", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MODULE_NAME = fish.goldfish64.SystemProfilerMemoryFixup; + MODULE_NAME = meow.IOIIIO.MacProMemoryNotificationDisabler; MODULE_START = "$(PRODUCT_NAME)_kern_start"; MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; MODULE_VERSION = 1.0.0; @@ -393,6 +394,7 @@ 4120B1C02198DC9B00888F5A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( "MODULE_VERSION=$(MODULE_VERSION)", @@ -400,13 +402,13 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; - INFOPLIST_FILE = SystemProfilerMemoryFixup/Info.plist; + INFOPLIST_FILE = MacProMemoryNotificationDisabler/Info.plist; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Lilu.kext/Contents/Resources/Library", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MODULE_NAME = fish.goldfish64.SystemProfilerMemoryFixup; + MODULE_NAME = meow.IOIIIO.MacProMemoryNotificationDisabler; MODULE_START = "$(PRODUCT_NAME)_kern_start"; MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; MODULE_VERSION = 1.0.0; @@ -419,7 +421,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "SystemProfilerMemoryFixup" */ = { + 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "MacProMemoryNotificationDisabler" */ = { isa = XCConfigurationList; buildConfigurations = ( 4120B1BC2198DC9B00888F5A /* Debug */, @@ -428,7 +430,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4120B1BE2198DC9B00888F5A /* Build configuration list for PBXNativeTarget "SystemProfilerMemoryFixup" */ = { + 4120B1BE2198DC9B00888F5A /* Build configuration list for PBXNativeTarget "MacProMemoryNotificationDisabler" */ = { isa = XCConfigurationList; buildConfigurations = ( 4120B1BF2198DC9B00888F5A /* Debug */, diff --git a/MacProMemoryNotificationDisabler/kern_start.cpp b/MacProMemoryNotificationDisabler/kern_start.cpp index 19ba41e..76a07f9 100644 --- a/MacProMemoryNotificationDisabler/kern_start.cpp +++ b/MacProMemoryNotificationDisabler/kern_start.cpp @@ -25,8 +25,9 @@ #include #include -// Path to binary. +// Paths to binaries. static const char *binPathMemorySlotNotification = "/System/Library/CoreServices/MemorySlotNotification"; +static const char *binPathSystemInformationCatalina = "/System/Applications/Utilities/System Information.app/Contents/MacOS/System Information"; static const uint32_t SectionActive = 1; @@ -54,6 +55,9 @@ static UserPatcher::BinaryModInfo binaryPatchesCatalina[] { { binPathMemorySlotNotification, &patchBytesMemorySlotNotification, 1}, }; +// System Information process info. +static UserPatcher::ProcInfo procInfoCatalina = { binPathSystemInformationCatalina, static_cast(strlen(binPathSystemInformationCatalina)), 1 }; + static void buildPatch(KernelPatcher &patcher, const char *path, uint8_t *findBuffer) { DBGLOG("MacProMemoryNotificationDisabler", "buildPatches() start"); @@ -62,7 +66,6 @@ static void buildPatch(KernelPatcher &patcher, const char *path, uint8_t *findBu uint8_t *buffer = FileIO::readFileToBuffer(path, outSize); if (buffer == NULL) { DBGLOG("MacProMemoryNotificationDisabler", "Failed to read binary: %s\n", path); - procInfo.section = procInfo.SectionDisabled; procInfoCatalina.section = procInfoCatalina.SectionDisabled; return; } @@ -132,6 +135,7 @@ PluginConfiguration ADDPR(config) { bootargBeta, arrsize(bootargBeta), KernelVersion::Catalina, + KernelVersion::Catalina, []() { mpmndStart(); } diff --git a/README.md b/README.md index 5338599..81a1ecb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ -# SystemProfilerMemoryFixup -[Lilu](https://github.com/acidanthera/Lilu) plugin for showing the memory tab on MacBookAir and MacBookPro10,x platforms. The tab is normally hidden as these models have soldered memory. +# MacProMemoryNotificationDisabler +[Lilu](https://github.com/acidanthera/Lilu) plugin for disabling the "more than maximum amount of memory" popup on MacPro7,1. + +Based on Goldfish64's [SystemProfilerMemoryFixup](https://github.com/Goldfish64/SystemProfilerMemoryFixup)