Add ConfigValidator Command Line

Tools to check the config.plist, always using the latest release of CloverConfigPlistValidator from Jief_Machak.
This commit is contained in:
chris1111 2021-11-17 10:02:51 -05:00
parent 1ba1ba6d6c
commit 794d675c9b
5 changed files with 768 additions and 0 deletions

View File

@ -0,0 +1,284 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objects = {
/* Begin PBXBuildFile section */
83C6457727454B2B0075565C /* ConfigValidator.c in Sources */ = {isa = PBXBuildFile; fileRef = 83C6457627454B2B0075565C /* ConfigValidator.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
83C6457127454B2B0075565C /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
83C6457327454B2B0075565C /* ConfigValidator */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ConfigValidator; sourceTree = BUILT_PRODUCTS_DIR; };
83C6457627454B2B0075565C /* ConfigValidator.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ConfigValidator.c; sourceTree = "<group>"; };
83C6457D27454BC00075565C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
83C6457E27454BC30075565C /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
83C6457027454B2B0075565C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
83C6456A27454B2B0075565C = {
isa = PBXGroup;
children = (
83C6457D27454BC00075565C /* IOKit.framework */,
83C6457E27454BC30075565C /* CoreFoundation.framework */,
83C6457527454B2B0075565C /* ConfigValidator */,
83C6457427454B2B0075565C /* Products */,
);
sourceTree = "<group>";
};
83C6457427454B2B0075565C /* Products */ = {
isa = PBXGroup;
children = (
83C6457327454B2B0075565C /* ConfigValidator */,
);
name = Products;
sourceTree = "<group>";
};
83C6457527454B2B0075565C /* ConfigValidator */ = {
isa = PBXGroup;
children = (
83C6457627454B2B0075565C /* ConfigValidator.c */,
);
path = ConfigValidator;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
83C6457227454B2B0075565C /* ConfigValidator */ = {
isa = PBXNativeTarget;
buildConfigurationList = 83C6457A27454B2B0075565C /* Build configuration list for PBXNativeTarget "ConfigValidator" */;
buildPhases = (
83C6456F27454B2B0075565C /* Sources */,
83C6457027454B2B0075565C /* Frameworks */,
83C6457127454B2B0075565C /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = ConfigValidator;
productName = ConfigValidator;
productReference = 83C6457327454B2B0075565C /* ConfigValidator */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83C6456B27454B2B0075565C /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastUpgradeCheck = 1310;
TargetAttributes = {
83C6457227454B2B0075565C = {
CreatedOnToolsVersion = 13.1;
};
};
};
buildConfigurationList = 83C6456E27454B2B0075565C /* Build configuration list for PBXProject "ConfigValidator" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 83C6456A27454B2B0075565C;
productRefGroup = 83C6457427454B2B0075565C /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
83C6457227454B2B0075565C /* ConfigValidator */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
83C6456F27454B2B0075565C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
83C6457727454B2B0075565C /* ConfigValidator.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
83C6457827454B2B0075565C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
83C6457927454B2B0075565C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
};
name = Release;
};
83C6457B27454B2B0075565C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
83C6457C27454B2B0075565C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
83C6456E27454B2B0075565C /* Build configuration list for PBXProject "ConfigValidator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83C6457827454B2B0075565C /* Debug */,
83C6457927454B2B0075565C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83C6457A27454B2B0075565C /* Build configuration list for PBXNativeTarget "ConfigValidator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83C6457B27454B2B0075565C /* Debug */,
83C6457C27454B2B0075565C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83C6456B27454B2B0075565C /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,445 @@
#if 0
CloverConfigPlistValidator, Credit: Jief_Machak
ConfigValidator, Credit: chris1111
shc Version 3.8.9b, Copyright (c) 1994-2015 Francisco Rosales
#endif
static char data [] =
#define pswd_z 256
#define pswd ((&data[14]))
"\037\273\260\213\327\105\037\012\270\222\303\312\234\041\375\246"
"\242\120\257\327\221\356\100\034\134\052\303\033\172\032\037\055"
"\111\124\354\262\324\373\057\116\301\107\205\152\070\266\072\147"
"\161\157\051\220\036\101\333\334\163\160\246\132\044\133\206\042"
"\307\156\341\352\375\321\161\040\052\136\350\262\055\242\122\306"
"\367\354\346\110\263\340\143\317\170\302\243\104\017\124\233\170"
"\134\241\232\314\230\365\052\316\026\202\124\166\034\132\065\134"
"\103\205\066\064\006\317\137\041\365\277\003\112\072\247\350\203"
"\337\363\242\103\275\216\131\154\246\260\076\256\163\121\251\324"
"\303\042\113\076\376\213\263\057\314\214\012\225\160\264\077\075"
"\216\377\341\343\316\372\040\232\377\352\053\106\266\152\371\211"
"\331\053\153\324\205\273\133\261\340\216\160\334\172\203\020\255"
"\237\351\033\320\367\355\357\235\342\064\047\221\254\240\355\175"
"\224\157\076\006\026\256\200\042\311\011\056\077\317\331\222\071"
"\163\061\160\373\270\131\250\051\222\203\301\226\250\324\072\173"
"\256\042\212\223\213\260\117\261\312\046\322\027\212\237\302\073"
"\327\266\265\006\225\350\015\363\216\116\260\312\125\357\076\061"
"\260\253\115\310\007\107\056\004\213\233\202\252\364\323\230\023"
"\016\114\073\113\062\357\034\330\263\014\246\271\140\111\230\112"
"\050"
#define chk2_z 19
#define chk2 ((&data[306]))
"\155\304\321\241\031\376\022\105\337\221\070\204\270\216\252\021"
"\245\015\102\232\111\063\346"
#define rlax_z 1
#define rlax ((&data[328]))
"\156"
#define tst1_z 22
#define tst1 ((&data[333]))
"\116\352\214\230\367\163\055\222\340\152\131\124\266\024\010\216"
"\122\372\241\201\021\110\305\275\262\243\041\355"
#define date_z 1
#define date ((&data[357]))
"\327"
#define xecc_z 15
#define xecc ((&data[361]))
"\072\127\105\305\026\131\261\322\240\275\004\070\171\376\243\302"
"\211\061\024"
#define opts_z 1
#define opts ((&data[377]))
"\152"
#define tst2_z 19
#define tst2 ((&data[382]))
"\157\025\131\377\004\044\237\053\022\154\032\021\352\157\067\214"
"\140\054\276\200\213\113\264\062\167\146\100"
#define chk1_z 22
#define chk1 ((&data[410]))
"\317\330\301\342\134\051\330\333\153\321\104\020\370\312\012\263"
"\255\323\210\023\325\305\354\276\167\303\067\001\325"
#define msg1_z 42
#define msg1 ((&data[444]))
"\065\113\167\270\153\232\367\225\056\072\265\136\376\322\302\151"
"\100\036\322\234\206\060\150\323\104\007\344\145\025\044\024\065"
"\060\315\102\375\374\341\065\103\372\207\041\073\343\374\034\000"
"\374\314\057\171\064\134"
#define shll_z 8
#define shll ((&data[489]))
"\215\354\223\142\051\110\252\015\200\336\000"
#define inlo_z 3
#define inlo ((&data[499]))
"\300\104\206"
#define msg2_z 19
#define msg2 ((&data[502]))
"\322\336\203\073\332\027\063\137\030\353\144\224\144\266\036\025"
"\362\251\231\052\350"
#define lsto_z 1
#define lsto ((&data[523]))
"\047"
#define text_z 902
#define text ((&data[699]))
"\053\015\056\177\330\347\011\337\355\352\223\113\042\203\062\332"
"\150\250\212\113\345\170\007\134\015\373\264\240\040\123\120\117"
"\175\016\077\353\100\115\332\102\256\114\247\104\205\347\023\011"
"\012\035\025\021\061\223\214\150\154\050\270\112\216\237\132\216"
"\305\320\233\216\276\333\225\363\165\275\017\176\100\157\170\340"
"\300\274\355\222\337\012\204\103\347\364\306\252\231\023\064\302"
"\025\257\116\024\161\226\144\142\360\011\356\147\025\066\150\036"
"\030\071\344\044\171\205\107\020\231\315\262\250\357\057\154\136"
"\213\374\226\000\056\366\335\106\204\037\320\250\311\354\267\027"
"\015\077\352\256\323\123\123\237\063\273\147\143\217\172\072\170"
"\047\310\305\162\325\164\203\214\154\275\107\341\077\347\263\152"
"\345\335\167\234\305\030\125\344\063\044\224\231\002\122\003\033"
"\265\310\337\300\036\023\255\156\317\276\364\040\014\360\307\043"
"\014\337\130\343\206\123\135\005\151\267\354\361\162\326\257\254"
"\021\024\177\372\144\307\102\274\261\036\331\074\277\322\273\215"
"\274\030\165\001\050\123\233\013\071\200\074\356\102\300\125\334"
"\064\150\053\011\110\156\265\366\164\325\231\251\224\003\152\013"
"\173\314\025\035\023\223\122\172\353\274\003\332\032\132\133\004"
"\135\214\142\014\111\145\155\116\237\076\321\043\037\025\364\037"
"\053\136\006\274\073\163\004\336\246\372\004\024\116\315\353\133"
"\155\047\066\271\024\277\012\032\140\356\217\316\216\325\354\202"
"\230\301\203\263\264\013\266\100\212\257\376\030\243\137\266\002"
"\371\220\075\162\204\062\012\223\005\343\122\366\377\262\362\233"
"\175\103\202\060\220\120\365\107\200\106\043\072\254\353\356\257"
"\320\174\371\201\074\126\176\344\064\326\102\106\001\164\166\260"
"\347\331\100\323\324\367\267\034\104\213\077\313\260\042\147\250"
"\337\122\133\173\112\151\340\374\155\074\111\141\112\166\326\352"
"\164\234\227\270\062\135\201\350\016\322\032\201\132\174\043\311"
"\257\207\302\275\063\130\357\066\110\225\022\120\262\105\331\171"
"\335\015\256\312\367\252\126\063\360\307\174\362\007\015\172\203"
"\014\264\200\302\376\042\006\350\103\051\216\255\261\135\342\146"
"\320\073\305\212\121\015\327\304\271\247\172\055\331\205\053\146"
"\036\233\257\355\121\133\143\003\267\125\376\052\001\317\344\365"
"\304\062\004\326\304\361\117\143\357\140\301\347\063\171\052\034"
"\077\203\100\106\363\121\152\026\317\053\223\103\050\114\036\247"
"\100\326\274\347\372\160\274\345\162\274\215\313\372\033\156\263"
"\010\341\362\175\122\315\260\300\064\266\025\056\174\242\002\135"
"\116\327\311\161\154\065\373\053\310\305\324\372\346\144\205\236"
"\117\142\016\202\105\263\275\277\113\352\213\375\114\023\041\376"
"\322\340\025\356\060\351\247\361\200\317\221\145\243\325\146\033"
"\050\265\362\052\126\365\044\366\072\305\305\127\057\313\211\364"
"\013\207\232\330\224\170\040\362\106\312\232\247\226\072\042\166"
"\241\174\323\230\224\114\375\173\216\010\223\324\251\154\340\156"
"\176\142\231\165\351\274\237\273\236\264\165\014\015\166\350\071"
"\346\374\046\306\250\210\332\061\236\036\010\020\174\162\165\077"
"\272\331\373\133\210\207\315\271\206\145\234\036\317\362\141\171"
"\355\220\037\064\177\032\211\072\043\372\167\274\103\152\327\275"
"\064\134\173\055\322\333\063\324\250\352\314\111\212\355\250\320"
"\035\061\137\030\266\243\002\245\033\345\323\131\112\005\055\037"
"\054\033\216\147\321\217\264\200\272\047\311\374\277\263\162\340"
"\055\051\203\267\164\245\154\145\337\222\240\133\167\134\106\324"
"\213\022\356\330\066\346\350\220\014\307\271\061\045\033\367\170"
"\336\132\111\263\203\110\057\213\203\051\263\114\123\006\214\067"
"\336\033\306\166\341\324\267\230\231\043\252\233\263\200\223\150"
"\106\315\367\306\136\166\327\264\335\247\110\237\147\007\271\366"
"\050\260\144\247\150\240\156\302\351\372\305\155\350\052\306\040"
"\332\356\175\327\047\274\170\261\177\236\057\172\013\045\215\154"
"\375\243\007\201\144\255\274\222\117\033\037\156\217\220\071\266"
"\157\237\333\341\217\070\040\002\145\010\355\113\066\207\204\137"
"\233\167\326\207\011\146\057\223\163\260\230\373\362\032\252\016"
"\253\241\317\124\376\030\322\331\026\212\034\144\054\026\220\024"
"\110\140\033\142\227\006\133\044\252\177\205\225\133\172\301\076"
"\201\351\030\130\340\300\225\077\133\205\131\366\026\053\210\236"
"\363\344\176\105\276\241\211\023\114\347\123\352\132\136\247\111"
"\074\303\103\004\367\176\132\103\065\102\355\266\271\374\124\061"
"\005\070\051\137\013\012\106\203\374\056\350\255\220\114\002\243"
"\121\137\026\346\164\322\314\334\331\211\351\243\205\312\256\347"
"\055\041\031\133\246\334\364\374\212\362\004\205\331\347\134\254"
"\216\356\316\210\054\213\277\136\136\147\262\323\205\063\373\342"
"\233\270\067\003\305\164\236\330\270\233\041\261\307\237\236\002"
"\003\150\305\137\377\257\100\040\233\171\273\323\026\155\320\235"
"\241\157\073\052\170\260\170\054\066\313\203\017\207\375\012\335"
"\037\154\320\061\202\235\246\250\227\071"/* End of data[] */;
#define hide_z 4096
#define DEBUGEXEC 0 /* Define as 1 to debug execvp calls */
#define TRACEABLE 1 /* Define as 1 to enable ptrace the executable */
/* rtc.c */
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
/* 'Alleged RC4' */
static unsigned char stte[256], indx, jndx, kndx;
/*
* Reset arc4 stte.
*/
void stte_0(void)
{
indx = jndx = kndx = 0;
do {
stte[indx] = indx;
} while (++indx);
}
/*
* Set key. Can be used more than once.
*/
void key(void * str, int len)
{
unsigned char tmp, * ptr = (unsigned char *)str;
while (len > 0) {
do {
tmp = stte[indx];
kndx += tmp;
kndx += ptr[(int)indx % len];
stte[indx] = stte[kndx];
stte[kndx] = tmp;
} while (++indx);
ptr += 256;
len -= 256;
}
}
/*
* Crypt data.
*/
void arc4(void * str, int len)
{
unsigned char tmp, * ptr = (unsigned char *)str;
while (len > 0) {
indx++;
tmp = stte[indx];
jndx += tmp;
stte[indx] = stte[jndx];
stte[jndx] = tmp;
tmp += stte[indx];
*ptr ^= stte[tmp];
ptr++;
len--;
}
}
/* End of ARC4 */
/*
* Key with file invariants.
*/
int key_with_file(char * file)
{
struct stat statf[1];
struct stat control[1];
if (stat(file, statf) < 0)
return -1;
/* Turn on stable fields */
memset(control, 0, sizeof(control));
control->st_ino = statf->st_ino;
control->st_dev = statf->st_dev;
control->st_rdev = statf->st_rdev;
control->st_uid = statf->st_uid;
control->st_gid = statf->st_gid;
control->st_size = statf->st_size;
control->st_mtime = statf->st_mtime;
control->st_ctime = statf->st_ctime;
key(control, sizeof(control));
return 0;
}
#if DEBUGEXEC
void debugexec(char * sh11, int argc, char ** argv)
{
int i;
fprintf(stderr, "shll=%s\n", sh11 ? sh11 : "<null>");
fprintf(stderr, "argc=%d\n", argc);
if (!argv) {
fprintf(stderr, "argv=<null>\n");
} else {
for (i = 0; i <= argc ; i++)
fprintf(stderr, "argv[%d]=%.60s\n", i, argv[i] ? argv[i] : "<null>");
}
}
#endif /* DEBUGEXEC */
void rmarg(char ** argv, char * arg)
{
for (; argv && *argv && *argv != arg; argv++);
for (; argv && *argv; argv++)
*argv = argv[1];
}
int chkenv(int argc)
{
char buff[512];
unsigned long mask, m;
int l, a, c;
char * string;
extern char ** environ;
mask = (unsigned long)&chkenv;
mask ^= (unsigned long)getpid() * ~mask;
sprintf(buff, "x%lx", mask);
string = getenv(buff);
#if DEBUGEXEC
fprintf(stderr, "getenv(%s)=%s\n", buff, string ? string : "<null>");
#endif
l = strlen(buff);
if (!string) {
/* 1st */
sprintf(&buff[l], "=%lu %d", mask, argc);
putenv(strdup(buff));
return 0;
}
c = sscanf(string, "%lu %d%c", &m, &a, buff);
if (c == 2 && m == mask) {
/* 3rd */
rmarg(environ, &string[-l - 1]);
return 1 + (argc - a);
}
return -1;
}
#if !TRACEABLE
#define _LINUX_SOURCE_COMPAT
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#if !defined(PTRACE_ATTACH) && defined(PT_ATTACH)
# define PTRACE_ATTACH PT_ATTACH
#endif
void untraceable(char * argv0)
{
char proc[80];
int pid, mine;
switch(pid = fork()) {
case 0:
pid = getppid();
/* For problematic SunOS ptrace */
#if defined(__FreeBSD__)
sprintf(proc, "/proc/%d/mem", (int)pid);
#else
sprintf(proc, "/proc/%d/as", (int)pid);
#endif
close(0);
mine = !open(proc, O_RDWR|O_EXCL);
if (!mine && errno != EBUSY)
mine = !ptrace(PTRACE_ATTACH, pid, 0, 0);
if (mine) {
kill(pid, SIGCONT);
} else {
perror(argv0);
kill(pid, SIGKILL);
}
_exit(mine);
case -1:
break;
default:
if (pid == waitpid(pid, 0, 0))
return;
}
perror(argv0);
_exit(1);
}
#endif /* !TRACEABLE */
char * xsh(int argc, char ** argv)
{
char * scrpt;
int ret, i, j;
char ** varg;
char * me = getenv("_");
if (me == NULL) { me = argv[0]; }
stte_0();
key(pswd, pswd_z);
arc4(msg1, msg1_z);
arc4(date, date_z);
if (date[0] && (atoll(date)<time(NULL)))
return msg1;
arc4(shll, shll_z);
arc4(inlo, inlo_z);
arc4(xecc, xecc_z);
arc4(lsto, lsto_z);
arc4(tst1, tst1_z);
key(tst1, tst1_z);
arc4(chk1, chk1_z);
if ((chk1_z != tst1_z) || memcmp(tst1, chk1, tst1_z))
return tst1;
ret = chkenv(argc);
arc4(msg2, msg2_z);
if (ret < 0)
return msg2;
varg = (char **)calloc(argc + 10, sizeof(char *));
if (!varg)
return 0;
if (ret) {
arc4(rlax, rlax_z);
if (!rlax[0] && key_with_file(shll))
return shll;
arc4(opts, opts_z);
arc4(text, text_z);
arc4(tst2, tst2_z);
key(tst2, tst2_z);
arc4(chk2, chk2_z);
if ((chk2_z != tst2_z) || memcmp(tst2, chk2, tst2_z))
return tst2;
/* Prepend hide_z spaces to script text to hide it. */
scrpt = malloc(hide_z + text_z);
if (!scrpt)
return 0;
memset(scrpt, (int) ' ', hide_z);
memcpy(&scrpt[hide_z], text, text_z);
} else { /* Reexecute */
if (*xecc) {
scrpt = malloc(512);
if (!scrpt)
return 0;
sprintf(scrpt, xecc, me);
} else {
scrpt = me;
}
}
j = 0;
varg[j++] = argv[0]; /* My own name at execution */
if (ret && *opts)
varg[j++] = opts; /* Options on 1st line of code */
if (*inlo)
varg[j++] = inlo; /* Option introducing inline code */
varg[j++] = scrpt; /* The script itself */
if (*lsto)
varg[j++] = lsto; /* Option meaning last option */
i = (ret > 1) ? ret : 0; /* Args numbering correction */
while (i < argc)
varg[j++] = argv[i++]; /* Main run-time arguments */
varg[j] = 0; /* NULL terminated array */
#if DEBUGEXEC
debugexec(shll, j, varg);
#endif
execvp(shll, varg);
return shll;
}
int main(int argc, char ** argv)
{
#if DEBUGEXEC
debugexec("main", argc, argv);
#endif
#if !TRACEABLE
untraceable(argv[0]);
#endif
argv[1] = xsh(argc, argv);
fprintf(stderr, "%s%s%s: %s\n", argv[0],
errno ? ": " : "",
errno ? strerror(errno) : "",
argv[1] ? argv[1] : "<null>"
);
return 1;
}

24
Xcode/ConfigValidator/makefile Executable file
View File

@ -0,0 +1,24 @@
XCODE_VERSION_GE_4 := $(shell expr `xcodebuild -version | sed -nE 's/^Xcode ([0-9]+).*/\1/p'` \>= 4)
XCODE_VERSION_GE_10 := $(shell expr `xcodebuild -version | sed -nE 's/^Xcode ([0-9]+).*/\1/p'` \>= 10)
XCODEBUILD_OPTIONS=-project 'ConfigValidator.xcodeproj' CONFIGURATION_BUILD_DIR=$(CURDIR)/build DEPLOYMENT_LOCATION=NO
ifeq "$(XCODE_VERSION_GE_10)" "1"
XCODEBUILD_OPTIONS += ARCHS=x86_64 VALID_ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES
endif
ifeq "$(XCODE_VERSION_GE_4)" "1"
XCODEBUILD_OPTIONS += -scheme 'ConfigValidator'
# BUILD_ACTION=running
else
XCODEBUILD_OPTIONS += -configuration 'Release'
endif
ConfigValidator:
@echo "Building ConfigValidator..."
@echo "ConfiValidator uses latest release of CloverConfigPlistValidator"
@/usr/bin/xcodebuild $(XCODEBUILD_OPTIONS) $(BUILD_ACTION) >/dev/null
@echo [XCODE] $(PROGRAMS)
.PHONY: ConfigValidator clean