def hide_variable_names(obj): identifiers = list(ex.extract_defined_variables_from_obj(obj)) # Extraer solo las que se definen en el script # replaces = Utils.mod_names_hash(identifiers) boundary = "\n"+Utils.generate_random_string(20,30)+"\n" obj = boundary.join(obj) for i in xrange(len(identifiers)): if identifiers[i]: obj = sub(r"\$"+identifiers[i][1:]+r"\b","$"+replaces[i]+" ",obj) return obj.split(boundary)
def hide_function_parameters(obj): identifiers = list(ex.extract_parameters_from_obj(obj)) replaces = Utils.mod_names_hash(identifiers) boundary = "\n"+Utils.generate_random_string(20,30)+"\n" obj = boundary.join(obj) for i in xrange(len(identifiers)): try: if identifiers[i]: obj = sub(r"\$"+identifiers[i][1:]+r"\b","$"+replaces[i]+" ",obj) except: continue return obj.split(boundary)
def hide_variable_names(obj): identifiers = list(ex.extract_defined_variables_from_obj( obj)) # Extraer solo las que se definen en el script # replaces = Utils.mod_names_hash(identifiers) boundary = "\n" + Utils.generate_random_string(20, 30) + "\n" obj = boundary.join(obj) for i in xrange(len(identifiers)): if identifiers[i]: obj = sub(r"\$" + identifiers[i][1:] + r"\b", "$" + replaces[i] + " ", obj) return obj.split(boundary)
def hide_function_parameters(obj): identifiers = list(ex.extract_parameters_from_obj(obj)) replaces = Utils.mod_names_hash(identifiers) boundary = "\n" + Utils.generate_random_string(20, 30) + "\n" obj = boundary.join(obj) for i in xrange(len(identifiers)): try: if identifiers[i]: obj = sub(r"\$" + identifiers[i][1:] + r"\b", "$" + replaces[i] + " ", obj) except: continue return obj.split(boundary)
def add_random_directives(obj, n_directives_min=5, n_directives_max=20, n_includes_min=10, n_includes_max=20, func_name=Utils.generate_random_string(ext="")): pragma, include, start, tray, once = randint(0, 1), randint(0, 1), randint( 0, 1), randint(0, 1), randint(0, 1) if start: obj = add_autoit_on_start_directive(obj, func_name) if tray: obj = add_no_tray_icon_directive(obj) if include: obj = add_include_directives(obj, n_includes_min, n_includes_max) if once: obj = add_include_once_directive(obj) if pragma: obj = add_pragma_directives(obj, n_directives_min, n_directives_max) return obj
def on_autoit_start_register(func_name=Utils.generate_random_string(ext="")): return "#OnAutoItStartRegister " + '"' + func_name + '"\n'
#!/usr/bin/env python # -*- coding: utf-8 -*- __import__("sys").path.append('./System') from string import ascii_letters, digits, punctuation, whitespace, ascii_uppercase, ascii_lowercase from Kernel import Utils from random import shuffle import base64 ####################### DIRECTIVES ####################### PRAGMA_DIRECTIVES = ["Out","ExecLevel","UPX","AutoItExecuteAllowed","Console","Compression",\ "Compatibility","x64","inputboxres","Comments","CompanyName","FileDescription",\ "FileVersion","InternalName","LegalCopyright","LegalTrademarks","OriginalFilename",\ "ProductName","ProductVersion"] PRAGMA_VALID_VALUES = [Utils.generate_random_string(ext="exe"),\ ["none","asInvoker","highestAvailable"],["true","false"],\ ["true","false"],["true","false"],['1','3','5','7','9'],["vista","win7","win8","win81","win10"],\ ["true","false"],["true","false"],Utils.generate_random_string(15,30,""),\ Utils.generate_random_string(10,15,""),Utils.generate_random_string(15,50,""),\ Utils.generate_random_string(5,10,""),Utils.generate_random_string(20,30,""),\ Utils.generate_random_string(50,75,""),Utils.generate_random_string(50,75,""),\ Utils.generate_random_string(15,30,""),Utils.generate_random_string(10,20,""),\ Utils.generate_random_string(10,20,"")] ########################################################## ####################### AUTOIT DEFINITIONS ####################### INCLUDES = [ 'AVIConstants.au3', 'Array.au3', 'BorderConstants.au3',
#!/usr/bin/env python # -*- coding: utf-8 -*- __import__("sys").path.append('./System') from string import ascii_letters,digits,punctuation,whitespace,ascii_uppercase,ascii_lowercase from Kernel import Utils from random import shuffle import base64 ####################### DIRECTIVES ####################### PRAGMA_DIRECTIVES = ["Out","ExecLevel","UPX","AutoItExecuteAllowed","Console","Compression",\ "Compatibility","x64","inputboxres","Comments","CompanyName","FileDescription",\ "FileVersion","InternalName","LegalCopyright","LegalTrademarks","OriginalFilename",\ "ProductName","ProductVersion"] PRAGMA_VALID_VALUES = [Utils.generate_random_string(ext="exe"),\ ["none","asInvoker","highestAvailable"],["true","false"],\ ["true","false"],["true","false"],['1','3','5','7','9'],["vista","win7","win8","win81","win10"],\ ["true","false"],["true","false"],Utils.generate_random_string(15,30,""),\ Utils.generate_random_string(10,15,""),Utils.generate_random_string(15,50,""),\ Utils.generate_random_string(5,10,""),Utils.generate_random_string(20,30,""),\ Utils.generate_random_string(50,75,""),Utils.generate_random_string(50,75,""),\ Utils.generate_random_string(15,30,""),Utils.generate_random_string(10,20,""),\ Utils.generate_random_string(10,20,"")] ########################################################## ####################### AUTOIT DEFINITIONS ####################### INCLUDES = ['AVIConstants.au3', 'Array.au3', 'BorderConstants.au3', 'ButtonConstants.au3', 'Clipboard.au3', 'Color.au3', 'ColorConstants.au3', 'ComboConstants.au3', 'Constants.au3', 'Crypt.au3', 'Date.au3', 'DateTimeConstants.au3', 'Debug.au3', 'DirConstants.au3', 'EditConstants.au3', 'EventLog.au3', 'Excel.au3', 'FTPEx.au3', 'File.au3', 'FileConstants.au3', 'FontConstants.au3', 'FrameConstants.au3', 'GDIPlus.au3', 'GDIPlusConstants.au3', 'GUIConstants.au3', 'GUIConstantsEx.au3', 'GuiAVI.au3', 'GuiButton.au3', 'GuiComboBox.au3', 'GuiComboBoxEx.au3', 'GuiDateTimePicker.au3', 'GuiEdit.au3', 'GuiHeader.au3', 'GuiIPAddress.au3', 'GuiImageList.au3', 'GuiListBox.au3', 'GuiListView.au3', 'GuiMenu.au3', 'GuiMonthCal.au3', 'GuiReBar.au3', 'GuiRichEdit.au3', 'GuiScrollBars.au3', 'GuiSlider.au3', 'GuiStatusBar.au3', 'GuiTab.au3', 'GuiToolTip.au3', 'GuiToolbar.au3', 'GuiTreeView.au3', 'HeaderConstants.au3', 'IE.au3', 'IPAddressConstants.au3', 'ImageListConstants.au3', 'Inet.au3', 'ListBoxConstants.au3', 'ListViewConstants.au3', 'Math.au3', 'Memory.au3', 'MemoryConstants.au3', 'MenuConstants.au3', 'Misc.au3', 'NamedPipes.au3', 'NetShare.au3', 'Process.au3', 'ProcessConstants.au3', 'ProgressConstants.au3', 'RebarConstants.au3', 'RichEditConstants.au3', 'SQLite.au3', 'SQLite.dll.au3', 'ScreenCapture.au3', 'ScrollBarConstants.au3', 'Security.au3', 'SecurityConstants.au3', 'SendMessage.au3', 'SliderConstants.au3', 'Sound.au3', 'StaticConstants.au3', 'StatusBarConstants.au3', 'String.au3', 'StructureConstants.au3', 'TabConstants.au3', 'Timers.au3', 'ToolTipConstants.au3', 'ToolbarConstants.au3', 'TreeViewConstants.au3', 'UDFGlobalID.au3', 'UpDownConstants.au3', 'Visa.au3', 'WinAPI.au3', 'WinAPIError.au3', 'WinNet.au3', 'WindowsConstants.au3', 'Word.au3'] shuffle(INCLUDES)
def add_random_directives(obj,n_directives_min=5,n_directives_max=20,n_includes_min=10,n_includes_max=20,func_name=Utils.generate_random_string(ext="")): pragma,include,start,tray,once = randint(0,1),randint(0,1),randint(0,1),randint(0,1),randint(0,1) if start: obj = add_autoit_on_start_directive(obj,func_name) if tray: obj = add_no_tray_icon_directive(obj) if include: obj = add_include_directives(obj,n_includes_min,n_includes_max) if once: obj = add_include_once_directive(obj) if pragma: obj = add_pragma_directives(obj,n_directives_min,n_directives_max) return obj
def add_autoit_on_start_directive(obj,func_name=Utils.generate_random_string(ext="")): obj.insert(0,d.on_autoit_start_register(func_name)) return obj