def main(): if sys.version_info[0] != 3: print(Colors.ERROR + "[-] Intensio-Obfuscator only support Python 3.x" + Colors.DISABLE) sys.exit(1) if sys.platform != "win32" and sys.platform != "linux": print(Colors.ERROR + "[-] This tool support [windows - Linux] only !" + Colors.DISABLE) sys.exit(1) args = Args() utils = Utils() if len(sys.argv) > 1 and len(sys.argv) <= 13: pass else: print(Colors.ERROR + "[-] Incorrect number of arguments\n" + Colors.DISABLE) args.GetArgHelp() sys.exit(1) if args.GetArgsValue().input: if args.GetArgsValue().output: if re.match(r"^lower$|^medium$|^high$", args.GetArgsValue().mixerlength): if not args.GetArgsValue().paddingscript and not args.GetArgsValue().replacetostr \ and not args.GetArgsValue().replacefilename and not args.GetArgsValue().replacetohex: print( Colors.ERROR + "\n[-] Need at least one argument [-rts] - [-ps] - [-rfn] - [-rth]" + Colors.DISABLE) sys.exit(1) else: print( Colors.ERROR + "[-] -mlen, --mixerlength argument [lower-medium-high] only supported\n" + Colors.DISABLE) sys.exit(1) else: print(Colors.ERROR + "[-] Output [-o, --output] argument missing\n" + Colors.DISABLE) sys.exit(1) else: print(Colors.ERROR + "[-] Input [-i, --input] argument missing\n" + Colors.DISABLE) sys.exit(1) for line in INTENSIO_BANNER.split("\n"): time.sleep(0.05) print(line) # -- Analysis and set up of the work environment -- # print(Colors.SECTION + "\n\n********************* [ Analyze and setup environment ] **********************\n" \ + Colors.DISABLE) analyzeData = Analyze() analyseDataInEnv = analyzeData.InputAvailable( inputArg=args.GetArgsValue().input, verboseArg=args.GetArgsValue().verbose) if analyseDataInEnv == 0: print("\n[+] Analyze input argument '{}' -> ".format(args.GetArgsValue().input) + Colors.SUCCESS + \ "Successful" + Colors.DISABLE) else: print("[-] Analyze input '{}' -> ".format(args.GetArgsValue().input) + Colors.ERROR + "failed\n" + Colors.DISABLE) sys.exit(1) analyseDataOutEnv = analyzeData.OutputAvailable( inputArg=args.GetArgsValue().input, outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if analyseDataOutEnv == 0: print("\n[+] Analyze and setup output argument environment '{}' -> " \ .format(args.GetArgsValue().output) + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print( "[-] Analyze output '{}' -> ".format(args.GetArgsValue().output) + Colors.ERROR + "failed\n" + Colors.DISABLE) sys.exit(1) # -- Obfuscation process -- # print( Colors.SECTION + "\n\n********************** [ Obfuscation delete comments ] ***********************\n" + Colors.DISABLE) deleteData = Delete() deleteCommentsData = deleteData.Comments( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if deleteCommentsData == 0: print("[+] Obfuscation delete comments -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation delete comments -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") print( Colors.SECTION + "\n\n******************** [ Obfuscation delete line space(s) ] ********************\n" + Colors.DISABLE) if deleteData: pass else: deleteData = Delete() deleteLinesSpacesData = deleteData.LinesSpaces( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if deleteLinesSpacesData == 0: print("[+] Obfuscation delete lines spaces -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation delete lines spaces -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- If empty class (avert to generate an error) -- # print( Colors.SECTION + "\n\n******************* [ Correction padding empty class(es) ] *******************\n" + Colors.DISABLE) paddingData = Padding() paddingDataEmptyClass = paddingData.EmptyClasses( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if paddingDataEmptyClass == 0: pass else: print("\n[-] Padding empty class -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- If empty functions (avert to generate an error) -- # print( Colors.SECTION + "\n\n****************** [ Correction padding empty function(s) ] ******************\n" + Colors.DISABLE) if paddingData: pass else: paddingData = Padding() paddingDataEmptyFunc = paddingData.EmptyFunctions( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if paddingDataEmptyFunc == 0: pass else: print("\n[-] Padding empty function -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") print( Colors.SECTION + "\n\n************ [ Obfuscation replace string(s) to string(s) mixed ] ************\n" + Colors.DISABLE) if args.GetArgsValue().replacetostr: replaceData = Replace() replaceDataStrStr = replaceData.StringToString( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if replaceDataStrStr == 0: print("[+] Obfuscation replace string to string mixed -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation replace string to string mixed -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace string to string ] mixed no asked !") print( Colors.SECTION + "\n\n****************** [ Obfuscation adding padding script(s) ] ******************\n" + Colors.DISABLE) if args.GetArgsValue().paddingscript: if paddingData: pass else: paddingData = Padding() paddingDataGarbage = paddingData.AddRandomScripts( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if paddingDataGarbage == 0: print("[+] Obfuscation padding script -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation padding script -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ padding script ] no asked !") print( Colors.SECTION + "\n\n******************** [ Obfuscation replace file(s) name ] ********************\n" + Colors.DISABLE) if args.GetArgsValue().replacefilename: if args.GetArgsValue().replacetostr: pass else: replaceData = Replace() replaceDataStrFname = replaceData.FilesName( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if replaceDataStrFname == 0: print("\n[+] Obfuscation replace file name -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation replace file name -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace file name ] feature no asked !") print( Colors.SECTION + "\n\n****************** [ Obfuscation replace string(s) to hex ] ******************\n" + Colors.DISABLE) if args.GetArgsValue().replacetohex: if args.GetArgsValue().replacetostr or args.GetArgsValue( ).replacefilename: pass else: replaceData = Replace() replaceDataStrHex = replaceData.StringsToHex( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if replaceDataStrHex == 0: print("\n[+] Obfuscation replace string to hex -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation replace string to hex -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace string to hex ] feature no asked !") # -- Delete line spaces of padding scripts -- # if args.GetArgsValue().paddingscript: print( Colors.SECTION + "\n\n******************** [ Obfuscation delete line space(s) ] ********************\n" + Colors.DISABLE) if deleteData: pass else: deleteData = Delete() deleteLinesSpacesData = deleteData.LinesSpaces( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if deleteLinesSpacesData == 0: print("[+] Obfuscation delete lines spaces of padding scripts-> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print( "\n[-] Obfuscation delete lines spaces of padding scripts -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- Delete if python pyc file in output directory -- # print( Colors.SECTION + "\n\n********************* [ Correction delete .pyc file(s) ] *********************\n" + Colors.DISABLE) if deleteData: pass else: deleteData = Delete() deletePycData = deleteData.TrashFiles( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose, ) if deletePycData == 0: pass else: print("\n[-] Delete .pyc file from {} directory -> ".format(args.GetArgsValue().output) + Colors.ERROR + \ "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" )
def main(): if sys.version_info[0] != 3: print(ERROR_COLOUR + "[-] Intensio-Obfuscator only support Python 3.x") sys.exit(0) if sys.platform != "win32" and sys.platform != "linux": print(ERROR_COLOUR + "[-] This tool support [windows - Linux] only !") sys.exit(0) args = Args() utils = Utils() if len(sys.argv) > 1 and len(sys.argv) <= 13: pass else: print(ERROR_COLOUR + "[-] Incorrect number of arguments\n") args.GetArgHelp() sys.exit(ERROR_BAD_ARGUMENTS) if args.GetArgsValue().input: if args.GetArgsValue().output: if args.GetArgsValue().mixerlevel: if re.match(r"^lower$|^medium$|^high$", args.GetArgsValue().mixerlevel): if not args.GetArgsValue().paddingscript and not args.GetArgsValue().replacetostr \ and not args.GetArgsValue().replacefilename and not args.GetArgsValue().replacetohex: print( ERROR_COLOUR + "\n[-] Need at least one argument [-rts] - [-ps] - [-rfn] - [-rth]" ) sys.exit(ERROR_BAD_ARGUMENTS) else: print( ERROR_COLOUR + "[-] Incorrect level of mixerlevel, [lower - medium - high] only supported\n" ) sys.exit(ERROR_INVALID_PARAMETER) else: print(ERROR_COLOUR + "[-] Mixerlevel [-m, --mixerlevel] argument missing\n") sys.exit(ERROR_BAD_ARGUMENTS) else: print(ERROR_COLOUR + "[-] Output [-o, --output] argument missing\n") sys.exit(ERROR_BAD_ARGUMENTS) else: print(ERROR_COLOUR + "[-] Input [-i, --input] argument missing\n") sys.exit(ERROR_BAD_ARGUMENTS) for line in INTENSIO_BANNER.split("\n"): time.sleep(0.05) print(BANNER_COLOUR + line) # -- Analysis and set up of the work environment -- # print( SECTION_COLOUR + "\n\n*********************** [ Analyze and setup environment ] ************************\n" ) analyzeData = Analyze() analyseDataInEnv = analyzeData.InputAvailable( inputArg=args.GetArgsValue().input, verboseArg=args.GetArgsValue().verbose) if analyseDataInEnv == EXIT_SUCCESS: print("\n[+] Analyze input argument '{0}' -> ".format( args.GetArgsValue().input) + SUCESS_COLOUR + "Successful") else: print("[-] Analyze input '{0}' -> ".format(args.GetArgsValue().input) + FAILED_COLOUR + "failed\n") sys.exit(ERROR_INVALID_FUNCTION) analyseDataOutEnv = analyzeData.OutputAvailable( inputArg=args.GetArgsValue().input, outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if analyseDataOutEnv == EXIT_SUCCESS: print("\n[+] Analyze and setup output argument environment '{0}' -> " \ .format(args.GetArgsValue().output) + SUCESS_COLOUR + "Successful") else: print( "[-] Analyze output '{0}' -> ".format(args.GetArgsValue().output) + FAILED_COLOUR + "failed\n") sys.exit(ERROR_INVALID_FUNCTION) # -- Obfuscation process -- # print( SECTION_COLOUR + "\n\n************************ [ Obfuscation remove comment ] *************************\n" ) removeData = Remove() removeCommentsData = removeData.Comments( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if removeCommentsData == EXIT_SUCCESS: print("[+] Obfuscation remove comments -> " + SUCESS_COLOUR + "Successful") else: print("\n[-] Obfuscation remove comments -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") print( SECTION_COLOUR + "\n\n*********************** [ Obfuscation remove line space ] ***********************\n" ) if removeData: pass else: removeData = Remove() removeLinesSpacesData = removeData.LinesSpaces( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if removeLinesSpacesData == EXIT_SUCCESS: print("[+] Obfuscation remove lines spaces -> " + SUCESS_COLOUR + "Successful") else: print("\n[-] Obfuscation remove lines spaces -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- If empty class (avert to generate an error) -- # print( SECTION_COLOUR + "\n\n*********************** [ Correction padding empty class ] **********************\n" ) paddingData = Padding() paddingDataEmptyClass = paddingData.EmptyClasses( outputArg=args.GetArgsValue().output, mixerLevelArg=args.GetArgsValue().mixerlevel, verboseArg=args.GetArgsValue().verbose) if paddingDataEmptyClass == EXIT_SUCCESS: pass else: print("\n[-] Padding empty class -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- If empty functions (avert to generate an error) -- # print( SECTION_COLOUR + "\n\n********************** [ Correction padding empty function ] ********************\n" ) if paddingData: pass else: paddingData = Padding() paddingDataEmptyFunc = paddingData.EmptyFunctions( outputArg=args.GetArgsValue().output, mixerLevelArg=args.GetArgsValue().mixerlevel, verboseArg=args.GetArgsValue().verbose) if paddingDataEmptyFunc == EXIT_SUCCESS: pass else: print("\n[-] Padding empty function -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") print( SECTION_COLOUR + "\n\n**************** [ Obfuscation replace string to string mixed ] *****************\n" ) if args.GetArgsValue().replacetostr: replaceData = Replace() replaceDataStrStr = replaceData.StringToString( outputArg=args.GetArgsValue().output, mixerLevelArg=args.GetArgsValue().mixerlevel, verboseArg=args.GetArgsValue().verbose) if replaceDataStrStr == EXIT_SUCCESS: print("[+] Obfuscation replace string to string mixed -> " + SUCESS_COLOUR + "Successful") else: print("\n[-] Obfuscation replace string to string mixed -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace string to string ] mixed no asked !") print( SECTION_COLOUR + "\n\n********************* [ Obfuscation adding padding script ] *********************\n" ) if args.GetArgsValue().paddingscript: if paddingData: pass else: paddingData = Padding() paddingDataGarbage = paddingData.AddRandomScripts( outputArg=args.GetArgsValue().output, mixerLevelArg=args.GetArgsValue().mixerlevel, verboseArg=args.GetArgsValue().verbose) if paddingDataGarbage == EXIT_SUCCESS: print("[+] Obfuscation padding script -> " + SUCESS_COLOUR + "Successful") else: print("\n[-] Obfuscation padding script -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ padding script ] no asked !") print( SECTION_COLOUR + "\n\n********************** [ Obfuscation replace file name ] ************************\n" ) if args.GetArgsValue().replacefilename: if args.GetArgsValue().replacetostr: pass else: replaceData = Replace() replaceDataStrFname = replaceData.FilesName( outputArg=args.GetArgsValue().output, mixerLevelArg=args.GetArgsValue().mixerlevel, verboseArg=args.GetArgsValue().verbose) if replaceDataStrFname == EXIT_SUCCESS: print("\n[+] Obfuscation replace file name -> " + SUCESS_COLOUR + "Successful") else: print("\n[-] Obfuscation replace file name -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace file name ] feature no asked !") print( SECTION_COLOUR + "\n\n******************** [ Obfuscation replace string to hex ] **********************\n" ) if args.GetArgsValue().replacetohex: if args.GetArgsValue().replacetostr or args.GetArgsValue( ).replacefilename: pass else: replaceData = Replace() replaceDataStrHex = replaceData.StringsToHex( outputArg=args.GetArgsValue().output, mixerLevelArg=args.GetArgsValue().mixerlevel, verboseArg=args.GetArgsValue().verbose) if replaceDataStrHex == EXIT_SUCCESS: print("\n[+] Obfuscation replace string to hex -> " + SUCESS_COLOUR + "Successful") else: print("\n[-] Obfuscation replace string to hex -> " + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace string to hex ] feature no asked !") # -- Remove if python pyc file in output directory -- # print( SECTION_COLOUR + "\n\n*********************** [ Correction remove .pyc file ] *************************\n" ) if removeData: pass else: removeData = Remove() removePycData = removeData.TrashFiles( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose, ) if removePycData == EXIT_SUCCESS: pass else: print("\n[-] Remove .pyc file in {0} directory -> ".format( args.GetArgsValue().output) + FAILED_COLOUR + "Failed") if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" )
def main(): if sys.version_info[0] != 3: print(Colors.ERROR + "[-] Intensio-Obfuscator only support Python 3.x" + Colors.DISABLE) sys.exit(0) if sys.platform != "win32" and sys.platform != "linux": print(Colors.ERROR + "[-] This tool support [windows - Linux] only !" + Colors.DISABLE) sys.exit(0) args = Args() utils = Utils() if len(sys.argv) > 1 and len(sys.argv) <= 15: pass else: print(Colors.ERROR + "[-] Incorrect number of arguments" + Colors.DISABLE + "\n") args.GetArgHelp() sys.exit(0) if args.GetArgsValue().input: if args.GetArgsValue().output: if re.match(Reg.detectMlenArg, str(args.GetArgsValue().mixerlength)): if re.match(Reg.detectIndentArg, str(args.GetArgsValue().indent)): pass else: print("\n" + Colors.ERROR + "[-] -ind, --indent argument [2|4|8] missing" + Colors.DISABLE + "\n") sys.exit(0) else: print( "\n" + Colors.ERROR + "[-] -mlen, --mixerlength argument [lower|medium|high] missing" + Colors.DISABLE + "\n") sys.exit(0) else: print("\n" + Colors.ERROR + "[-] Output [-o, --output] argument missing" + Colors.DISABLE + "\n") sys.exit(0) else: print("\n" + Colors.ERROR + "[-] Input [-i, --input] argument missing" + Colors.DISABLE + "\n") sys.exit(0) for line in INTENSIO_BANNER.split("\n"): time.sleep(0.05) print(line) print("\n\n" + Colors.SECTION + "********************************* [ START ] **********************************" \ + Colors.DISABLE + "\n") # -- Analysis and set up of the work environment -- # print("\n\n" + Colors.SECTION + "********************* [ Analyze and setup environment ] **********************" \ + Colors.DISABLE + "\n") analyzeData = Analyze() analyseDataInEnv = analyzeData.InputAvailable( inputArg=args.GetArgsValue().input, verboseArg=args.GetArgsValue().verbose) if analyseDataInEnv == 1: print("\n[+] Analyze input argument '{}' -> ".format(args.GetArgsValue().input) + Colors.SUCCESS + \ "Successful" + Colors.DISABLE) else: print("[-] Analyze input '{}' -> ".format(args.GetArgsValue().input) + Colors.ERROR + "failed" + Colors.DISABLE + "\n") sys.exit(0) analyseDataOutEnv = analyzeData.OutputAvailable( inputArg=args.GetArgsValue().input, outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if analyseDataOutEnv == 1: print("\n[+] Analyze and setup output argument environment '{}' -> " \ .format(args.GetArgsValue().output) + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print( "[-] Analyze output '{}' -> ".format(args.GetArgsValue().output) + Colors.ERROR + "failed" + Colors.DISABLE + "\n") sys.exit(0) # -- Obfuscation process -- # startObfuscationTime = time.time() print("\n\n" + Colors.SECTION + "********************** [ Obfuscation delete comments ] ***********************" \ + Colors.DISABLE + "\n") deleteData = Delete() deleteCommentsData = deleteData.Comments( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if deleteCommentsData == 1: print("[+] Obfuscation delete comments -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation delete comments -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") print("\n\n" + Colors.SECTION + "******************** [ Obfuscation delete line space(s) ] ********************" \ + Colors.DISABLE + "\n") if deleteData: pass else: deleteData = Delete() deleteLinesSpacesData = deleteData.LinesSpaces( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if deleteLinesSpacesData == 1: print("[+] Obfuscation delete lines spaces -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation delete lines spaces -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- If empty class (avert to generate an error) -- # print("\n\n" + Colors.SECTION + "******************* [ Correction padding empty class(es) ] *******************" \ + Colors.DISABLE + "\n") paddingData = Padding() paddingDataEmptyClass = paddingData.EmptyClasses( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, basicIndentArg=args.GetArgsValue().indent, verboseArg=args.GetArgsValue().verbose) if paddingDataEmptyClass == 1: pass else: print("\n[-] Padding empty class -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- If empty functions (avert to generate an error) -- # print("\n\n" + Colors.SECTION + "****************** [ Correction padding empty function(s) ] ******************" \ + Colors.DISABLE + "\n") if paddingData: pass else: paddingData = Padding() paddingDataEmptyFunc = paddingData.EmptyFunctions( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, basicIndentArg=args.GetArgsValue().indent, verboseArg=args.GetArgsValue().verbose) if paddingDataEmptyFunc == 1: pass else: print("\n[-] Padding empty function -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") print("\n\n" + Colors.SECTION + "************ [ Obfuscation replace string(s) to string(s) mixed ] ************" \ + Colors.DISABLE + "\n") if args.GetArgsValue().replacetostr: replaceData = Replace() replaceDataStrStr = replaceData.StringToString( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if replaceDataStrStr == 1: print("[+] Obfuscation replace string to string mixed -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation replace string to string mixed -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace string to string ] mixed no asked !") print("\n\n" + Colors.SECTION + "****************** [ Obfuscation adding padding script(s) ] ******************" \ + Colors.DISABLE + "\n") if args.GetArgsValue().paddingscript: if paddingData: pass else: paddingData = Padding() paddingDataGarbage = paddingData.AddRandomScripts( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, basicIndentArg=args.GetArgsValue().indent, verboseArg=args.GetArgsValue().verbose) if paddingDataGarbage == 1: print("[+] Obfuscation padding script -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation padding script -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ padding script ] no asked !") print("\n\n" + Colors.SECTION + "******************** [ Obfuscation replace file(s) name ] ********************" \ + Colors.DISABLE + "\n") if args.GetArgsValue().replacefilename: if args.GetArgsValue().replacetostr: pass else: replaceData = Replace() replaceDataStrFname = replaceData.FilesName( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if replaceDataStrFname == 1: print("\n[+] Obfuscation replace file name -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print("\n[-] Obfuscation replace file name -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace file name ] feature no asked !") print("\n\n" + Colors.SECTION + "****************** [ Obfuscation replace string(s) to hex ] ******************" \ + Colors.DISABLE + "\n") if args.GetArgsValue().replacetohex: if args.GetArgsValue().replacetostr or args.GetArgsValue( ).replacefilename: pass else: replaceData = Replace() replaceDataStrHex = replaceData.StringsToHex( outputArg=args.GetArgsValue().output, mixerLengthArg=args.GetArgsValue().mixerlength, verboseArg=args.GetArgsValue().verbose) if replaceDataStrHex == 1: print("\n[+] Obfuscation replace string to hex -> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) print("\n[!] care, only works for python 2 files") else: print("\n[-] Obfuscation replace string to hex -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) else: print("[!] Obfuscation [ replace string to hex ] feature no asked !") # -- Delete line spaces of padding scripts -- # if args.GetArgsValue().paddingscript: print("\n\n" + Colors.SECTION + "******************** [ Obfuscation delete line space(s) ] ********************" \ + Colors.DISABLE + "\n") if deleteData: pass else: deleteData = Delete() deleteLinesSpacesData = deleteData.LinesSpaces( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose) if deleteLinesSpacesData == 1: print("[+] Obfuscation delete lines spaces of padding scripts-> " + Colors.SUCCESS + "Successful" + Colors.DISABLE) else: print( "\n[-] Obfuscation delete lines spaces of padding scripts -> " + Colors.ERROR + "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print("\n[!] Retry with [-v, --verbose] parameter") # -- Delete if python pyc file in output directory -- # print("\n\n" + Colors.SECTION + "********************* [ Correction delete .pyc file(s) ] *********************" \ + Colors.DISABLE + "\n") if deleteData: pass else: deleteData = Delete() deletePycData = deleteData.TrashFiles( outputArg=args.GetArgsValue().output, verboseArg=args.GetArgsValue().verbose, ) if deletePycData == 1: pass else: print("\n[-] Delete .pyc file from {} directory -> ".format(args.GetArgsValue().output) + Colors.ERROR + \ "Failed" + Colors.DISABLE) if not args.GetArgsValue().verbose: print( "\n[!] Retry with [-v, --verbose] parameter for more informations" ) print("\n\n" + Colors.SECTION + "********************************** [ END ] ************************************" \ + Colors.DISABLE + "\n") # -- Result of execution time -- # endObfuscationTime = time.time() executionTime = endObfuscationTime - startObfuscationTime executionTime = str(executionTime) executionTime = executionTime.split(".") print("[*] Obfuscation Time : {} second(s)".format(executionTime[0]))