Skip to content

Commit

Permalink
Fixup + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
J P committed Jan 11, 2020
1 parent f9c160f commit 2d07050
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
42 changes: 22 additions & 20 deletions MacProMemoryNotificationDisabler.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<group>"; };
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; };
Expand Down Expand Up @@ -78,26 +78,26 @@
isa = PBXGroup;
children = (
4120B1C12198DCD200888F5A /* SDK */,
4120B1B82198DC9B00888F5A /* SystemProfilerMemoryFixup */,
4120B1B82198DC9B00888F5A /* MacProMemoryNotificationDisabler */,
4120B1B72198DC9B00888F5A /* Products */,
);
sourceTree = "<group>";
};
4120B1B72198DC9B00888F5A /* Products */ = {
isa = PBXGroup;
children = (
4120B1B62198DC9B00888F5A /* SystemProfilerMemoryFixup.kext */,
4120B1B62198DC9B00888F5A /* MacProMemoryNotificationDisabler.kext */,
);
name = Products;
sourceTree = "<group>";
};
4120B1B82198DC9B00888F5A /* SystemProfilerMemoryFixup */ = {
4120B1B82198DC9B00888F5A /* MacProMemoryNotificationDisabler */ = {
isa = PBXGroup;
children = (
4120B1BB2198DC9B00888F5A /* Info.plist */,
4120B1F22198DE3F00888F5A /* kern_start.cpp */,
);
path = SystemProfilerMemoryFixup;
path = MacProMemoryNotificationDisabler;
sourceTree = "<group>";
};
4120B1C12198DCD200888F5A /* SDK */ = {
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */
Expand All @@ -205,15 +205,15 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = Goldfish64;
ORGANIZATIONNAME = IOIIIO;
TargetAttributes = {
4120B1B52198DC9B00888F5A = {
CreatedOnToolsVersion = 10.1;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "SystemProfilerMemoryFixup" */;
buildConfigurationList = 4120B1B02198DC9A00888F5A /* Build configuration list for PBXProject "MacProMemoryNotificationDisabler" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -225,7 +225,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
4120B1B52198DC9B00888F5A /* SystemProfilerMemoryFixup */,
4120B1B52198DC9B00888F5A /* MacProMemoryNotificationDisabler */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -367,20 +367,21 @@
4120B1BF2198DC9B00888F5A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
GCC_PREPROCESSOR_DEFINITIONS = (
"MODULE_VERSION=$(MODULE_VERSION)",
"PRODUCT_NAME=$(PRODUCT_NAME)",
"$(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;
Expand All @@ -393,20 +394,21 @@
4120B1C02198DC9B00888F5A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
GCC_PREPROCESSOR_DEFINITIONS = (
"MODULE_VERSION=$(MODULE_VERSION)",
"PRODUCT_NAME=$(PRODUCT_NAME)",
"$(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;
Expand All @@ -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 */,
Expand All @@ -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 */,
Expand Down
8 changes: 6 additions & 2 deletions MacProMemoryNotificationDisabler/kern_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
#include <Headers/kern_api.hpp>
#include <Headers/kern_file.hpp>

// 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;

Expand Down Expand Up @@ -54,6 +55,9 @@ static UserPatcher::BinaryModInfo binaryPatchesCatalina[] {
{ binPathMemorySlotNotification, &patchBytesMemorySlotNotification, 1},
};

// System Information process info.
static UserPatcher::ProcInfo procInfoCatalina = { binPathSystemInformationCatalina, static_cast<uint32_t>(strlen(binPathSystemInformationCatalina)), 1 };

static void buildPatch(KernelPatcher &patcher, const char *path, uint8_t *findBuffer) {
DBGLOG("MacProMemoryNotificationDisabler", "buildPatches() start");

Expand All @@ -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;
}
Expand Down Expand Up @@ -132,6 +135,7 @@ PluginConfiguration ADDPR(config) {
bootargBeta,
arrsize(bootargBeta),
KernelVersion::Catalina,
KernelVersion::Catalina,
[]() {
mpmndStart();
}
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 2d07050

Please sign in to comment.