void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) { // copy the blocks // counting variables used to encode multiple block info S32 block_count = 0; char* block_name = NULL; // loop through msg blocks to loop through variables, totalling up size // data and filling the new (send) message LLMsgData::msg_blk_data_map_t::const_iterator iter = data.mMemberBlocks.begin(); LLMsgData::msg_blk_data_map_t::const_iterator end = data.mMemberBlocks.end(); for(; iter != end; ++iter) { const LLMsgBlkData* mbci = iter->second; if(!mbci) continue; // do we need to encode a block code? if (block_count == 0) { block_count = mbci->mBlockNumber; block_name = (char*)mbci->mName; } // counting down mutliple blocks block_count--; nextBlock(block_name); // now loop through the variables LLMsgBlkData::msg_var_data_map_t::const_iterator dit = mbci->mMemberVarData.begin(); LLMsgBlkData::msg_var_data_map_t::const_iterator dend = mbci->mMemberVarData.end(); for(; dit != dend; ++dit) { const LLMsgVarData& mvci = *dit; const char* varname = mvci.getName(); switch(mvci.getType()) { case MVT_FIXED: addBinaryData(varname, mvci.getData(), mvci.getSize()); break; case MVT_VARIABLE: { const char end = ((const char*)mvci.getData())[mvci.getSize()-1]; // Ensure null terminated if (mvci.getDataSize() == 1 && end == 0) { addString(varname, (const char*)mvci.getData()); } else { addBinaryData(varname, mvci.getData(), mvci.getSize()); } break; } case MVT_U8: addU8(varname, *(U8*)mvci.getData()); break; case MVT_U16: addU16(varname, *(U16*)mvci.getData()); break; case MVT_U32: addU32(varname, *(U32*)mvci.getData()); break; case MVT_U64: addU64(varname, *(U64*)mvci.getData()); break; case MVT_S8: addS8(varname, *(S8*)mvci.getData()); break; case MVT_S16: addS16(varname, *(S16*)mvci.getData()); break; case MVT_S32: addS32(varname, *(S32*)mvci.getData()); break; // S64 not supported in LLSD so we just truncate it case MVT_S64: addS32(varname, *(S64*)mvci.getData()); break; case MVT_F32: addF32(varname, *(F32*)mvci.getData()); break; case MVT_F64: addF64(varname, *(F64*)mvci.getData()); break; case MVT_LLVector3: addVector3(varname, *(LLVector3*)mvci.getData()); break; case MVT_LLVector3d: addVector3d(varname, *(LLVector3d*)mvci.getData()); break; case MVT_LLVector4: addVector4(varname, *(LLVector4*)mvci.getData()); break; case MVT_LLQuaternion: { LLVector3 v = *(LLVector3*)mvci.getData(); LLQuaternion q; q.unpackFromVector3(v); addQuat(varname, q); break; } case MVT_LLUUID: addUUID(varname, *(LLUUID*)mvci.getData()); break; case MVT_BOOL: addBOOL(varname, *(BOOL*)mvci.getData()); break; case MVT_IP_ADDR: addIPAddr(varname, *(U32*)mvci.getData()); break; case MVT_IP_PORT: addIPPort(varname, *(U16*)mvci.getData()); break; case MVT_U16Vec3: //treated as an array of 6 bytes addBinaryData(varname, mvci.getData(), 6); break; case MVT_U16Quat: //treated as an array of 8 bytes addBinaryData(varname, mvci.getData(), 8); break; case MVT_S16Array: addBinaryData(varname, mvci.getData(), mvci.getSize()); break; default: llwarns << "Unknown type in conversion of message to LLSD" << llendl; break; } } } }
void PrintConfig(CFTypeRef data) { const Byte *dataPtr = NULL; CFIndex length = 0; CFTypeID typeID; int i; // Get the OF variable's type. typeID = CFGetTypeID(data); if (typeID == CFDataGetTypeID()) { length = CFDataGetLength(data); if (length == 0) return; else dataPtr = CFDataGetBytePtr(data); } else { printf("<INVALID> settings\n"); return; } if (length != sizeof(SETTINGS_DATA)) { // errx(1, "Error the version of clover-genconfig didn't match current booted clover version"); printf("Error the version of clover-genconfig didn't match current booted clover version\n"); printf("len=%d sizeof=%d\n", (int)length, (int)sizeof(SETTINGS_DATA)); } SETTINGS_DATA *s = (SETTINGS_DATA*)dataPtr; CFMutableDictionaryRef dict = CFDictionaryCreateMutable ( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); if (s->ConfigName != NULL) { addUString(dict, CFSTR("ConfigName"), (const UniChar *)&s->ConfigName); } else { addString(dict, CFSTR("ConfigName"), "config"); } //Boot CFMutableDictionaryRef bootDict = addDict(dict, CFSTR("Boot")); addString(bootDict, CFSTR("Arguments"), s->BootArgs); addUString(bootDict, CFSTR("Legacy"), (const UniChar *)&s->LegacyBoot); // addUString(bootDict, CFSTR("LegacyEntry"), s->LegacyBiosCustomEntry); addInteger(bootDict, CFSTR("XMPDetection"), s->XMPDetection); addUString(bootDict, CFSTR("DefaultVolume"), (const UniChar *)&s->DefaultVolume); addUString(bootDict, CFSTR("DefaultLoader"), (const UniChar *)&s->DefaultLoader); addBoolean(bootDict, CFSTR("Log"), s->Debug); addString(bootDict, CFSTR("Timeout"), "_NOT_SHOWN_"); addBoolean(bootDict, CFSTR("Fast"), 0); // SystemParameters CFMutableDictionaryRef systemParametersDict = addDict(dict, CFSTR("SystemParameters")); addUString(systemParametersDict, CFSTR("CustomUUID"), (const UniChar *)&s->CustomUuid); addBoolean(systemParametersDict, CFSTR("InjectSystemID"), s->InjectSystemID); addHex(systemParametersDict, CFSTR("BacklightLevel"),s->BacklightLevel); // addBoolean(systemParametersDict, CFSTR("InjectKexts"), 0); addString(systemParametersDict, CFSTR("InjectKexts"), "Detect"); // GUI CFMutableDictionaryRef guiDict = addDict(dict, CFSTR("GUI")); addString(guiDict, CFSTR("Language"), s->Language); addString(guiDict, CFSTR("Theme"), "BGM"); addBoolean(guiDict, CFSTR("TextOnly"), 0); addBoolean(guiDict, CFSTR("CustomIcons"), 0); CFMutableDictionaryRef mouseDict = addDict(guiDict, CFSTR("Mouse")); addBoolean(mouseDict, CFSTR("Enabled"), s->PointerEnabled); addInteger(mouseDict, CFSTR("Speed"), s->PointerSpeed); addInteger(mouseDict, CFSTR("DoubleClick"), s->DoubleClickTime); addBoolean(mouseDict, CFSTR("Mirror"), s->PointerMirror); CFMutableArrayRef hideArray = addArray(guiDict, CFSTR("Hide")); addStringToArray(hideArray, "VolumeName_NOT_SHOWN"); addStringToArray(hideArray, "VolumeUUID_NOT_SHOWN"); addStringToArray(hideArray, "EntryPath_NOT_SHOWN"); CFMutableDictionaryRef scanDict = addDict(guiDict, CFSTR("Scan")); addString(scanDict, CFSTR("Comment"), "These values wrong, they present for sample"); addBoolean(scanDict, CFSTR("Entries"), 1); addBoolean(scanDict, CFSTR("Tool"), 1); addBoolean(scanDict, CFSTR("Legacy"), 1); CFMutableDictionaryRef customDict = addDict(guiDict, CFSTR("Custom")); addString(customDict, CFSTR("Comment"), "These values wrong, they present for sample"); CFMutableArrayRef entriesArray = addArray(customDict, CFSTR("Entries")); CFMutableDictionaryRef entries1Dict = addDictToArray(entriesArray); addString(entries1Dict, CFSTR("Comment"), "These values wrong, they present for sample"); addString(entries1Dict, CFSTR("Volume"), "VolumeUUID_NOT_SHOWN"); addString(entries1Dict, CFSTR("Path"), "_NOT_SHOWN_"); addString(entries1Dict, CFSTR("Type"), "_NOT_SHOWN_"); addString(entries1Dict, CFSTR("Arguments"), "_NOT_SHOWN_"); addString(entries1Dict, CFSTR("Title"), "_NOT_SHOWN_"); addString(entries1Dict, CFSTR("FullTitle"), "_NOT_SHOWN_"); addString(entries1Dict, CFSTR("Image"), "_NOT_SHOWN_"); addString(entries1Dict, CFSTR("Hotkey"), "_NOT_SHOWN_"); addBoolean(entries1Dict, CFSTR("Disabled"), 1); addBoolean(entries1Dict, CFSTR("InjectKexts"), 1); addBoolean(entries1Dict, CFSTR("NoCaches"), 0); addBoolean(entries1Dict, CFSTR("Hidden"), 1); CFMutableArrayRef subEntriesArray = addArray(entries1Dict, CFSTR("SubEntries")); CFMutableDictionaryRef subEntries1Dict = addDictToArray(subEntriesArray); addString(subEntries1Dict, CFSTR("Title"), "_NOT_SHOWN_"); addString(subEntries1Dict, CFSTR("AddArguments"), "_NOT_SHOWN_"); CFMutableArrayRef legacyArray = addArray(customDict, CFSTR("Legacy")); CFMutableDictionaryRef legacy1Dict = addDictToArray(legacyArray); addString(legacy1Dict, CFSTR("Volume"), "VolumeUUID_NOT_SHOWN"); addString(legacy1Dict, CFSTR("Type"), "_NOT_SHOWN_"); addString(legacy1Dict, CFSTR("Title"), "_NOT_SHOWN_"); addString(legacy1Dict, CFSTR("Hotkey"), "_NOT_SHOWN_"); addBoolean(legacy1Dict, CFSTR("Disabled"), 1); addBoolean(legacy1Dict, CFSTR("Hidden"), 1); CFMutableArrayRef toolArray = addArray(customDict, CFSTR("Tool")); CFMutableDictionaryRef tool1Dict = addDictToArray(toolArray); addString(tool1Dict, CFSTR("Volume"), "VolumeUUID_NOT_SHOWN"); addString(tool1Dict, CFSTR("Path"), "_NOT_SHOWN_"); addString(tool1Dict, CFSTR("Type"), "_NOT_SHOWN_"); addString(tool1Dict, CFSTR("Title"), "_NOT_SHOWN_"); addString(tool1Dict, CFSTR("Arguments"), "_NOT_SHOWN_"); addString(tool1Dict, CFSTR("Hotkey"), "_NOT_SHOWN_"); addBoolean(tool1Dict, CFSTR("Disabled"), 1); addBoolean(tool1Dict, CFSTR("Hidden"), 1); /* CFMutableDictionaryRef volumesDict = addDict(guiDict, CFSTR("Volumes")); addInteger(volumesDict, CFSTR("Hide Count"), s->HVCount); CFMutableDictionaryRef hideEntriesDict = addDict(guiDict, CFSTR("HideEntries")); addBoolean(hideEntriesDict, CFSTR("OSXInstall"), s->HVHideAllOSXInstall); addBoolean(hideEntriesDict, CFSTR("Recovery"), s->HVHideAllRecovery); addBoolean(hideEntriesDict, CFSTR("Duplicate"), s->HVHideDuplicatedBootTarget); addBoolean(hideEntriesDict, CFSTR("WindowsEFI"), s->HVHideAllWindowsEFI); addBoolean(hideEntriesDict, CFSTR("Ubuntu"), s->HVHideAllUbuntu); addBoolean(hideEntriesDict, CFSTR("Grub"), s->HVHideAllGrub); addBoolean(hideEntriesDict, CFSTR("Gentoo"), s->HVHideAllGentoo); addBoolean(hideEntriesDict, CFSTR("OpticalUEFI"), s->HVHideOpticalUEFI); addBoolean(hideEntriesDict, CFSTR("InternalUEFI"), s->HVHideInternalUEFI); addBoolean(hideEntriesDict, CFSTR("ExternalUEFI"), s->HVHideExternalUEFI); addBoolean(hideEntriesDict, CFSTR("UEFIBootOptions"), s->HVHideUEFIBootOptions); */ // SMBIOS CFMutableDictionaryRef smbiosDict = addDict(dict, CFSTR("SMBIOS")); // SMBIOS TYPE0 addString(smbiosDict, CFSTR("BiosVendor"), s->VendorName); addString(smbiosDict, CFSTR("BiosVersion"), s->RomVersion); addString(smbiosDict, CFSTR("BiosReleaseDate"), s->ReleaseDate); // SMBIOS TYPE1 addString(smbiosDict, CFSTR("Manufacturer"), s->ManufactureName); addString(smbiosDict, CFSTR("ProductName"), s->ProductName); addString(smbiosDict, CFSTR("Version"), s->VersionNr); addString(smbiosDict, CFSTR("SerialNumber"), s->SerialNr); addUUID(smbiosDict, CFSTR("SmUUID"), (UInt8 *)&s->SmUUID); addString(smbiosDict, CFSTR("Family"), s->FamilyName); // SMBIOS TYPE2 addString(smbiosDict, CFSTR("BoardManufacturer"), s->BoardManufactureName); addString(smbiosDict, CFSTR("BoardSerialNumber"), s->BoardSerialNumber); addString(smbiosDict, CFSTR("Board-ID"), s->BoardNumber); addString(smbiosDict, CFSTR("BoardVersion"), s->BoardVersion); addInteger(smbiosDict, CFSTR("BoardType"), s->BoardType); addString(smbiosDict, CFSTR("LocationInChassis"), s->LocationInChassis); addString(smbiosDict, CFSTR("ChassisManufacturer"), s->ChassisManufacturer); addString(smbiosDict, CFSTR("ChassisAssetTag"), s->ChassisAssetTag); addHex(smbiosDict, CFSTR("ChassisType"), s->ChassisType); addBoolean(smbiosDict, CFSTR("Mobile"), s->Mobile); // SMBIOS TYPE17 addBoolean(smbiosDict, CFSTR("Trust"), s->TrustSMBIOS); addString(smbiosDict, CFSTR("OEMProduct"), s->OEMProduct); addString(smbiosDict, CFSTR("OEMVendor"), s->OEMVendor); addString(smbiosDict, CFSTR("OEMBoard"), s->OEMBoard); if (s->InjectMemoryTables) { CFMutableDictionaryRef memoryDict = addDict(smbiosDict, CFSTR("Memory")); addString(memoryDict, CFSTR("Comment"), "there are no real data here"); addInteger(memoryDict, CFSTR("SlotCount"), 0); addInteger(memoryDict, CFSTR("Channels"), 0); CFMutableArrayRef modulesArray = addArray(memoryDict, CFSTR("Modules")); CFMutableDictionaryRef moduleDict = addDictToArray(modulesArray); addInteger(moduleDict, CFSTR("Slot"), 0); addInteger(moduleDict, CFSTR("Size"), 0); addString(moduleDict, CFSTR("Vendor"), s->MemoryManufacturer); addString(moduleDict, CFSTR("Serial"), s->MemorySerialNumber); addString(moduleDict, CFSTR("Part"), s->MemoryPartNumber); addString(moduleDict, CFSTR("Frequency"), s->MemorySpeed); addString(moduleDict, CFSTR("Type"), "DDRx"); } // CPU CFMutableDictionaryRef cpuDict = addDict(dict, CFSTR("CPU")); addInteger(cpuDict, CFSTR("Type"), s->CpuType); addInteger(cpuDict, CFSTR("FrequencyMHz"), s->CpuFreqMHz); addInteger(cpuDict, CFSTR("BusSpeedkHz"), s->BusSpeed); addInteger(cpuDict, CFSTR("QPI"), s->QPI); addInteger(cpuDict, CFSTR("SavingMode"), s->SavingMode); // these values read only addInteger(cpuDict, CFSTR("EnabledCores"), s->EnabledCores); addBoolean(cpuDict, CFSTR("C2"), s->EnableC2); addBoolean(cpuDict, CFSTR("C4"), s->EnableC4); addBoolean(cpuDict, CFSTR("C6"), s->EnableC6); addInteger(cpuDict, CFSTR("Latency"), s->C3Latency); // Devices CFMutableDictionaryRef pciDict = addDict(dict, CFSTR("Devices")); addBoolean(pciDict, CFSTR("Inject"), s->StringInjector); addString(pciDict, CFSTR("Properties"), "_NOT_SHOWN_"); // addInteger(pciDict, CFSTR("PCIRootUID"), s->PCIRootUID); addBoolean(pciDict, CFSTR("NoDefaultProperties"), s->NoDefaultProperties); CFMutableArrayRef appPropArray = addArray(pciDict, CFSTR("AddProperties")); CFMutableDictionaryRef appPropDict = addDictToArray(appPropArray); addString(appPropDict, CFSTR("Device"), "XXX"); addString(appPropDict, CFSTR("Key"), "AAPL,XXX"); addHex(appPropDict, CFSTR("Value"), 0xFFFF); CFMutableDictionaryRef fakeIDDict = addDict(pciDict, CFSTR("FakeID")); addHex(fakeIDDict, CFSTR("ATI"), s->FakeATI); addHex(fakeIDDict, CFSTR("NVidia"), s->FakeNVidia); addHex(fakeIDDict, CFSTR("IntelGFX"), s->FakeIntel); addHex(fakeIDDict, CFSTR("LAN"), s->FakeLAN); addHex(fakeIDDict, CFSTR("WIFI"), s->FakeWIFI); addHex(fakeIDDict, CFSTR("SATA"), s->FakeSATA); addHex(fakeIDDict, CFSTR("XHCI"), s->FakeXHCI); addHex(fakeIDDict, CFSTR("IMEI"), s->FakeIMEI); CFMutableDictionaryRef audioDict = addDict(pciDict, CFSTR("Audio")); if (s->HDAInjection) addInteger(audioDict, CFSTR("Inject"), s->HDALayoutId); else addBoolean(audioDict, CFSTR("Inject"), s->HDAInjection); addBoolean(pciDict, CFSTR("UseIntelHDMI"), s->UseIntelHDMI); CFMutableDictionaryRef usbDict = addDict(pciDict, CFSTR("USB")); addBoolean(usbDict, CFSTR("Inject"), s->USBInjection); addBoolean(usbDict, CFSTR("FixOwnership"), s->USBFixOwnership); addBoolean(usbDict, CFSTR("AddClockID"), s->InjectClockID); addBoolean(usbDict, CFSTR("HighCurrent"), s->HighCurrent); // Graphics CFMutableDictionaryRef graphicsDict = addDict(dict, CFSTR("Graphics")); CFMutableDictionaryRef injectDict = addDict(graphicsDict, CFSTR("Inject")); addBoolean(injectDict, CFSTR("ATI"), s->InjectATI); addBoolean(injectDict, CFSTR("NVidia"), s->InjectNVidia); addBoolean(injectDict, CFSTR("Intel"), s->InjectIntel); addBoolean(graphicsDict, CFSTR("LoadVBios"), s->LoadVBios); addBoolean(graphicsDict, CFSTR("InjectEDID"), s->InjectEDID); addString(graphicsDict, CFSTR("CustomEDID"), "_NOT_SHOWN_"); addBoolean(graphicsDict, CFSTR("PatchVBios"), s->PatchVBios); addInteger(graphicsDict, CFSTR("VideoPorts"), s->VideoPorts); addInteger(graphicsDict, CFSTR("VRAM"), s->VRAM); addInteger(graphicsDict, CFSTR("DualLink"), s->DualLink); // ATI specific" addUString(graphicsDict, CFSTR("FBName"), (const UniChar *)&s->FBName); // NVIDIA specific addIntArray(graphicsDict, CFSTR("display-cfg"), &s->Dcfg[0], 8); addIntArray(graphicsDict, CFSTR("NVCAP"), &s->NVCAP[0], 20); // INTEL specific addHex(graphicsDict, CFSTR("ig-platform-id"), s->IgPlatform); addInteger(graphicsDict, CFSTR("PatchVBiosBytes Count"), s->PatchVBiosBytesCount); CFMutableArrayRef vbiosArray = addArray(graphicsDict, CFSTR("PatchVBiosBytes")); CFMutableDictionaryRef vbiosDict = addDictToArray(vbiosArray); addString(vbiosDict, CFSTR("Find"), "_NOT_SHOWN_"); addString(vbiosDict, CFSTR("Replace"), "_NOT_SHOWN_"); //ACPI CFMutableDictionaryRef acpiDict = addDict(dict, CFSTR("ACPI")); addHex(acpiDict, CFSTR("ResetAddress"), s->ResetAddr); addHex(acpiDict, CFSTR("ResetValue"), s->ResetVal); addBoolean(acpiDict, CFSTR("HaltEnabler"), s->SlpSmiEnable); addBoolean(acpiDict, CFSTR("PatchAPIC"), s->PatchNMI); addBoolean(acpiDict, CFSTR("smartUPS"), s->smartUPS); CFMutableDictionaryRef dsdtDict = addDict(acpiDict, CFSTR("DSDT")); addUString(dsdtDict, CFSTR("Name"), (const UniChar *)&s->DsdtName); // addHex(dsdtDict, CFSTR("FixMask"), s->FixDsdt); addBoolean(dsdtDict, CFSTR("Debug"), s->DebugDSDT); addBoolean(dsdtDict, CFSTR("ReuseFFFF"), s->ReuseFFFF); addBoolean(dsdtDict, CFSTR("SuspendOverride"), s->SuspendOverride); addBoolean(dsdtDict, CFSTR("Rtc8Allowed"), s->Rtc8Allowed); // addBoolean(dsdtDict, CFSTR("SlpSmiAtWake"), s->SlpWak); addInteger(dsdtDict, CFSTR("Patches count"), s->PatchDsdtNum); CFMutableDictionaryRef fixDict = addDict(dsdtDict, CFSTR("Fixes")); addBoolean(fixDict, CFSTR("AddDTGP_0001"), !!(s->FixDsdt & FIX_DTGP)); addBoolean(fixDict, CFSTR("FixDarwin_0002"), !!(s->FixDsdt & FIX_WARNING)); addBoolean(fixDict, CFSTR("FixShutdown_0004"), !!(s->FixDsdt & FIX_SHUTDOWN)); addBoolean(fixDict, CFSTR("AddMCHC_0008"), !!(s->FixDsdt & FIX_MCHC)); addBoolean(fixDict, CFSTR("FixHPET_0010"), !!(s->FixDsdt & FIX_HPET)); addBoolean(fixDict, CFSTR("FakeLPC_0020"), !!(s->FixDsdt & FIX_LPC)); addBoolean(fixDict, CFSTR("FixIPIC_0040"), !!(s->FixDsdt & FIX_IPIC)); addBoolean(fixDict, CFSTR("FixSBUS_0080"), !!(s->FixDsdt & FIX_SBUS)); addBoolean(fixDict, CFSTR("FixDisplay_0100"), !!(s->FixDsdt & FIX_DISPLAY)); addBoolean(fixDict, CFSTR("FixIDE_0200"), !!(s->FixDsdt & FIX_IDE)); addBoolean(fixDict, CFSTR("FixSATA_0400"), !!(s->FixDsdt & FIX_SATA)); addBoolean(fixDict, CFSTR("FixFirewire_0800"), !!(s->FixDsdt & FIX_FIREWIRE)); addBoolean(fixDict, CFSTR("FixUSB_1000"), !!(s->FixDsdt & FIX_USB)); addBoolean(fixDict, CFSTR("FixLAN_2000"), !!(s->FixDsdt & FIX_LAN)); addBoolean(fixDict, CFSTR("FixAirport_4000"), !!(s->FixDsdt & FIX_WIFI)); addBoolean(fixDict, CFSTR("FixHDA_8000"), !!(s->FixDsdt & FIX_HDA)); // addBoolean(fixDict, CFSTR("FIX_DARWIN_10000"), !!(s->FixDsdt & FIX_DARWIN)); //deprecated addBoolean(fixDict, CFSTR("FIX_RTC_20000"), !!(s->FixDsdt & FIX_RTC)); addBoolean(fixDict, CFSTR("FIX_TMR_40000"), !!(s->FixDsdt & FIX_TMR)); addBoolean(fixDict, CFSTR("AddIMEI_80000"), !!(s->FixDsdt & FIX_IMEI)); addBoolean(fixDict, CFSTR("FIX_INTELGFX_100000"), !!(s->FixDsdt & FIX_INTELGFX)); addBoolean(fixDict, CFSTR("FIX_WAK_200000"), !!(s->FixDsdt & FIX_WAK)); addBoolean(fixDict, CFSTR("DeleteUnused_400000"), !!(s->FixDsdt & FIX_UNUSED)); addBoolean(fixDict, CFSTR("FIX_ADP1_800000"), !!(s->FixDsdt & FIX_ADP1)); addBoolean(fixDict, CFSTR("AddPNLF_1000000"), !!(s->FixDsdt & FIX_PNLF)); addBoolean(fixDict, CFSTR("FIX_S3D_2000000"), !!(s->FixDsdt & FIX_S3D)); addBoolean(fixDict, CFSTR("FIX_ACST_4000000"), !!(s->FixDsdt & FIX_ACST)); addBoolean(fixDict, CFSTR("AddHDMI_8000000"), !!(s->FixDsdt & FIX_HDMI)); addBoolean(fixDict, CFSTR("FixRegions_10000000"),!!(s->FixDsdt & FIX_REGIONS)); addBoolean(fixDict, CFSTR("NewWay_80000000"), !!(s->FixDsdt & FIX_NEW_WAY)); CFMutableArrayRef dsdtPatchArray = addArray(dsdtDict, CFSTR("Patches")); CFMutableDictionaryRef dsdtPatchDict = addDictToArray(dsdtPatchArray); addString(dsdtPatchDict, CFSTR("Comment"), "This is for sample"); addString(dsdtPatchDict, CFSTR("Find"), "_NOT_SHOWN_"); addString(dsdtPatchDict, CFSTR("Replace"), "_NOT_SHOWN_"); CFMutableDictionaryRef dsmDict = addDict(dsdtDict, CFSTR("DropOEM_DSM")); addBoolean(dsmDict, CFSTR("ATI"), !!(s->DropOEM_DSM & DEV_ATI)); addBoolean(dsmDict, CFSTR("IntelGFX"), !!(s->DropOEM_DSM & DEV_INTEL)); addBoolean(dsmDict, CFSTR("NVidia"), !!(s->DropOEM_DSM & DEV_NVIDIA)); addBoolean(dsmDict, CFSTR("LAN"), !!(s->DropOEM_DSM & DEV_LAN)); addBoolean(dsmDict, CFSTR("WIFI"), !!(s->DropOEM_DSM & DEV_WIFI)); addBoolean(dsmDict, CFSTR("HDA"), !!(s->DropOEM_DSM & DEV_HDA)); addBoolean(dsmDict, CFSTR("HDMI"), !!(s->DropOEM_DSM & DEV_HDMI)); addBoolean(dsmDict, CFSTR("LPC"), !!(s->DropOEM_DSM & DEV_LPC)); addBoolean(dsmDict, CFSTR("SmBUS"), !!(s->DropOEM_DSM & DEV_SMBUS)); addBoolean(dsmDict, CFSTR("Firewire"), !!(s->DropOEM_DSM & DEV_FIREWIRE)); addBoolean(dsmDict, CFSTR("USB"), !!(s->DropOEM_DSM & DEV_USB)); addBoolean(dsmDict, CFSTR("IDE"), !!(s->DropOEM_DSM & DEV_IDE)); addBoolean(dsmDict, CFSTR("SATA"), !!(s->DropOEM_DSM & DEV_SATA)); CFMutableDictionaryRef ssdtDict = addDict(acpiDict, CFSTR("SSDT")); CFMutableDictionaryRef genDict = addDict(ssdtDict, CFSTR("Generate")); addBoolean(genDict, CFSTR("PStates"), s->GeneratePStates); addBoolean(genDict, CFSTR("CStates"), s->GenerateCStates); addBoolean(ssdtDict, CFSTR("DropOem"), s->DropSSDT); addBoolean(ssdtDict, CFSTR("DoubleFirstState"), s->DoubleFirstState); addInteger(ssdtDict, CFSTR("MinMultiplier"), s->MinMultiplier); addInteger(ssdtDict, CFSTR("MaxMultiplier"), s->MaxMultiplier); addInteger(ssdtDict, CFSTR("PLimitDict"), s->PLimitDict); addInteger(ssdtDict, CFSTR("UnderVoltStep"), s->UnderVoltStep); addInteger(ssdtDict, CFSTR("PluginType"), s->PluginType); addBoolean(ssdtDict, CFSTR("UseSystemIO"), s->EnableISS); addBoolean(ssdtDict, CFSTR("EnableC2"), s->EnableC2); addBoolean(ssdtDict, CFSTR("EnableC4"), s->EnableC4); addBoolean(ssdtDict, CFSTR("EnableC6"), s->EnableC6); addBoolean(ssdtDict, CFSTR("EnableC7"), s->EnableC7); addInteger(ssdtDict, CFSTR("C3Latency"), s->C3Latency); CFMutableArrayRef dropArray = addArray(acpiDict, CFSTR("DropTables")); CFMutableDictionaryRef drop1Dict = addDictToArray(dropArray); addString(drop1Dict, CFSTR("Signature"), "_NOT_SHOWN_"); addString(drop1Dict, CFSTR("TableId"), "_NOT_SHOWN_"); addInteger(drop1Dict, CFSTR("Length"), 0); // KernelAndKextPatches CFMutableDictionaryRef KernelAndKextPatchesDict = addDict(dict, CFSTR("KernelAndKextPatches")); addBoolean(KernelAndKextPatchesDict, CFSTR("Debug"), s->KernelAndKextPatches.KPDebug); addBoolean(KernelAndKextPatchesDict, CFSTR("KernelCpu"), s->KernelAndKextPatches.KPKernelCpu); addBoolean(KernelAndKextPatchesDict, CFSTR("KernelPm"), s->KernelAndKextPatches.KPKernelPm); addBoolean(KernelAndKextPatchesDict, CFSTR("KernelLapic"), s->KernelAndKextPatches.KPLapicPanic); addBoolean(KernelAndKextPatchesDict, CFSTR("AppleRTC"), s->KernelAndKextPatches.KPAppleRTC); addBoolean(KernelAndKextPatchesDict, CFSTR("AsusAICPUPM"), s->KernelAndKextPatches.KPAsusAICPUPM); //addBoolean(KernelAndKextPatchesDict, CFSTR("KextPatchesAllowed"), s->KextPatchesAllowed); addInteger(KernelAndKextPatchesDict, CFSTR("Number_of_KextsToPatch"), s->KernelAndKextPatches.NrKexts); CFMutableArrayRef KKPatchArray = addArray(KernelAndKextPatchesDict, CFSTR("KextsToPatch")); for (i = 0; i < s->KernelAndKextPatches.NrKexts; i++) { patchDict[i] = addDictToArray(KKPatchArray); addString(patchDict[i], CFSTR("Name"), "_NOT_SHOWN_"); addString(patchDict[i], CFSTR("Find"), "_NOT_SHOWN_"); addString(patchDict[i], CFSTR("Replace"), "_NOT_SHOWN_"); } // CFMutableDictionaryRef rtVariablesDict = addDict(dict, CFSTR("RtVariables")); // addString(rtVariablesDict, CFSTR("ROM"), "_NOT_SHOWN_" /*s->RtROM*/); // addString(rtVariablesDict, CFSTR("MLB"), s->BoardSerialNumber); // addString(rtVariablesDict, CFSTR("MountEFI"), "_NOT_SHOWN_"); // addInteger(rtVariablesDict, CFSTR("LogLineCount"), s->LogLineCount); // addString(rtVariablesDict, CFSTR("LogEveryBoot"), "_NOT_SHOWN_"); CFMutableArrayRef disArray = addArray(dict, CFSTR("DisableDrivers")); addStringToArray(disArray, "_NOT_SHOWN_"); dump_plist(dict); printf("\nDsdtFix=%x\n", s->FixDsdt); printf("DsdtFix offset=%d\n", (int)offsetof(SETTINGS_DATA, FixDsdt)); printf("HDALayoutId offset=%d\n", (int)offsetof(SETTINGS_DATA, HDALayoutId)); #if defined(MDE_CPU_IA32) printf("32 bit generator\n"); #elif defined(MDE_CPU_X64) printf("64 bit generator\n"); #else printf("xxx bit generator\n"); #endif }