Skip to content

Commit

Permalink
Add ‘Inject Fake IGPU’ option, add Mieze’s IntelMausiEthernet kext
Browse files Browse the repository at this point in the history
  • Loading branch information
benbaker76 committed Apr 19, 2020
1 parent 5b1fd70 commit ef99641
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Hackintool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0339;
CURRENT_PROJECT_VERSION = 0340;
DEVELOPMENT_TEAM = 5LGHPJM9ZR;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_STRICT_OBJC_MSGSEND = NO;
Expand All @@ -728,7 +728,7 @@
HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2";
INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MARKETING_VERSION = 3.3.9;
MARKETING_VERSION = 3.4.0;
PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -748,7 +748,7 @@
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0339;
CURRENT_PROJECT_VERSION = 0340;
DEVELOPMENT_TEAM = 5LGHPJM9ZR;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_STRICT_OBJC_MSGSEND = NO;
Expand All @@ -762,7 +762,7 @@
HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2";
INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MARKETING_VERSION = 3.3.9;
MARKETING_VERSION = 3.4.0;
PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
4 changes: 3 additions & 1 deletion Hackintool/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct
bool InjectDeviceID;
bool USBPortLimit;
bool SpoofAudioDeviceID;
bool InjectFakeIGPU;
bool ShowInstalledOnly;
bool LSPCON_Enable;
bool LSPCON_AutoDetect;
Expand Down Expand Up @@ -320,6 +321,7 @@ typedef struct
@property (assign) IBOutlet NSButton *injectDeviceIDButton;
@property (assign) IBOutlet NSComboBox *injectDeviceIDComboBox;
@property (assign) IBOutlet NSButton *spoofAudioDeviceIDButton;
@property (assign) IBOutlet NSButton *injectFakeIGPUButton;
@property (assign) IBOutlet NSButton *usbPortLimitButton;
@property (assign) IBOutlet NSButton *generatePatchButton;
@property (assign) IBOutlet NSTextView *patchOutputTextView;
Expand Down Expand Up @@ -422,7 +424,7 @@ typedef struct
- (bool)isConnectorHeadless;
- (NSString *)getIORegName:(NSString *)ioregName;
- (bool)tryGetACPIPath:(NSString *)ioregName acpiPath:(NSString **)acpiPath;
- (void)getGPUDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary;
- (bool)tryGetGPUDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary;
- (bool)tryGetPCIDeviceDictionaryFromIORegName:(NSString *)name pciDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary;
- (bool)tryGetPCIDeviceDictionaryFromClassCode:(NSNumber *)code pciDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary;
- (bool)tryGetAudioController:(NSNumber *)deviceID vendorID:(NSNumber *)vendorID audioDevice:(AudioDevice *)foundAudioDevice;
Expand Down
22 changes: 18 additions & 4 deletions Hackintool/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ - (void)updateSettingsGUI
[_fbPortLimitComboBox selectItemAtIndex:(_settings.FBPortCount > 0 ? _settings.FBPortCount - 1 : 0)];
[_injectDeviceIDButton setState:_settings.InjectDeviceID];
[_spoofAudioDeviceIDButton setState:_settings.SpoofAudioDeviceID];
[_injectFakeIGPUButton setState:_settings.InjectFakeIGPU];
[_usbPortLimitButton setState:_settings.USBPortLimit];
[_showInstalledOnlyButton setState:_settings.ShowInstalledOnly];
[_lspconEnableDriverButton setState:_settings.LSPCON_Enable];
Expand Down Expand Up @@ -1699,12 +1700,17 @@ - (void)getFakeGPUDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary
[*pciDeviceDictionary setObject:@"Intel Corporation" forKey:@"VendorName"];
}

- (void)getGPUDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary
- (bool)tryGetGPUDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary
{
if ([self tryGetPCIDeviceDictionaryFromIORegName:@"IGPU" pciDeviceDictionary:pciDeviceDictionary])
return;
return true;

if (!_settings.InjectFakeIGPU)
return false;

[self getFakeGPUDeviceDictionary:pciDeviceDictionary];

return [self getFakeGPUDeviceDictionary:pciDeviceDictionary];
return true;
}

- (bool)tryGetPCIDeviceDictionaryFromIORegName:(NSString *)name pciDeviceDictionary:(NSMutableDictionary **)pciDeviceDictionary
Expand Down Expand Up @@ -5511,6 +5517,7 @@ - (void)setDefaults
@(2), @"FBPortCount",
@NO, @"InjectDeviceID",
@NO, @"SpoofAudioDeviceID",
@NO, @"InjectFakeIGPU",
@NO, @"USBPortLimit",
@NO, @"ApplyCurrentPatches",
@(0), @"SelectedAudioDevice",
Expand Down Expand Up @@ -5568,6 +5575,7 @@ - (void)loadSettings
_settings.FBPortCount = (uint32_t)[defaults integerForKey:@"FBPortCount"];
_settings.InjectDeviceID = [defaults boolForKey:@"InjectDeviceID"];
_settings.SpoofAudioDeviceID = [defaults boolForKey:@"SpoofAudioDeviceID"];
_settings.InjectFakeIGPU = [defaults boolForKey:@"InjectFakeIGPU"];
_settings.USBPortLimit = [defaults boolForKey:@"USBPortLimit"];
_settings.ApplyCurrentPatches = [defaults boolForKey:@"ApplyCurrentPatches"];
_settings.ShowInstalledOnly = [defaults boolForKey:@"ShowInstalledOnly"];
Expand Down Expand Up @@ -5621,6 +5629,7 @@ - (void)saveSettings
[defaults setBool:_settings.InjectDeviceID forKey:@"InjectDeviceID"];
[defaults setBool:_settings.USBPortLimit forKey:@"USBPortLimit"];
[defaults setBool:_settings.SpoofAudioDeviceID forKey:@"SpoofAudioDeviceID"];
[defaults setBool:_settings.InjectFakeIGPU forKey:@"InjectFakeIGPU"];
[defaults setBool:_settings.ApplyCurrentPatches forKey:@"ApplyCurrentPatches"];
[defaults setBool:_settings.ShowInstalledOnly forKey:@"ShowInstalledOnly"];
[defaults setBool:_settings.LSPCON_Enable forKey:@"LSPCON_Enable"];
Expand Down Expand Up @@ -7837,6 +7846,10 @@ - (IBAction)patchButtonClicked:(id)sender
{
_settings.SpoofAudioDeviceID = [_spoofAudioDeviceIDButton state];
}
else if (sender == _injectFakeIGPUButton)
{
_settings.InjectFakeIGPU = [_injectFakeIGPUButton state];
}
else if (sender == _usbPortLimitButton)
{
_settings.USBPortLimit = [_usbPortLimitButton state];
Expand Down Expand Up @@ -8383,7 +8396,8 @@ - (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
NSMutableDictionary *propertyDictionary = ([self isBootloaderOpenCore] ? [OpenCore getDevicePropertiesDictionaryWith:configDictionary typeName:@"Add"] : [Clover getDevicesPropertiesDictionaryWith:configDictionary]);
NSMutableDictionary *pciDeviceDictionary;

[self getGPUDeviceDictionary:&pciDeviceDictionary];
if (![self tryGetGPUDeviceDictionary:&pciDeviceDictionary])
return NO;

NSString *devicePath = [pciDeviceDictionary objectForKey:@"DevicePath"];
NSMutableDictionary *gpuProperties = [propertyDictionary objectForKey:devicePath];
Expand Down
Loading

0 comments on commit ef99641

Please sign in to comment.