/* * KERNEL_AND_KEXT_PATCHES.h * * Created on: 4 Feb 2021 * Author: jief */ #ifndef __KERNEL_AND_KEXT_PATCHES_H__ #define __KERNEL_AND_KEXT_PATCHES_H__ #include "../cpp_foundation/XBuffer.h" #include "../libeg/libeg.h" #include "MacOsVersion.h" extern "C" { # include } class ABSTRACT_PATCH { public: bool Disabled = bool(); // XString8 Comment = XString8(); XBuffer Data = XBuffer (); XBuffer Patch = XBuffer (); XBuffer MaskFind = XBuffer (); XBuffer MaskReplace = XBuffer (); XBuffer StartPattern = XBuffer (); XBuffer StartMask = XBuffer (); INTN SearchLen = INTN(); INTN Count = INTN(); INTN Skip = INTN(); XString8 MatchOS = XString8(); XString8 MatchBuild = XString8(); // Computed XString8 Name = XString8(); XString8 Label = XString8(); // TODO : it's a calculated value from comment field. /** Returns a boolean and then enable disable the patch if MachOSEntry have a match for the booted OS. */ bool IsPatchEnabledByBuildNumber(const XString8& Build); bool IsPatchEnabled(const MacOsVersion& CurrOS); }; class ABSTRACT_KEXT_OR_KERNEL_PATCH : public ABSTRACT_PATCH { public: bool IsPlistPatch = BOOLEAN(); XString8 ProcedureName = XString8(); //procedure len will be StartPatternLen INPUT_ITEM MenuItem = INPUT_ITEM(); }; class KEXT_PATCH : public ABSTRACT_KEXT_OR_KERNEL_PATCH { public: bool IsPlistPatch = BOOLEAN(); INPUT_ITEM MenuItem = INPUT_ITEM(); }; class KERNEL_PATCH : public ABSTRACT_KEXT_OR_KERNEL_PATCH { public: INPUT_ITEM MenuItem = INPUT_ITEM(); }; class BOOT_PATCH : public ABSTRACT_PATCH { public: INPUT_ITEM MenuItem = INPUT_ITEM(); }; class KERNEL_AND_KEXT_PATCHES { public: bool KPDebug = bool(); bool KPKernelLapic = bool(); bool KPKernelXCPM = bool(); bool _KPKernelPm = bool(); bool KPPanicNoKextDump = bool(); bool _KPAppleIntelCPUPM = bool(); bool KPAppleRTC = bool(); bool EightApple = bool(); bool KPDELLSMBIOS = bool(); // Dell SMBIOS patch UINT32 FakeCPUID = UINT32(); XString8 KPATIConnectorsController = XString8(); XBuffer KPATIConnectorsData = XBuffer(); XBuffer KPATIConnectorsPatch = XBuffer(); XStringWArray ForceKextsToLoad = XStringWArray(); XObjArray KextPatches = XObjArray(); XObjArray KernelPatches = XObjArray(); XObjArray BootPatches = XObjArray(); } ; #endif