-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcodecrypter.au3
2574 lines (2257 loc) · 88.6 KB
/
codecrypter.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;============================================================================================
; Title ..........: CodeCrypter
; AutoIt Version..: 3.3.12
; Description ....: encrypts an Autoit script using any user-defined key or external password
; Author..........: A.R.T. Jonkers (RTFC)
; Release.........: 1.3
; Latest revision.: 16 Aug 2014
; License.........: free for personal use; free distribution allowed provided
; the author is credited; all other rights reserved.
; Tested on.......: W7Pro/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)
;
; 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 <your_script>
; 2. Run CodeScanner on <your_script> with setting WriteMetaCode=True
; 3. Run CodeCrypter on <your_script>
;
; 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.
;============================================================================================
; 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
; 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"))
; - multiprocessing UDFs such as Picasso's CoProc that relaunch a script subsection (these would lack MCFinclude.au3)
; - lines containing @error/@extended (Execute() loses their state prior to evaluation); such lines remain unencrypted
;
; * By default, encryption relies on Ward's AES.au3, which you have to download separately
; and place in the same directory as MCFinclude.au3 and your target script.
; IMPORTANT: AES.au3 requires one line to be patched to work with current AutoIt versions;
; 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 changed 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 the 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 <UDFs> 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 = <your_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
#AutoIt3Wrapper_Run_Obfuscator=N
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include-once
#NoTrayIcon
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListView.au3>
#include <Misc.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
; 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
#endregion globals
#region Main
_LoadINIvarlists()
_ReadIniFile()
_CheckMCFvars()
_CCGUI() ; main proc
_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.1," & @CR & _
"Latest Revision: 25 July 2014," & @CR & _
Chr(169) & " Copyright RTFC, 2013-14."
$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(<encrypted call or conditionals>))"""
$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(<encrypted string>)"
$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(<call>,dynamickey),statickey)"&@CR&"UnNested = encrypt(<call>,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=60
$groupCBleft=$groupleft+20
$grouplabeleft=$groupleft+40
$groupCBspacing=33
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
$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,"")