### Query macOS IORegistry for Hardware Information (Objective-C) Source: https://context7.com/benbaker76/hackintool/llms.txt Provides functions to query the macOS IORegistry for detailed hardware information. This includes retrieving GPU model and VRAM, platform IDs, PCI devices, network interfaces, storage devices, Bluetooth devices, and checking for ACPI entries. It also allows getting device paths for bootloader configuration. ```objc // Get Intel GPU model and VRAM information bool getIGPUModelAndVRAM( NSString **gpuModel, // Output: GPU model name uint32_t &gpuDeviceID, // Output: Device ID uint32_t &gpuVendorID, // Output: Vendor ID (0x8086 for Intel) mach_vm_size_t &vramSize, // Output: Total VRAM mach_vm_size_t &vramFree // Output: Free VRAM ); // Get current platform ID from IORegistry bool getPlatformID(uint32_t *platformID); // Example usage uint32_t platformID; if (getPlatformID(&platformID)) { NSLog(@"Current Platform ID: 0x%08X", platformID); } // Get PCI device information bool getIORegPCIDeviceArray(NSMutableArray **pciDeviceArray); // Get network interface information bool getIORegNetworkArray(NSMutableArray **networkInterfacesArray); // Get storage device information bool getIORegStorageArray(NSMutableArray **storageArray); // Get Bluetooth device information bool getIORegBluetoothArray(NSMutableArray **propertyArray); // Check if ACPI device exists bool hasACPIEntry(NSString *name); // Example: if (hasACPIEntry(@"IGPU")) { ... } // Get device path for bootloader configuration bool getDevicePath(NSString *search, NSString **devicePath); // Returns paths like "PciRoot(0x0)/Pci(0x2,0x0)" ``` -------------------------------- ### Generate and Decode Mac Serial Numbers (C) Source: https://context7.com/benbaker76/hackintool/llms.txt Provides functions for generating and decoding Apple serial numbers used in SMBIOS configuration. Includes structures for serial information and functions to get serial details, generate new serials, and create MLB serials. Requires C compiler. ```c // Serial number information structure typedef struct { const char *appleModel; // e.g., "MacBookPro15,1" char country[4]; // Manufacturing location char year[3]; // Production year char week[3]; // Production week char line[4]; // Production line char model[5]; // Model code int32_t decodedYear; // Decoded year (2010-2030) int32_t decodedWeek; // Decoded week (1-53) bool valid; // Validation result } SERIALINFO; // Decode an existing serial number bool get_serial_info( const char *serial, // 11 or 12 character serial SERIALINFO *info, // Output: decoded information bool print // Print debug info ); // Generate a new serial number bool get_serial(SERIALINFO *info); // Generate MLB (Main Logic Board) serial void get_mlb( SERIALINFO *info, // Serial info for generation char *dst, // Output buffer size_t sz // Buffer size (min 32 bytes) ); // Example usage: SERIALINFO info; info.appleModel = "MacBookPro15,1"; if (get_serial(&info)) { printf("Generated Serial: %s%s%s%s%s\n", info.country, info.year, info.week, info.line, info.model); char mlb[MLB_MAX_SIZE]; get_mlb(&info, mlb, sizeof(mlb)); printf("Generated MLB: %s\n", mlb); } ``` -------------------------------- ### Intel Framebuffer Data Structures and Reading Function (C++) Source: https://context7.com/benbaker76/hackintool/llms.txt Defines C++ structures for Intel framebuffer configurations (e.g., FramebufferSKL, ConnectorInfo) and an example function `readFramebuffer` to read and prepare framebuffer data for modification. It supports various Intel GPU generations and connector types, outputting original and modifiable framebuffer data along with size and count. ```c++ // Framebuffer structure for Skylake and newer (FramebufferSKL) struct FramebufferSKL { uint32_t framebufferID; // Platform ID (e.g., 0x191e0000) uint32_t fPchType; // PCH type (4 = non-LP chipset) uint64_t fModelNameAddr; // Pointer to model name string uint8_t fMobile; // 1 = mobile, 0 = desktop uint8_t fPipeCount; // Number of display pipes uint8_t fPortCount; // Number of display ports uint8_t fFBMemoryCount; // Framebuffer memory count uint32_t fStolenMemorySize; // Stolen memory per framebuffer uint32_t fFramebufferMemorySize; // Boot framebuffer memory uint32_t fUnifiedMemorySize; // Unified memory (VRAM) ConnectorInfo connectors[4]; // Display connector definitions FramebufferFlags flags; // Feature flags // ... additional fields }; // Connector information structure struct ConnectorInfo { int8_t index; // Connector index (0-3, or -1 for disabled) uint8_t busID; // GMBUS ID (4=HDMIC, 5=HDMIB, 6=HDMID) uint8_t pipe; // Display pipe assignment uint8_t pad; ConnectorType type; // ConnectorLVDS, ConnectorDP, ConnectorHDMI, etc. ConnectorFlags flags; // Connector-specific flags }; // Example: Reading and modifying framebuffer data bool readFramebuffer( const char *fileName, // Path to framebuffer dump file IntelGen &intelGen, // Output: detected Intel generation uint8_t **originalFramebufferList, // Output: original framebuffer data uint8_t **modifiedFramebufferList, // Output: modifiable copy uint32_t &framebufferSize, // Output: size of each framebuffer uint32_t &framebufferCount // Output: number of framebuffers ); // Connector types available enum ConnectorType : uint32_t { ConnectorZero = 0x0, // Disabled ConnectorDummy = 0x1, // Dummy connector ConnectorLVDS = 0x2, // Internal display (eDP) ConnectorDigitalDVI = 0x4, // Digital DVI ConnectorDP = 0x400, // DisplayPort ConnectorHDMI = 0x800, // HDMI }; ``` -------------------------------- ### Data Conversion and System Information Utilities (Objective-C) Source: https://context7.com/benbaker76/hackintool/llms.txt Collection of Objective-C helper functions for data manipulation and system information retrieval. Includes conversions to NSData, Base64, and hex strings, byte reversal, command execution, and fetching system details like kernel name, hostname, OS version, memory, CPU, and Metal GPU info. Requires Objective-C runtime. ```objc // Convert uint32 to NSData for Device Properties NSData *getNSDataUInt32(uint32_t uint32Value); // Convert to base64 string for Clover patches NSString *getBase64String(uint32_t uint32Value); // Convert data to hex byte string NSMutableString *getByteString(NSData *data); // Example output: "00 00 02 01" // Reverse byte order (little-endian conversion) uint32_t getReverseBytes(uint32_t value); // Execute shell command bool launchCommand( NSString *launchPath, // e.g., @"/bin/ls" NSArray *arguments, // e.g., @[@"-la", @"/"] NSString **stdoutString // Output: command output ); // Execute command with admin privileges bool launchCommandAsAdmin( NSString *launchPath, NSArray *arguments, NSString **stdoutString, NSString **stderrString ); // Get system information NSString *getKernelName(); // e.g., "Darwin" NSString *getHostName(); // Machine hostname NSString *getOSName(); // e.g., "macOS Sonoma 14.0" NSString *getMemSize(); // e.g., "16 GB" NSString *getCPUInfo(); // CPU model and specs // Get Metal GPU information bool getMetalInfo( NSString **name, // GPU name bool &isLowPower, // Is integrated GPU bool &isHeadless // Is compute-only GPU ); // Generate random UUID NSString *getUUID(); ``` -------------------------------- ### Disk and EFI Partition Management (Objective-C) Source: https://context7.com/benbaker76/hackintool/llms.txt Objective-C class for managing storage devices, including mounting, unmounting, and ejecting disks and partitions. It provides methods to check filesystem types (EFI, HFS+, APFS) and mount states. ```objc @interface Disk : NSObject @property (nonatomic, retain) NSString *mediaName; // e.g., "APPLE SSD" @property (nonatomic, retain) NSString *mediaBSDName; // e.g., "disk0s1" @property (nonatomic, retain) NSString *mediaUUID; // Partition UUID @property (nonatomic, retain) NSString *volumeName; // Volume name @property (nonatomic, retain) NSURL *volumePath; // Mount point @property (nonatomic, retain) NSString *volumeType; // Filesystem type @property (nonatomic, retain) NSNumber *mediaSize; // Size in bytes @property Boolean isBootableEFI; // Is bootable EFI // Mount the disk/partition - (bool)mount:(NSString **)stdoutString stderrString:(NSString **)stderrString; // Unmount the disk/partition - (bool)unmount:(NSString **)stdoutString stderrString:(NSString **)stderrString; // Eject removable media - (bool)eject:(NSString **)stdoutString stderrString:(NSString **)stderrString; // Get size information - (bool)sizeInfo:(NSNumber **)totalSize freeSize:(NSNumber **)freeSize; // Filesystem type checks - (BOOL)isHFS; // HFS+ filesystem - (BOOL)isEFI; // EFI System Partition - (BOOL)isAPFS; // APFS volume - (BOOL)isAPFSContainer; // APFS container // Mount state and attributes - (BOOL)isMounted; - (BOOL)isMountable; - (BOOL)isWriteable; - (BOOL)isRemovable; - (BOOL)isInternal; @end // Disk media type UUIDs #define DISKMEDIA_EFI @"C12A7328-F81F-11D2-BA4B-00A0C93EC93B" #define DISKMEDIA_HFS_PLUS @"48465300-0000-11AA-AA11-00306543ECAC" #define DISKMEDIA_APPLE_APFS @"7C3457EF-0000-11AA-AA11-00306543ECAC" ``` -------------------------------- ### Audio Device Detection and AppleALC Layout ID Management (Objective-C) Source: https://context7.com/benbaker76/hackintool/llms.txt Objective-C classes and functions for detecting audio hardware, retrieving device information, and configuring AppleALC layout IDs. Includes the AudioDevice class for representing audio hardware and functions to interact with IORegistry for audio properties. ```objc @interface AudioDevice : NSObject @property uint32_t deviceID; // PCI device ID @property uint32_t revisionID; // Hardware revision @property uint32_t layoutID; // Current layout ID @property uint32_t alcLayoutID; // AppleALC layout ID @property uint32_t codecID; // Audio codec ID @property uint32_t codecRevisionID; // Codec revision @property (nonatomic, retain) NSString *audioDeviceName; @property (nonatomic, retain) NSString *codecName; @property (nonatomic, retain) NSString *vendorName; @property (nonatomic, retain) NSMutableArray *layoutIDArray; // Supported layouts - (id)initWithDeviceBundleID:(NSString *)bundleID deviceClass:(NSString *)deviceClass audioDeviceName:(NSString *)audioDeviceName audioDeviceManufacturerName:(NSString *)audioDeviceManufacturerName audioDeviceModelID:(uint32_t)audioDeviceModelID deviceID:(uint32_t)deviceID revisionID:(uint32_t)revisionID alcLayoutID:(uint32_t)alcLayoutID subDeviceID:(uint32_t)subDeviceID; @end // Get audio device information from IORegistry bool getIORegAudioDeviceArray(NSMutableArray **propertyDictionaryArray); // Get audio properties for bootloader configuration bool getAudioProperties( AppDelegate *appDelegate, NSString *name, // Device name (e.g., "HDEF") NSMutableDictionary *configDictionary // Output configuration ); ``` -------------------------------- ### Manage USB Ports for macOS Functionality (Objective-C) Source: https://context7.com/benbaker76/hackintool/llms.txt Facilitates USB port management in macOS by monitoring device connections and providing tools for configuration. It includes functions for detecting USB controllers and ports, registering for connection events, exporting configurations as kexts or SSDTs, and retrieving detailed USB information. ```objc // USB connector types (matching ACPI _UPC specification) enum UsbConnector { kTypeA = 0x00, // USB Type-A connector kMiniAB = 0x01, // Mini-AB connector kExpressCard = 0x02, // ExpressCard kUSB3StandardA = 0x03, // USB 3 Standard-A connector kUSB3StandardB = 0x04, // USB 3 Standard-B connector kUSB3MicroB = 0x05, // USB 3 Micro-B connector kTypeCUSB2Only = 0x08, // Type-C USB 2.0 only kTypeCSSSw = 0x09, // Type-C with switch kTypeCSS = 0x0A, // Type-C without switch kInternal = 0xFF // Internal connector }; // Register for USB device plug/unplug notifications void usbRegisterEvents(AppDelegate *appDelegate); void usbUnRegisterEvents(); // Export USB port configuration as kext void exportUSBPortsKext(AppDelegate *appDelegate); // Export USB port configuration as SSDT void exportUSBPortsSSDT(AppDelegate *appDelegate); // Get USB controller information bool getIORegUSBControllersPropertyDictionaryArray( NSMutableArray **propertyDictionaryArray ); // Get USB port information for all controllers bool getIORegUSBPortsPropertyDictionaryArray( NSMutableArray **propertyDictionaryArray ); // Get connector type string for display NSString *getUSBConnectorType(UsbConnector usbConnector); // Returns: @"USB2", @"USB3", @"TypeC+Sw", @"TypeC", @"Internal", etc. // Get USB device speed string NSString *getUSBConnectorSpeed(uint8_t speed); // Returns: @"1.5 Mbit/s", @"12 Mbit/s", @"480 Mbit/s", @"5 Gbit/s", @"10 Gbit/s" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.