;============================================================================================ ; Title ..........: CodeCrypter ; AutoIt Version..: 3.3.14 ; Description ....: encrypts an Autoit script using any user-defined key or external password ; Author..........: A.R.T. Jonkers (RTFC) ; Release.........: 1.9 ; Latest revision.: 24 Apr 2016 ; License.........: free for personal use; free distribution allowed provided ; the author is credited; all other rights reserved. ; Tested on.......: W7Pro/64, W10Pro/64 ; Dependencies....: CodeScanner, readCSdatadump; see http://www.autoitscript.com/forum/topic/153368-code-scanner/ ; Forum Link.....: http://www.autoitscript.com/forum/topic/155538-codecrypter-encrypt-your-script/ ; Related to......: MCF.au3 + MCFinclude.au3 (MCF package), see www.autoitscript.com/forum/topic/155537-mcf-metacode-file-udf/) ; CodeScanner, see w5ww.autoitscript.com/forum/topic/153368-code-scanner/ ; Acknowledgements: ; * Listview with Checkboxes, by Zedna, http://www.autoitscript.com/wiki/Snippets_%28_Checkboxes_%29 ;============================================================================================ ; Summary (Wotsit?) ; ; This GUI drives the MCF library to encrypt (not just obfuscate) an AutoIt ; script, using MetaCode data generated by CodeScanner (also by RTFC) ; ; CodeCrypter (or rather, MCF.au3) also enables you to: ; - produce a single portable script without includes or redundant parts ; - translate the language of user-interface and other strings ; - translate/rename any/all variable(s) or UDF(s) (requires some manual labour on your part) ; - obfuscate variables, UDFs or both (automated, controlled by this GUI) ; ; No guarantees, no warranties, no liability for damages, no refunds. ; Use at your own risk. ; ;============================================================================================ ; Application (WhyBother?) ; ; The encryption key is NOT stored inside your script, making static decompilation ; without that key virtually impossible. ; ; Steps per script: ; 1. #include MCFinclude.au3" in .au3 ; 2. Run CodeScanner on .au3 with setting WriteMetaCode=True ; 3. Run CodeCrypter on .au3 ; ; The original source code is not changed; new files are created in a subdirectory. ; ; WARNING: do NOT include "MCF.au3" in your script. ; ; It works like this: ; 1. CodeScanner splits your target script into: ; A) Structural Parts (files MCF#.txt; # = number) ; these contain MetaCode tags ; B) Content Arrays (saved as text files) ; these describe what the MetaCode tags refer to (# = line = array index) ; 2. CodeCrypter then: ; A) creates a single structure out of the parts (called MCF0.txt ("MCFzero")) ; B) makes changes to that structure, if desired ; C) replaces some/all content in some/all arrays, if desired ; D) rebuilds the script using the (new) structure and (new) content arrays ; ; Note: CodeCrypter is just a front-end for the MCF UDF library. ; ; * Command line parameters for automatic processing: ; /b : create single (B)uild ; /c : (C)reate single build (see /b) ; /d : (D)efine (D)ecryption key (password or macro's expected return) ; /e : (E)ncrypt (both strings and phrases); modified by /s parameter (NB requires #include "MCFinclude.au3" in source file!) ; /f : input (F)ile ; /i : (I)nput file (see /f) ; /k : (K)ey type (requires /e); index to $CCkey in MCFinclude.au3 ; /l ; use (L)ogfile ; /n : (N)o source pruning (removing orphans or unused UDFs) ; /o : (O)bfuscate (both variables and UDF names) ; /p : define (P)assword (decryption key; password or macro's expected return) ; /q : (Q)uiet mode: no screen messages (errors and progress updates) ; /s : define (S)ubset, followed by either proportion (0-1, random), line modulo (>1, cycled), % (1-100); this part will be encrypted ; ; ; Note: if a parameter requires user input, do NOT add any space(s) or other characters between the two. ; /d, /k expect integer (index to $CCkey in MCFinclude.au3, so ensure it exists!) ; /f, /i expects the target file name (with optional path) ; /p expects a string or number, depending on value defined by /k; ; NB if /k is defined but /p is not, decryption key will use whatever the current environment returns ; /s expects some number N (and requires /e): ; if 0 < N < 1: interpreted as proportion to encrypt (randomly allocated) ; if N > 1 : interpreted as modulo cycle (e.g., N=5: ecrypt every fifth encryptable occurrence in user's script) ; if N% : interpret as percentage (handle as proportion, see above) ; ;============================================================================================ ; Remarks (Just run it!) ; ; * If CodeCrypter fails on startup with the error _AES_Startup() function not found, ; it is likely that AES.au3 was not found in the local directory, so please ; move it there, or edit the path in the #include directive in MCFinclude.au3 ; ; * decide for yourself how to define the script's (global) encryption key(s), by ; editing _MCFCC_Init() in MCFinclude.au3, before running CodeCrypter ; Some examples of key definitions: ; - user password query at startup ; - system spec (e.g., harddrive serial number) ; - environment variable (to be set by your installer (do NOT use EnvSet()) ; - (web or local) server response to query ; - something clever you develop yourself ; - a combination of the above (just concatenate the parts, or set $MCF_ENCRYPT_SHUFFLEKEY=True) ; ; * Confused by the many settings? Use the one-click Presets! ; ; * UNSUPPORTED AUTOIT CONSTRUCTS: ; - Assign, Eval, IsDeclared, Execute (self-modifying/-evaluating code) {depends, may work} ; - object-type variables {depends, may work} ; - Local/Dim $var1=_call(),$var2=_call(),... (multiple var declaration+definition by call on a single line) ; - Indirection for variables that switch between use as single variant and array[] ; ; * UNSUPPORTED ENCRYPTION: ; - UDF parameter default strings (Func _MyFunc($stringvar="defaultstring")) ; - multi-processing UDFs such as Picasso's CoProc that relaunch a script subsection (these would lack MCFinclude.au3) ; - lines containing @error/@extended (Execute() lose their state prior to evaluation); such lines remain unencrypted ; - FileInstall (AutoIt limitation) ; ; * By default, encryption relies on Ward's AES.au3, which has to be placed in the same ; directory as MCFinclude.au3 and your target script. ; IMPORTANT: if you download(ed) AES.au3 yourself, then it may require one line ; to be patched to work with current AutoIt versions; in that case, ; see the detailed instructions in the MCFinclude.au3 Remarks section. ; ; * _CreateSingleBuild() builds a single structure file (MCF0.txt) from your target ; file plus all its #includes, regardless of whether CodeScanner deemed some ; includes redundant. ; MCF booleans determine how much material deemed redundant by CodeCrypter ; (not CodeScanner) is to be omitted from the new structure. ; ; * use _BackTranslate() after running CodeScanner and _CreateSingleBuild() ; to test whether the MetaCode (forward) translation step is valid. ; Skip this check at your peril. ; ; * _CreateNewScript() should be used ONLY if you wish to replace MetaCode tags ; entirely by yourself, based on content YOU change in the *New[] arrays ; (pre-filled with *Used[] arrays by _CreateSingleBuild()). ; If you make no changes, the output is as when calling _BackTranslate(). ; ; * Both Translation and Obfuscation fill selected array(s) *Transl[], ; so these content replacements are mutually exclusive per selected array. ; Note that variables and UDFs can be altered either way, but strings ; can only be translated (obfuscated var/UDF names will still be updated ; inside strings if you leave their MCtags intact). ; NB you'll have to update compiler directives containing variable names ; yourself (e.g., #forceref) ; ; * Encryption requires Phrasing, but Phrasing can also be used on its own, ; if you've found another use for it. ; ; * Encryption can replace all (or some) strings and phrases. Phrases are: ; - conditionals (code following If/While/Until) ; - calls (native AutoIt and UDFs) ; - macros (all except @error/@extended; lines containing these remain unencrypted) ; CodeCrypter always encrypts all three; if you wish to exclude specific types, ; see the remarks in MCF.au3 for the appropriate settings with which to call ; the MCF UDFs yourself. ; ; * if encryption fails, first try encrypting either strings or phrases alone. ; Sometimes a single line or UDF is causing the problem. Just replace it with ; the original line/UDF (remember to update obfuscated names in there if necessary). ; See also the MCFencoding.log written out to CodeScanner's datadump subdirectory. ; ; * In games and media players, timing may be an issue. For example, trancexx's ; elegant XMplayer will fail if too much extra decryption work is added. ; In this case, you could encrypt only a small proportion of the code (<10%). ; ; * encryption implies extra processing at runtime, so expect slower execution; ; you can adjust the proportion of encrypted code from 0-100% of calls and ; conditionals, or encrypt only every N-th line (adjust var $subset_definition). ; ; * always consider whether you need to protect as much as possible (intellectual ; property) or just enough so the code will fail without the decryption key. ; Don't encrypt (= slow down) more than you have to. ; ; * code will be encrypted from the #include MCFinclude.au3 onwards, ; so if #include MCFinclude.au3 precedes other #includes, these #includes will ; be encrypted too, making the script more secure, but also slower in execution. ; ; * The number of encrypted lines can be further reduced by: ; - enabling "Subset only", and defining a proportion (assigned randomly) or number of lines to skip (sequential) ; - pressing button and disabling the encryption of individual UDFs you select ; Note: this UDF "filter" is always applied (but by default all UDFs are selected); ; the Subset checkbox below this button applies only to proportional reductions, not UDFs. ; ; * The variable $decryption_key can contain: ; 1. a real password the user has to supply when running the target, OR ; 2. whatever your key definition is supposed to return in the *intended* environment ; (see the example further down) ; ; There are four scenarios: ; 1. key definition is empty, and $decryption_key is empty: ; This won't work! ; ; 2. key definition is NOT empty, but $decryption_key IS empty: ; - ENcryption key is defined by executing the key definition in the current environment ; - DEcryption key is defined by the key definition in MCFinclude when running the target ; This way the target will run only where/by whom it was encrypted. ; ; 3. key definition IS empty, but $decryption_key is NOT empty: ; - ENcryption key is defined by $decryption_key ; - DEcryption key is defined at target startup by either: ; . parsed cmdline parameter (first one if more than one), OR ; . user response to password query dialog ; This way the target will run for whomever knows the decryption key. ; ; 4. key definition is NOT empty, and $decryption_key is NOT empty: ; - ENcryption key is defined by $decryption_key ; - DEcryption key is defined by the key definition in MCFinclude when running the target ; This way the target will run only when executing the selected key definition at ; target startup yields whatever you specified as $decryption_key during ENcryption. ; ; Example: $CCkeytype = 3, and MCFinclude.au3 defines $CCkey[3] = @UserName macro ; Scenario 2: target should work only for you ; keep $decryption_key="" (do not supply a new key) ; A) key definition called by CodeCrypter executes macro for ENcryption (@username = ) ; B) key definition called by target executes macro for DEcryption = same as before ONLY when YOU run the target ; ; Scenario 4: target should work NOT for you, but for user "Sally" ; Press Encrypt-button "Decryptor" and set $decryption_key="Sally" (2x, to ensure no typos) ; A) CodeCrypter's key definition for ENcryption = "Sally" ; B) key definition called by target executes macro for DEcryption, so works only if macro @username yields "Sally" ; The MCFinclude in the target defines $CCkey[3]=@UserName, so only when user ; "Sally" runs the target, the correct decryption key is generated in $CCkey[3] ; ; Note: scenario 4 does not work *directly* for multi-key shuffling. ; There are two ways around this: ; 1. concatenate the response parts into a single keytype definition ; (this solution cannot include a user password query), OR ; 2. after running CodeScanner on the target with the original MCFinclude, ; edit MCFinclude.au3 for CodeCrypter to hardcode (as strings) the ; expected response for each keytype definition within shuffle range, ; then run CodeCrypter (this solution can include a user password query). ; ; =============================================================================================================================== #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_AU3Check_Parameters= -q -w 1 -w 2 -w- 4 -w 6 -w- 7 #AutoIt3Wrapper_UseX64=N #AutoIt3Wrapper_res_Compatibility=Vista,Windows7 #AutoIt3Wrapper_UseUPX=Y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include-once #NoTrayIcon #include #include #include #include #include #include ; MetaCodeFile UDF library, includes MCFinclude.au3 or its alternative #include "MCF.au3" #Region globals ; INI-related globals Global $inifile = @ScriptDir & "\CodeCrypter.ini" Global $INIboolean[1][1] Global $INIstring[1][1] Global $INInumeric[1][1] ; operational globals Global $label_undefined = "[ undefined ]" Global $targetfile = $label_undefined ; defined in GUI Global $targetpath = $label_undefined ; defined in GUI Global $decryption_key = "" ; can be defined in GUI (scenario-dependent, see Remarks) Global $maxkeytype = 0 ; actual range is defined in _ChekcMCFvars() and/or _TestCCKey() Global $selected2LV[1] ; concordance table for UDF selection Global $LV2selected[1] ; concordance table for UDF selection Global $showtooltips = True ; internal switch, not in GUI Global $askConfirmation = True ; internal switch, not in GUI Global $showprogress = True ; internal switch, not in GUI Global $file = "" Global $runquiet = False Global $createSingleBuild = False Global $callCrypter = False ;>>>>>>>>>>>>>>> Edit Added Global $aArrData, $aArrDataMain Global $iListView, $idInput, $fFilter = False ;< < < < < < < < End Edit #EndRegion globals #Region Main _LoadINIvarlists() _ReadIniFile() _CheckMCFVars() If $cmdline[0] > 0 Then ; automatic single run with data dump For $cc = 1 To $cmdline[0] Switch StringLower(StringLeft($cmdline[$cc], 2)) Case "/b", "-b", "/c", "-c" ; create single build $createSingleBuild = True Case "/d", "-d", "/p", "-p" ; p for password (required when setting /k1) $decryption_key = StringTrimLeft($cmdline[$cc], 2) If $decryption_key = "" Then Exit (-11) Case "/e", "-e" ; encrypt $MCF_PHRASING = True $MCF_ENCRYPT = True $MCF_ENCRYPT_PHRASES = True $MCF_ENCRYPT_STRINGS = True $createSingleBuild = True $callCrypter = True Case "/f", "-f", "/i", "-i" ; input file $file = StringTrimLeft($cmdline[$cc], 2) If $file = "" Then Exit (-11) Case "/k", "-k" ; key type (see array $CCkey in MCFinclude.au3) $Cckeytype = StringTrimLeft($cmdline[$cc], 2) If $CCkeytype < 1 Or $CCkeytype > UBound($CCkey) - 1 Then $CCkeytype = 1 ; default: user password query Case "/l", "-l" $uselogfile = True Case "/n", "-n" ; no cleanup $MCF_SKIP_UNCALLED_UDFS = False $MCF_REMOVE_ORPHANS = False Case "/o", "-o" ; obfuscate $MCF_OBFUSCATE = True $MCF_OBFUSCATE_UDFS = True $MCF_OBFUSCATE_VARS = True $createSingleBuild = True $callCrypter = True Case "/q", "-q" ; quiet $runquiet = True Case "/s", "-s" $subset_definition = _HandleEnteredSubsetDef(StringTrimLeft($cmdline[$cc], 2)) $MCF_ENCRYPT_SUBSET = True EndSwitch Next If $file = "" Then _IOError("no input file supplied") If Not FileExists($file) Then _IOError("input file not found: " & $file) ; required settings for MetaCode output for CodeCrypter If $MCF_ENCRYPT = True And $CCkeytype = 1 And $decryption_key = "" Then _IOError("user password query defined, but no password provided (add option /p)") If $runquiet = True Then $showprogress = False ; non-interactive single processing If _GetTargetFile($file) = False Then Exit ; just for filling some globals; no user-query If $uselogfile = True Then $logfile = $CS_dumppath & "CodeCrypter.log" If FileExists($logfile) Then FileDelete($logfile) $fhlog = FileOpen($logfile, 1) If @error Or $fhlog < 1 Then $uselogfile = False EndIf If $createSingleBuild = True Then _CreateSingleBuild($CS_dumppath, True) ; T = force_refresh If @error Then Exit EndIf If $callCrypter = True Then _RebuildScript($CS_dumppath, True) ; T = force_refresh If @error Then Exit EndIf Else _CCGUI() ; main proc EndIf If $uselogfile = True And $fhlog > 0 Then FileClose($fhlog) _WriteIniFile() Exit #EndRegion Main #Region main UDFs Func _CCGUI() $size = 303 Global $CCGUI = GUICreate("CodeCrypter", $size - 2, $size) GUISetBkColor(0xE0FFFF) GUISetFont(9, 400) $tooltip = "CodeCrypter Version 1.6," & @CR & _ "Latest Revision: 4 Feb 2016," & @CR & _ Chr(169) & " Copyright RTFC, 2013-16." $Label_cpr = GUICtrlCreateLabel(Chr(169), $size - 8, $size - 8, 10, 10) GUICtrlSetTip(-1, $tooltip) GUICtrlSetFont(-1, 7) GUICtrlSetColor(-1, 0x0000FF) $CBwidth = 17 $CBheight = 25 $labelheight = 17 $labelmargin = 6 $groupwidth = 130 $groupheight = 110 GUICtrlCreateTab(5, 5, $size - 10, $size - 12, BitOR($TCS_HOTTRACK, $TCS_MULTILINE, $TCS_FIXEDWIDTH)) $tab_MS = GUICtrlCreateTabItem("Main") GUICtrlSetState(-1, $GUI_SHOW) ; top left block $groupwidth = 130 $groupleft = 15 $grouptop = 60 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 25 GUICtrlCreateGroup("File I/O", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Combine all MetaCode Files into a Single-Build called MCF0.txt" $Checkbox_CS = GUICtrlCreateCheckbox("Checkbox_CS", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_CREATE_SINGLE = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_CS = GUICtrlCreateLabel("Create MCF0", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Create a script from MCF0 using codeScanner's original output." & @CR & "Use this to check that the MetaCode output is valid." $Checkbox_BT = GUICtrlCreateCheckbox("Checkbox_BT", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_BACKTRANSLATE = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_BT = GUICtrlCreateLabel("BackTranslate", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; in this case it may make more sense to call MCF functions directly from your own script $tooltip = "Create a script from MCF0 using *New[] arrays." & @CR & "Use this to define New content without CodeCrypter." $Checkbox_CN = GUICtrlCreateCheckbox("Checkbox_CN", $groupCBleft, $grouptop + ($groupCBspacing * 3), $CBwidth, $CBheight) If $MCF_CREATE_NEW = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_CN = GUICtrlCreateLabel("Create New", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 3), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $buttontop = 255 $buttonwidth = 80 $buttonheight = 27 $button_File = GUICtrlCreateButton("Source", $groupleft, $buttontop, $buttonwidth, $buttonheight) $tooltip = "Load a new Target source File (auto-loads Codescanner data path too)" If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $button_Run = GUICtrlCreateButton("Run", 110, $buttontop, $buttonwidth, $buttonheight) $tooltip = "Execute all enabled operations in the correct order" If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $button_Exit = GUICtrlCreateButton("Exit", 205, $buttontop, $buttonwidth, $buttonheight) $tooltip = "Apoptosis" If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; top right block $groupleft = 155 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 25 GUICtrlCreateGroup("CodeCrypter", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Replace original content with *Transl[] array contents" $Checkbox_TRANS = GUICtrlCreateCheckbox("Checkbox_TRANS", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_TRANSLATE = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_TRANS = GUICtrlCreateLabel("Translate", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace original names with obfuscated *Transl[] array contents" $Checkbox_OBFUSC = GUICtrlCreateCheckbox("Checkbox_OBFUSC", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_OBFUSCATE = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_OBFUSC = GUICtrlCreateLabel("Obfuscate", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace original phrases and strings with *Encryp[] array contents" & @CR & "(implies performancy penalty)" $Checkbox_ENCRYP = GUICtrlCreateCheckbox("Checkbox_ENCRYP", $groupCBleft, $grouptop + ($groupCBspacing * 3), $CBwidth, $CBheight) If $MCF_ENCRYPT = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_ENCRYP = GUICtrlCreateLabel("Encrypt", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 3), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; bottom wide block $groupwidth = 285 $groupleft = 15 $grouptop = 185 $boxwidth = 190 $tooltip = "This source file has to be pre-processed with CodeScanner." $Label_file = GUICtrlCreateLabel("Target File:", $groupleft + 10, $grouptop + 3, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Edit_file = GUICtrlCreateEdit("Editfile", $groupwidth - $boxwidth, $grouptop, $boxwidth, 22, BitOR($ES_READONLY, $ES_MULTILINE + $ES_AUTOHSCROLL)) GUICtrlSetData(-1, $targetfile) GUICtrlSetBkColor(-1, 0xFFFFFF) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $grouptop = 215 $boxwidth = 220 $tooltip = "CodeScanner writes data files to this subdirectory." $Label_path = GUICtrlCreateLabel("Path:", $groupleft + 10, $grouptop + 3, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Edit_path = GUICtrlCreateEdit("EditPath", $groupwidth - $boxwidth, $grouptop, $boxwidth, 22, BitOR($ES_READONLY, $ES_MULTILINE + $ES_AUTOHSCROLL)) GUICtrlSetData(-1, $targetpath) GUICtrlSetBkColor(-1, 0xFFFFFF) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ;____________________________________________________________________________ $tab_CO = GUICtrlCreateTabItem("Content") ; top left block $groupwidth = 130 $groupleft = 15 $grouptop = 60 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 25 GUICtrlCreateGroup("Translate", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Replace original text strings by contents of array $stringsTransl" $Checkbox_TS = GUICtrlCreateCheckbox("Checkbox_TS", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_TRANSLATE_STRINGS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_TS = GUICtrlCreateLabel("Strings", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace original function names by contents of array $functionsTransl" $Checkbox_TU = GUICtrlCreateCheckbox("Checkbox_TU", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_TRANSLATE_UDFS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_TU = GUICtrlCreateLabel("Functions", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace original variable names by contents of array $variablesTransl" $Checkbox_TV = GUICtrlCreateCheckbox("Checkbox_TV", $groupCBleft, $grouptop + ($groupCBspacing * 3), $CBwidth, $CBheight) If $MCF_TRANSLATE_VARS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_TV = GUICtrlCreateLabel("Variables", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 3), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; top right block $groupleft = 155 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 25 GUICtrlCreateGroup("Obfuscate", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Replace function names with cryptic hexadecimal strings" $Checkbox_OU = GUICtrlCreateCheckbox("Checkbox_OU", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_OBFUSCATE_UDFS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_OU = GUICtrlCreateLabel("Functions", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace variable names with cryptic hexadecimal strings" $Checkbox_OV = GUICtrlCreateCheckbox("Checkbox_OV", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_OBFUSCATE_VARS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_OV = GUICtrlCreateLabel("Variables", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $groupwidth = 270 $helptxt = "Translation comes in two flavours. You can A) translate all strings seen by users into a different language, " $helptxt &= "and B) replace names inside your code. For A, dump stringsUsed.txt into a translator service " $helptxt &= "and save result as stringsTransl.txt; for B, you'll probably have to edit manually. " $helptxt &= "Obfuscation just makes your script harder to read for humans." GUICtrlCreateLabel($helptxt, 25, $grouptop + $groupheight + 20, $groupwidth - 10, $groupheight) GUICtrlSetFont(-1, 8.5) ;____________________________________________________________________________ $tab_EN = GUICtrlCreateTabItem("Encrypt") ; top left block $groupwidth = 130 $groupleft = 15 $grouptop = 60 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 25 GUICtrlCreateGroup("Encrypt Content", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Replace each {phrase} with ""Execute(Decrypt())""" $Checkbox_EP = GUICtrlCreateCheckbox("Checkbox_EP", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_ENCRYPT_PHRASES = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_EP = GUICtrlCreateLabel("Phrases", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace each {string} with Decrypt()" $Checkbox_ES = GUICtrlCreateCheckbox("Checkbox_ES", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_ENCRYPT_STRINGS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_ES = GUICtrlCreateLabel("Strings", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Nested = encrypt(encrypt(,dynamickey),statickey)" & @CR & "UnNested = encrypt(,dynamickey)" & @CR & "WARNING: nesting doubles call execution time)" $Checkbox_EN = GUICtrlCreateCheckbox("Checkbox_EN", $groupCBleft, $grouptop + ($groupCBspacing * 3), $CBwidth, $CBheight) If $MCF_ENCRYPT_NESTED = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_EN = GUICtrlCreateLabel("Nested Keys", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 3), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; top right block $groupleft = 155 $groupCBleft = $groupleft + 20 $groupCBspacing = 22 GUICtrlCreateGroup("Single Key", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "index to array $CCkey[] in MCFinclude to identify which (single) key definition to use" $Label_Key = GUICtrlCreateLabel("Enter key ID:", $groupleft + 30, $grouptop + $groupCBspacing, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Input_Key = GUICtrlCreateInput("EditKey", $groupleft + 48, $labelmargin + $grouptop + ($groupCBspacing * 1.5), 30, 22, BitOR($ES_NUMBER, $ES_MULTILINE, $ES_RIGHT)) GUICtrlSetData(-1, $CCkeytype) GUICtrlSetBkColor(-1, 0xFFFFFF) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $buttontop = 135 $buttonwidth = 90 $buttonheight = 23 $button_PWD = GUICtrlCreateButton("Decryptor", $groupleft + 25, $buttontop, $buttonwidth, $buttonheight) $tooltip = "Define a user password to query at startup, or " & @CR & "an expected decryption key in the user's environment" If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; bottom left block $groupleft = 15 $grouptop = 180 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 24 GUICtrlCreateGroup("Subset Only", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Encrypt only a defined part of all phrases (calls and conditionals)" & @CR & "NB: does NOT affect selected UDFs above, this filter is always applied" $Checkbox_SSK = GUICtrlCreateCheckbox("Checkbox_SSK", $groupCBleft, $grouptop + 50, $CBwidth, $CBheight) If $MCF_ENCRYPT_SUBSET = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_SSK = GUICtrlCreateLabel("Subset def", $grouplabeleft, $labelmargin + $grouptop + 50, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "0 < entry < 1 = proportion encrypted (selected at random)" & @CR & " entry > 1 = 1 in N encrypted (sequential cycling)" $Input_SSD = GUICtrlCreateInput("EditSubset", $groupleft + 40, $labelmargin + $grouptop + ($groupCBspacing * 3), 60, 22, BitOR($ES_MULTILINE, $ES_RIGHT)) GUICtrlSetData(-1, $subset_definition) GUICtrlSetBkColor(-1, 0xFFFFFF) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $buttontop = 205 $buttonwidth = 90 $buttonheight = 23 $button_UDFs = GUICtrlCreateButton("UDFs", $groupleft + 20, $buttontop, $buttonwidth, $buttonheight) $tooltip = "Select individual UDF definition code blocks to encrypt" & @CR & "NB Always applied; does not depend on checkbox enabled below" If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; bottom right block $groupleft = 155 $grouptop = 180 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 22 GUICtrlCreateGroup("Multiple Keys", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Select keytypes at random from a pre-defined range" & @CR & "(single keytype ID is then ignored)" $Checkbox_SK = GUICtrlCreateCheckbox("Checkbox_SK", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_ENCRYPT_SHUFFLEKEY = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_SK = GUICtrlCreateLabel("Shuffle Keys", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "predefined range of keytypes" & @CR & "Valid Range: 1 to " & $maxkeytype & " inclusive" $Label_RF = GUICtrlCreateLabel("From:", $groupleft + 20, $labelmargin + $grouptop + ($groupCBspacing * 2), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Input_RF = GUICtrlCreateInput("EditFrom", $groupleft + 20, $labelmargin + $grouptop + ($groupCBspacing * 3), 30, 22, BitOR($ES_NUMBER, $ES_MULTILINE, $ES_RIGHT)) GUICtrlSetData(-1, $CCkeyshuffle_start) GUICtrlSetBkColor(-1, 0xFFFFFF) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_RT = GUICtrlCreateLabel("To:", $groupleft + 80, $labelmargin + $grouptop + ($groupCBspacing * 2), 100, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Input_RT = GUICtrlCreateInput("EditTo", $groupleft + 80, $labelmargin + $grouptop + ($groupCBspacing * 3), 30, 22, BitOR($ES_NUMBER, $ES_MULTILINE, $ES_RIGHT)) GUICtrlSetData(-1, $CCkeyshuffle_end) GUICtrlSetBkColor(-1, 0xFFFFFF) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ;____________________________________________________________________________ $tab_SB = GUICtrlCreateTabItem("Single-Build") ; top wide block $groupwidth = 270 $groupleft = 15 $grouptop = 50 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 20 GUICtrlCreateGroup("Create Single-Build", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Do not copy redundant UDF definitions from MCF# into MCF0" $Checkbox_SUU = GUICtrlCreateCheckbox("Checkbox_SUU", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_SKIP_UNCALLED_UDFS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_SUU = GUICtrlCreateLabel("Skip redundant UDF definitions", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Remove redundant global and UDF definitions from MCF0" & @CR & "(multi-pass post-processing; may take a long time)" $Checkbox_RO = GUICtrlCreateCheckbox("Checkbox_RO", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_REMOVE_ORPHANS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_RO = GUICtrlCreateLabel("Remove Orphaned Globals and UDFs", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Increase legibility of lines containing very long (composite) strings," & @CR & "by adding line breaks after each comma and ampersand (final output only)" $Checkbox_BL = GUICtrlCreateCheckbox("Checkbox_BL", $groupCBleft, $grouptop + ($groupCBspacing * 3), $CBwidth, $CBheight) If $MCF_BREAK_LONGSTRINGS = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_BL = GUICtrlCreateLabel("Break long strings into multi-lines", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 3), 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "force function names in strings to be retained without MetaCode conversion" $Checkbox_FIS = GUICtrlCreateCheckbox("Checkbox_BL", $groupCBleft, $grouptop + ($groupCBspacing * 4), $CBwidth, $CBheight) If $MCF_REPLACE_FUNCSINSTRINGS = False Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_FIS = GUICtrlCreateLabel("Skip MetaCoding Funcs in strings", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 4), 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $helptxt = "First run CodeScanner (set WriteMetaCode = True) on your target (first add include MCFinclude.au3!). " $helptxt &= "Under Tab [Single-Build] you control how much content is discarded when creating a Single-Build. " $helptxt &= "CodeScanner and CodeCrypter both assess which parts are redundant, but they can be wrong." GUICtrlCreateLabel($helptxt, 25, $grouptop + $groupheight + 20, $groupwidth - 10, $groupheight) GUICtrlSetFont(-1, 8.5) ;____________________________________________________________________________ $tab_ST = GUICtrlCreateTabItem("Structure") ; top wide block $groupwidth = 270 $groupleft = 15 $grouptop = 60 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 33 GUICtrlCreateGroup("Change Structure", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Replace direct variable assignments with indirect calls" $Checkbox_IND = GUICtrlCreateCheckbox("Checkbox_IND", $groupCBleft, $grouptop + $groupCBspacing, $CBwidth, $CBheight) If $MCF_INDIRECTION = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_IND = GUICtrlCreateLabel("Enable Indirection (adds calls)", $grouplabeleft, $labelmargin + $grouptop + $groupCBspacing, 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Replace conditionals and calls by MetaCode phrases" $Checkbox_PHR = GUICtrlCreateCheckbox("Checkbox_PHR", $groupCBleft, $grouptop + ($groupCBspacing * 2), $CBwidth, $CBheight) If $MCF_PHRASING = True Then GUICtrlSetState(-1, $GUI_CHECKED) Else GUICtrlSetState(-1, $GUI_UNCHECKED) EndIf If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $Label_PHR = GUICtrlCreateLabel("Enable Phrasing (compounds calls)", $grouplabeleft, $labelmargin + $grouptop + ($groupCBspacing * 2), 250, $labelheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $helptxt = "Indirection replaces code like ""$a = X"" (X = var or number) " $helptxt &= "with a call to a UDF in MCFinclude. Reason: direct assignments " $helptxt &= "cannot be encrypted, but calls can, so more code is shielded." & @CR $helptxt &= "Phrasing extracts all (nested) calls, macros, and conditional statements. " $helptxt &= "Compare the contents of arrays $phrases and $phrasesUsed to learn more." GUICtrlCreateLabel($helptxt, 25, $grouptop + $groupheight + 20, $groupwidth - 10, $groupheight) GUICtrlSetFont(-1, 8.5) ;____________________________________________________________________________ $tab_PR = GUICtrlCreateTabItem("Presets") ; top left block $groupheight = 175 $groupwidth = 130 $groupleft = 15 $grouptop = 60 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 $groupCBspacing = 33 $buttonwidth = 110 $buttonheight = 27 GUICtrlCreateGroup("Simple Presets", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Reset all switches" $buttontop = $grouptop + ($groupCBspacing * 1) $button_blank = GUICtrlCreateButton("Clear All", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Use the contents of arrays *Transl[] to rebuild the script" $buttontop = $grouptop + ($groupCBspacing * 2) $button_trans = GUICtrlCreateButton("Translate", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Make all variable- and UDF names meaningless and hard to distinguish" $buttontop = $grouptop + ($groupCBspacing * 3) $button_obfusc = GUICtrlCreateButton("Obfuscate", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Use the contents of *New[] arrays without any intermediate processing" $buttontop = $grouptop + ($groupCBspacing * 4) $button_new = GUICtrlCreateButton("New Output", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf ; top right block $groupleft = 155 $groupCBleft = $groupleft + 20 $grouplabeleft = $groupleft + 40 GUICtrlCreateGroup("Encryption Presets", $groupleft, $grouptop, $groupwidth, $groupheight) GUICtrlSetBkColor(-1, 0xE0FFFF) $tooltip = "Encrypt 10% of calls (cycled), do nothing else." $buttontop = $grouptop + $groupCBspacing $button_light = GUICtrlCreateButton("Light", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Encrypt 50% of calls (at random), encrypt strings, and obfuscate." $buttontop = $grouptop + ($groupCBspacing * 2) $button_medium = GUICtrlCreateButton("Medium", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Encrypt and obfuscate everything, use nested keys, but no indirection." $buttontop = $grouptop + ($groupCBspacing * 3) $button_heavy = GUICtrlCreateButton("Heavy", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $tooltip = "Are you serious? (code will become much slower)" $buttontop = $grouptop + ($groupCBspacing * 4) $button_insane = GUICtrlCreateButton("Insane", $groupleft + 10, $buttontop, $buttonwidth, $buttonheight) If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $grouptop = 250 $groupwidth = 270 $helptxt = "Adjust all settings at once by pressing a single button; " $helptxt &= "then select Tab [Main Settings] and press [Run]." GUICtrlCreateLabel($helptxt, 25, $grouptop, $groupwidth - 10, $groupheight) GUICtrlSetFont(-1, 8.5) GUICtrlCreateTabItem("") ;____________________________________________________________________________ $tab_MSdummy = GUICtrlCreateDummy() $tab_PRdummy = GUICtrlCreateDummy() $tab_STdummy = GUICtrlCreateDummy() $tab_COdummy = GUICtrlCreateDummy() $tab_SBdummy = GUICtrlCreateDummy() $tab_ENdummy = GUICtrlCreateDummy() $enterdummy = GUICtrlCreateDummy() Local $aAccelerators[7][2] = [["{m}", $tab_MSdummy], ["{p}", $tab_PRdummy], ["{s}", $tab_STdummy], ["{c}", $tab_COdummy], ["{b}", $tab_SBdummy], ["{e}", $tab_ENdummy], ["{Enter}", $enterdummy]] GUISetAccelerators($aAccelerators) GUISetState() While True $msgarray = GUIGetMsg(1) If $msgarray[1] <> $CCGUI Then ContinueLoop ; skip child msgs $nMsg = $msgarray[0] Switch $nMsg ; dummies Case $tab_MSdummy GUICtrlSetState($tab_MS, $GUI_SHOW) Case $tab_PRdummy GUICtrlSetState($tab_PR, $GUI_SHOW) Case $tab_STdummy GUICtrlSetState($tab_ST, $GUI_SHOW) Case $tab_COdummy GUICtrlSetState($tab_CO, $GUI_SHOW) Case $tab_SBdummy GUICtrlSetState($tab_SB, $GUI_SHOW) Case $tab_ENdummy GUICtrlSetState($tab_EN, $GUI_SHOW) Case $enterdummy $curCtrl = ControlGetFocus($CCGUI) If StringLeft($curCtrl, 4) = "Edit" Then ControlSend($CCGUI, "", $curCtrl, @TAB) Else ControlClick($CCGUI, "", ControlGetFocus($CCGUI)) EndIf ; buttons Case $GUI_EVENT_CLOSE, $button_Exit ExitLoop Case $Button_File $oldtargetfile = $targetfile $oldtargetpath = $targetpath _FadeGUI($CCGUI) _GetTargetFile() ; updates globals targetfile and targetpath, if valid _UnFadeGUI($CCGUI) If $oldtargetfile <> $targetfile Or $oldtargetpath <> $targetpath Then ControlSetText($CCGUI, "", $Edit_file, $targetfile, 1) ControlSetText($CCGUI, "", $Edit_path, $targetpath, 1) EndIf Case $Button_Run _FadeGUI($CCGUI) _RunMCF() _UnFadeGUI($CCGUI) Case $Checkbox_CS, $Label_CS $MCF_CREATE_SINGLE = Not $MCF_CREATE_SINGLE If $MCF_CREATE_SINGLE = True Then GUICtrlSetState($Checkbox_CS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_CS, $GUI_UNCHECKED) EndIf If $MCF_CREATE_SINGLE = True Then $MCF_SKIP_UNCALLED_UDFS = True GUICtrlSetState($Checkbox_SUU, $GUI_CHECKED) $MCF_REMOVE_ORPHANS = True GUICtrlSetState($Checkbox_RO, $GUI_CHECKED) EndIf Case $Checkbox_BT, $Label_BT $MCF_BACKTRANSLATE = Not $MCF_BACKTRANSLATE If $MCF_BACKTRANSLATE = True Then GUICtrlSetState($Checkbox_BT, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) EndIf If $MCF_BACKTRANSLATE = True Then $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_OBFUSCATE = False GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) EndIf Case $Checkbox_CN, $Label_CN $MCF_CREATE_NEW = Not $MCF_CREATE_NEW If $MCF_CREATE_NEW = True Then GUICtrlSetState($Checkbox_CN, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) EndIf If $MCF_CREATE_NEW = True Then $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_OBFUSCATE = False GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) EndIf Case $Checkbox_TRANS, $Label_TRANS $MCF_TRANSLATE = Not $MCF_TRANSLATE If $MCF_TRANSLATE = True Then GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) EndIf If $MCF_TRANSLATE = True Then $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = True GUICtrlSetState($Checkbox_TS, $GUI_CHECKED) If $MCF_ENCRYPT = False Then $MCF_PHRASING = False Else $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) EndIf Case $Checkbox_OBFUSC, $Label_OBFUSC $MCF_OBFUSCATE = Not $MCF_OBFUSCATE If $MCF_OBFUSCATE = True Then GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) EndIf If $MCF_OBFUSCATE = True Then $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) $MCF_OBFUSCATE_UDFS = True GUICtrlSetState($Checkbox_OU, $GUI_CHECKED) $MCF_OBFUSCATE_VARS = True GUICtrlSetState($Checkbox_OV, $GUI_CHECKED) If $MCF_ENCRYPT = False Then $MCF_PHRASING = False Else $MCF_OBFUSCATE_UDFS = False GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) $MCF_OBFUSCATE_VARS = False GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) EndIf Case $Checkbox_ENCRYP, $Label_ENCRYP $MCF_ENCRYPT = Not $MCF_ENCRYPT If $MCF_ENCRYPT = True Then GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) EndIf $MCF_PHRASING = $MCF_ENCRYPT If $MCF_PHRASING = True Then GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) EndIf If $MCF_ENCRYPT = True Then $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) $MCF_ENCRYPT_PHRASES = True GUICtrlSetState($Checkbox_EP, $GUI_CHECKED) $MCF_ENCRYPT_STRINGS = True GUICtrlSetState($Checkbox_ES, $GUI_CHECKED) Else $MCF_ENCRYPT_STRINGS = False GUICtrlSetState($Checkbox_ES, $GUI_UNCHECKED) $MCF_ENCRYPT_PHRASES = False GUICtrlSetState($Checkbox_EP, $GUI_UNCHECKED) EndIf Case $Checkbox_TS, $Label_TS $MCF_TRANSLATE_STRINGS = Not $MCF_TRANSLATE_STRINGS If $MCF_TRANSLATE_STRINGS = True Then GUICtrlSetState($Checkbox_TS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) EndIf $MCF_TRANSLATE = ($MCF_TRANSLATE_UDFS Or $MCF_TRANSLATE_VARS Or $MCF_TRANSLATE_STRINGS) If $MCF_TRANSLATE = True Then GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) EndIf Case $Checkbox_TU, $Label_TU $MCF_TRANSLATE_UDFS = Not $MCF_TRANSLATE_UDFS If $MCF_TRANSLATE_UDFS = True Then GUICtrlSetState($Checkbox_TU, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) EndIf $MCF_TRANSLATE = ($MCF_TRANSLATE_UDFS Or $MCF_TRANSLATE_VARS Or $MCF_TRANSLATE_STRINGS) If $MCF_TRANSLATE = True Then GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) EndIf If $MCF_TRANSLATE_UDFS = True Then $MCF_OBFUSCATE_UDFS = False GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) $MCF_OBFUSCATE = ($MCF_OBFUSCATE_UDFS Or $MCF_OBFUSCATE_VARS) If $MCF_OBFUSCATE = True Then GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) EndIf EndIf Case $Checkbox_TV, $Label_TV $MCF_TRANSLATE_VARS = Not $MCF_TRANSLATE_VARS If $MCF_TRANSLATE_VARS = True Then GUICtrlSetState($Checkbox_TV, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) EndIf $MCF_TRANSLATE = ($MCF_TRANSLATE_UDFS Or $MCF_TRANSLATE_VARS Or $MCF_TRANSLATE_STRINGS) If $MCF_TRANSLATE = True Then GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) EndIf If $MCF_TRANSLATE_VARS = True Then $MCF_OBFUSCATE_VARS = False GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) $MCF_OBFUSCATE = ($MCF_OBFUSCATE_UDFS Or $MCF_OBFUSCATE_VARS) If $MCF_OBFUSCATE = True Then GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) EndIf EndIf Case $Checkbox_OU, $Label_OU $MCF_OBFUSCATE_UDFS = Not $MCF_OBFUSCATE_UDFS If $MCF_OBFUSCATE_UDFS = True Then GUICtrlSetState($Checkbox_OU, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) EndIf $MCF_OBFUSCATE = ($MCF_OBFUSCATE_UDFS Or $MCF_OBFUSCATE_VARS) If $MCF_OBFUSCATE = True Then GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) EndIf If $MCF_OBFUSCATE_UDFS = True Then $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE = ($MCF_TRANSLATE_UDFS Or $MCF_TRANSLATE_VARS Or $MCF_TRANSLATE_STRINGS) If $MCF_TRANSLATE = True Then GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) EndIf EndIf Case $Checkbox_OV, $Label_OV $MCF_OBFUSCATE_VARS = Not $MCF_OBFUSCATE_VARS If $MCF_OBFUSCATE_VARS = True Then GUICtrlSetState($Checkbox_OV, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) EndIf $MCF_OBFUSCATE = ($MCF_OBFUSCATE_UDFS Or $MCF_OBFUSCATE_VARS) If $MCF_OBFUSCATE = True Then GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) EndIf If $MCF_OBFUSCATE_VARS = True Then $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_TRANSLATE = ($MCF_TRANSLATE_UDFS Or $MCF_TRANSLATE_VARS Or $MCF_TRANSLATE_STRINGS) If $MCF_TRANSLATE = True Then GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) EndIf EndIf Case $Checkbox_EP, $Label_EP $MCF_ENCRYPT_PHRASES = Not $MCF_ENCRYPT_PHRASES If $MCF_ENCRYPT_PHRASES = True Then GUICtrlSetState($Checkbox_EP, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_EP, $GUI_UNCHECKED) EndIf $MCF_ENCRYPT = ($MCF_ENCRYPT_PHRASES Or $MCF_ENCRYPT_STRINGS) If $MCF_ENCRYPT = True Then GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) EndIf $MCF_PHRASING = ($MCF_ENCRYPT Or $MCF_PHRASING) If $MCF_PHRASING = True Then GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) EndIf Case $Checkbox_ES, $Label_ES $MCF_ENCRYPT_STRINGS = Not $MCF_ENCRYPT_STRINGS If $MCF_ENCRYPT_STRINGS = True Then GUICtrlSetState($Checkbox_ES, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_ES, $GUI_UNCHECKED) EndIf $MCF_ENCRYPT = ($MCF_ENCRYPT_PHRASES Or $MCF_ENCRYPT_STRINGS) If $MCF_ENCRYPT = True Then GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) EndIf $MCF_PHRASING = ($MCF_ENCRYPT Or $MCF_PHRASING) If $MCF_PHRASING = True Then GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) EndIf Case $Checkbox_EN, $Label_EN $MCF_ENCRYPT_NESTED = Not $MCF_ENCRYPT_NESTED If $MCF_ENCRYPT_NESTED = True Then GUICtrlSetState($Checkbox_EN, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_EN, $GUI_UNCHECKED) EndIf Case $Input_Key _EnteredValue($CCkeytype, $Input_Key, 1, $maxkeytype) Case $button_PWD _FadeGUI($CCGUI) _DefineKey() _UnFadeGUI($CCGUI) Case $button_UDFs _FadeGUI($CCGUI) _DefineUDFlist() _UnFadeGUI($CCGUI) Case $Checkbox_SSK, $Label_SSK $MCF_ENCRYPT_SUBSET = Not $MCF_ENCRYPT_SUBSET If $MCF_ENCRYPT_SUBSET = True Then GUICtrlSetState($Checkbox_SSK, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_SSK, $GUI_UNCHECKED) EndIf Case $Input_SSD $entry = ControlGetText($CCGUI, "", $Input_SSD) $newentry = _HandleEnteredSubsetDef($entry) ControlSetText($CCGUI, "", $Input_SSD, $newentry, 1) If $entry <> $newentry Then $subset_definition = $newentry $MCF_ENCRYPT_SUBSET = True GUICtrlSetState($Checkbox_SSK, $GUI_CHECKED) EndIf Case $Checkbox_SK, $Label_SK $MCF_ENCRYPT_SHUFFLEKEY = Not $MCF_ENCRYPT_SHUFFLEKEY If $MCF_ENCRYPT_SHUFFLEKEY = True Then GUICtrlSetState($Checkbox_SK, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_SK, $GUI_UNCHECKED) EndIf Case $Input_RF _EnteredValue($CCkeyshuffle_start, $Input_RF, 1, $CCkeyshuffle_end) Case $Input_RT _EnteredValue($CCkeyshuffle_end, $Input_RT, $CCkeyshuffle_start, $maxkeytype) Case $Checkbox_SUU, $Label_SUU $MCF_SKIP_UNCALLED_UDFS = Not $MCF_SKIP_UNCALLED_UDFS If $MCF_SKIP_UNCALLED_UDFS = True Then GUICtrlSetState($Checkbox_SUU, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_SUU, $GUI_UNCHECKED) EndIf Case $Checkbox_RO, $Label_RO $MCF_REMOVE_ORPHANS = Not $MCF_REMOVE_ORPHANS If $MCF_REMOVE_ORPHANS = True Then GUICtrlSetState($Checkbox_RO, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_RO, $GUI_UNCHECKED) EndIf Case $Checkbox_BL, $Label_BL $MCF_BREAK_LONGSTRINGS = Not $MCF_BREAK_LONGSTRINGS If $MCF_BREAK_LONGSTRINGS = True Then GUICtrlSetState($Checkbox_BL, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_BL, $GUI_UNCHECKED) EndIf Case $Checkbox_FIS, $Label_FIS $MCF_REPLACE_FUNCSINSTRINGS = Not $MCF_REPLACE_FUNCSINSTRINGS If $MCF_REPLACE_FUNCSINSTRINGS = True Then GUICtrlSetState($Checkbox_FIS, $GUI_UNCHECKED) Else GUICtrlSetState($Checkbox_FIS, $GUI_CHECKED) EndIf Case $Checkbox_IND, $Label_IND $MCF_INDIRECTION = Not $MCF_INDIRECTION If $MCF_INDIRECTION = True Then GUICtrlSetState($Checkbox_IND, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) EndIf ; automatically set by enabling encryption ; separate option is for generating array $phrases[] for other purposes Case $Checkbox_PHR, $Label_PHR $MCF_PHRASING = Not $MCF_PHRASING If $MCF_PHRASING = True Then GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) Else GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) EndIf If $MCF_PHRASING = False Then $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) EndIf ; presets start here Case $button_new ; blank processing ; this is the only way to use arrays *New[] without CodeCrypter preprocessing ; it assumes arrays *New[] contain something valid produced externally (use at own risk) ; NB MCF:_ClearArrays(), called by CreateSingleBuild, pre-fills these arrays with *Used[] $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = False GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) $MCF_OBFUSCATE_UDFS = False GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) $MCF_OBFUSCATE_VARS = False GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) $MCF_ENCRYPT_PHRASES = False GUICtrlSetState($Checkbox_EP, $GUI_UNCHECKED) $MCF_ENCRYPT_STRINGS = False GUICtrlSetState($Checkbox_ES, $GUI_UNCHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = False GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = True GUICtrlSetState($Checkbox_CN, $GUI_CHECKED) Case $button_trans ; translation only $MCF_TRANSLATE = True GUICtrlSetState($Checkbox_TRANS, $GUI_CHECKED) $MCF_TRANSLATE_STRINGS = True GUICtrlSetState($Checkbox_TS, $GUI_CHECKED) $MCF_TRANSLATE_UDFS = True GUICtrlSetState($Checkbox_TU, $GUI_CHECKED) $MCF_TRANSLATE_VARS = True GUICtrlSetState($Checkbox_TV, $GUI_CHECKED) $MCF_OBFUSCATE = False GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) $MCF_OBFUSCATE_UDFS = False GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) $MCF_OBFUSCATE_VARS = False GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) $MCF_ENCRYPT_PHRASES = False GUICtrlSetState($Checkbox_EP, $GUI_UNCHECKED) $MCF_ENCRYPT_STRINGS = False GUICtrlSetState($Checkbox_ES, $GUI_UNCHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = False GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) Case $button_obfusc ; obfuscation only $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = True GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) $MCF_OBFUSCATE_UDFS = True GUICtrlSetState($Checkbox_OU, $GUI_CHECKED) $MCF_OBFUSCATE_VARS = True GUICtrlSetState($Checkbox_OV, $GUI_CHECKED) $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) $MCF_ENCRYPT_PHRASES = False GUICtrlSetState($Checkbox_EP, $GUI_UNCHECKED) $MCF_ENCRYPT_STRINGS = False GUICtrlSetState($Checkbox_ES, $GUI_UNCHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = False GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) Case $button_blank $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = False GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) $MCF_OBFUSCATE_UDFS = False GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) $MCF_OBFUSCATE_VARS = False GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = False GUICtrlSetState($Checkbox_PHR, $GUI_UNCHECKED) $MCF_ENCRYPT = False GUICtrlSetState($Checkbox_ENCRYP, $GUI_UNCHECKED) $MCF_ENCRYPT_PHRASES = False GUICtrlSetState($Checkbox_EP, $GUI_UNCHECKED) $MCF_ENCRYPT_STRINGS = False GUICtrlSetState($Checkbox_ES, $GUI_UNCHECKED) $MCF_ENCRYPT_NESTED = False GUICtrlSetState($Checkbox_EN, $GUI_UNCHECKED) $MCF_ENCRYPT_SUBSET = False GUICtrlSetState($Checkbox_SSK, $GUI_UNCHECKED) $MCF_ENCRYPT_SHUFFLEKEY = False GUICtrlSetState($Checkbox_SK, $GUI_UNCHECKED) $MCF_CREATE_SINGLE = False GUICtrlSetState($Checkbox_CS, $GUI_UNCHECKED) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) $MCF_SKIP_UNCALLED_UDFS = False GUICtrlSetState($Checkbox_SUU, $GUI_UNCHECKED) $MCF_REMOVE_ORPHANS = False GUICtrlSetState($Checkbox_RO, $GUI_UNCHECKED) Case $button_light ; light encryption $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = False GUICtrlSetState($Checkbox_OBFUSC, $GUI_UNCHECKED) $MCF_OBFUSCATE_UDFS = False GUICtrlSetState($Checkbox_OU, $GUI_UNCHECKED) $MCF_OBFUSCATE_VARS = False GUICtrlSetState($Checkbox_OV, $GUI_UNCHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = True GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) $MCF_ENCRYPT = True GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) $MCF_ENCRYPT_PHRASES = True GUICtrlSetState($Checkbox_EP, $GUI_CHECKED) $MCF_ENCRYPT_STRINGS = True GUICtrlSetState($Checkbox_ES, $GUI_CHECKED) $MCF_ENCRYPT_NESTED = False GUICtrlSetState($Checkbox_EN, $GUI_UNCHECKED) $MCF_ENCRYPT_SUBSET = True GUICtrlSetState($Checkbox_SK, $GUI_CHECKED) $MCF_ENCRYPT_SHUFFLEKEY = False GUICtrlSetState($Checkbox_SK, $GUI_UNCHECKED) $subset_definition = 10 ControlSetText($CCGUI, "", $Input_SSD, $subset_definition) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) Case $button_medium ; medium encryption $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = True GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) $MCF_OBFUSCATE_UDFS = True GUICtrlSetState($Checkbox_OU, $GUI_CHECKED) $MCF_OBFUSCATE_VARS = True GUICtrlSetState($Checkbox_OV, $GUI_CHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = True GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) $MCF_ENCRYPT = True GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) $MCF_ENCRYPT_PHRASES = True GUICtrlSetState($Checkbox_EP, $GUI_CHECKED) $MCF_ENCRYPT_STRINGS = True GUICtrlSetState($Checkbox_ES, $GUI_CHECKED) $MCF_ENCRYPT_NESTED = False GUICtrlSetState($Checkbox_EN, $GUI_UNCHECKED) $MCF_ENCRYPT_SUBSET = True GUICtrlSetState($Checkbox_SSK, $GUI_CHECKED) $MCF_ENCRYPT_SHUFFLEKEY = False GUICtrlSetState($Checkbox_SK, $GUI_UNCHECKED) $subset_definition = 0.5 ControlSetText($CCGUI, "", $Input_SSD, $subset_definition) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) Case $button_heavy ; heavy-duty encryption $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = True GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) $MCF_OBFUSCATE_UDFS = True GUICtrlSetState($Checkbox_OU, $GUI_CHECKED) $MCF_OBFUSCATE_VARS = True GUICtrlSetState($Checkbox_OV, $GUI_CHECKED) $MCF_ENCRYPT = True GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) $MCF_ENCRYPT_PHRASES = True GUICtrlSetState($Checkbox_EP, $GUI_CHECKED) $MCF_ENCRYPT_STRINGS = True GUICtrlSetState($Checkbox_ES, $GUI_CHECKED) $MCF_INDIRECTION = False GUICtrlSetState($Checkbox_IND, $GUI_UNCHECKED) $MCF_PHRASING = True GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) $MCF_ENCRYPT_NESTED = True GUICtrlSetState($Checkbox_EN, $GUI_CHECKED) $MCF_ENCRYPT_SUBSET = False GUICtrlSetState($Checkbox_SSK, $GUI_UNCHECKED) $MCF_ENCRYPT_SHUFFLEKEY = False GUICtrlSetState($Checkbox_SK, $GUI_UNCHECKED) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) Case $button_insane ; encryption $MCF_TRANSLATE = False GUICtrlSetState($Checkbox_TRANS, $GUI_UNCHECKED) $MCF_TRANSLATE_STRINGS = False GUICtrlSetState($Checkbox_TS, $GUI_UNCHECKED) $MCF_TRANSLATE_UDFS = False GUICtrlSetState($Checkbox_TU, $GUI_UNCHECKED) $MCF_TRANSLATE_VARS = False GUICtrlSetState($Checkbox_TV, $GUI_UNCHECKED) $MCF_OBFUSCATE = True GUICtrlSetState($Checkbox_OBFUSC, $GUI_CHECKED) $MCF_OBFUSCATE_UDFS = True GUICtrlSetState($Checkbox_OU, $GUI_CHECKED) $MCF_OBFUSCATE_VARS = True GUICtrlSetState($Checkbox_OV, $GUI_CHECKED) $MCF_INDIRECTION = True GUICtrlSetState($Checkbox_IND, $GUI_CHECKED) $MCF_PHRASING = True GUICtrlSetState($Checkbox_PHR, $GUI_CHECKED) $MCF_ENCRYPT = True GUICtrlSetState($Checkbox_ENCRYP, $GUI_CHECKED) $MCF_ENCRYPT_PHRASES = True GUICtrlSetState($Checkbox_EP, $GUI_CHECKED) $MCF_ENCRYPT_STRINGS = True GUICtrlSetState($Checkbox_ES, $GUI_CHECKED) $MCF_ENCRYPT_NESTED = True GUICtrlSetState($Checkbox_EN, $GUI_CHECKED) $MCF_ENCRYPT_SUBSET = False GUICtrlSetState($Checkbox_SSK, $GUI_UNCHECKED) $MCF_ENCRYPT_SHUFFLEKEY = False GUICtrlSetState($Checkbox_SK, $GUI_UNCHECKED) $MCF_BACKTRANSLATE = False GUICtrlSetState($Checkbox_BT, $GUI_UNCHECKED) $MCF_CREATE_NEW = False GUICtrlSetState($Checkbox_CN, $GUI_UNCHECKED) EndSwitch WEnd EndFunc ;==>_CCGUI Func _DefineUDFlist() ; check arrays filled? reload if not If $targetfile = $label_undefined Or $targetpath = $label_undefined Or _ $targetfile = "" Or $targetpath = "" Or Not FileExists($targetpath & ".") Then MsgBox(262144 + 4096 + 16, "CodeCrypter: Unable to proceed", "Target file is undefined or not found.") Return SetError(-1, 0, False) Else ; target is defined ; prepare $SelectedUDF* arrays, fill CS_dumppath _FillSelectedUDFarrays($targetpath, False) EndIf ; set up two-way referencing for LV < = > arrays $totalUDFs = UBound($selectedUDFname) ; base-0 _LVconcordance($totalUDFs) $restoreEnabled = (FileExists($CS_dumppath & "selectedUDFname.txt") And _ FileExists($CS_dumppath & "selectedUDFstatus.txt") And _ FileExists($CS_dumppath & "selectedUDFfixed.txt")) $guiheight = 500 $hSelectUDFs = GUICreate("Encryptable Code Sections", 350, $guiheight) GUISetBkColor(0xE0FFFF) ;>>>>>>>>>>>>>>> Edit Added $idInput = GUICtrlCreateInput("", 10, 2, 244, 20) $button_Clear_Filter = GUICtrlCreateButton('Clear Filter', 255, 3, 90, 18) $iListView = GUICtrlCreateListView("", 5, 22, 340, $guiheight - 58) ;< < < < < < < < End Edit ;$iListView = GUICtrlCreateListView("", 5, 5, 340, $guiheight - 40) $hListView = GUICtrlGetHandle($iListView) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) $tooltip = "Define which UDFs will be affected by Encryption;" & @CR & _ "selections are committed only when pressing or ." & @CR & _ "Press to abandon this process without changing anything." If $showtooltips = True Then GUICtrlSetTip(-1, $tooltip) Else GUICtrlSetTip(-1, "") EndIf $groupleft = 7 $buttontop = $guiheight - 31 $buttonwidth = 60 $buttonmargin = 9 $buttonheight = 27 $button_Clear = GUICtrlCreateButton("Clear", $groupleft, $buttontop, $buttonwidth, $buttonheight) $tooltip = "Unselect all checkboxes (to