SHARE
TWEET

Obfuscator v1.3.8c by Shadow992 (ENGLISH VERSION)

KekSec Aug 13th, 2019 122 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Author ........: Shadow992
  2. ; Modified.......: No Edit
  3. ; Version........: 1.3.8c
  4. ; Copyright by Shadow992
  5. #RequireAdmin
  6. #Include <GuiComboBox.au3>
  7. #include <ButtonConstants.au3>
  8. #include <EditConstants.au3>
  9. #include <GUIConstantsEx.au3>
  10. #include <StaticConstants.au3>
  11. #include <WindowsConstants.au3>
  12. #include <array.au3>
  13. #include <file.au3>
  14. #include <string.au3>
  15. #Region ### START Koda GUI section ### Form=
  16. $Form1 = GUICreate("Obfuscator by Shadow992", 569, 267, 253, 183, Default, $WS_EX_ACCEPTFILES)
  17. GUISetBkColor(0x9DB9EB)
  18. $Schlussel_Button = GUICtrlCreateButton("Generate a new key", 416, 40, 145, 25, $WS_GROUP)
  19. $Schlussel_Input = GUICtrlCreateInput("", 8, 40, 401, 21)
  20. $Datei_Input = GUICtrlCreateInput("", 8, 8, 353, 21)
  21. GUICtrlSetState($Datei_Input, $GUI_DROPACCEPTED)
  22. $Datei_Button = GUICtrlCreateButton("Select file to obfuscate", 368, 8, 193, 25, $WS_GROUP)
  23. $Label1 = GUICtrlCreateLabel("", 8, 88, 259, 113)
  24. $Variblen_Checkbox = GUICtrlCreateCheckbox("Variable name obfuscate", 288, 80, 193, 20)
  25. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  26. $Funktionen_Checkbox = GUICtrlCreateCheckbox("Own functions obfuscate", 288, 120, 201, 20)
  27. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  28. $AutoITBefehleObfuscaten_Checkbox = GUICtrlCreateCheckbox("AutoIT Commands obfuscate", 288, 160, 195, 20)
  29. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  30. $Hash_Combobox = GUICtrlCreateCombo("Shadowhash", 8, 208, 265, 25)
  31. GUICtrlSetData($Hash_Combobox,"RC4|CRC32|MD5|MD5 & RC4|MD5 & CRC32|Shadowhash & RC4|CRC32 & RC4|CRC32 & Shadowhash & RC4 & MD5 ")
  32. GUICtrlSetState($Hash_Combobox,$GUI_DISABLE)
  33. $AutoITStarkObfuscate_Checkbox = GUICtrlCreateCheckbox("AutoIT commands strongly obfuscate", 312, 184, 239, 25)
  34. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  35. GUICtrlSetState($AutoITStarkObfuscate_Checkbox,$GUI_DISABLE)
  36. $Group1 = GUICtrlCreateGroup("", 280, 144, 281, 73)
  37. GUICtrlCreateGroup("", -99, -99, 1, 1)
  38. $Group2 = GUICtrlCreateGroup("", 280, 104, 281, 41)
  39. GUICtrlCreateGroup("", -99, -99, 1, 1)
  40. $Group3 = GUICtrlCreateGroup("", 280, 64, 281, 41)
  41. GUICtrlCreateGroup("", -99, -99, 1, 1)
  42. $Group4 = GUICtrlCreateGroup("", 280, 216, 281, 41)
  43. GUICtrlCreateGroup("", -99, -99, 1, 1)
  44. $Includes_Checkbox= GUICtrlCreateCheckbox("Includes integrate (minimizes number of errors)", 288, 232, 271, 20)
  45. $Kommentar_Checkbox=$GUI_UNCHECKED
  46. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  47. $Start = GUICtrlCreateButton("Start", 8, 232, 265, 25, $WS_GROUP)
  48. $Label2 = GUICtrlCreateLabel("© by Shadow992", 76, 64, 124, 24)
  49. GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
  50. GUICtrlSetColor(-1, 0xFF0000)
  51. GUISetState(@SW_SHOW)
  52. #EndRegion ### END Koda GUI section ###
  53.             $randT=""
  54.             For $k=0 To Random(20,50,1)
  55.                 If Random(0,1,1)=1 Then
  56.                 $randT=$randT&chr(Random(65,90,1))
  57.                 Else
  58.                 $randT=$randT&chr(Random(97,122,1))
  59.                 EndIf
  60.             Next
  61.             GUICtrlSetData($Schlussel_Input,$randT)
  62. $Zahl=1
  63. $file=""
  64. $write=""
  65. $salt=Random(65,90,1)
  66. $salt2=Random(1,999,1)
  67. dim $kommentar[1]
  68. dim $arrays[1]
  69. $Zahl2=0
  70. $key=0
  71. $file2=0
  72. $hash=0
  73. $read=0
  74. _GUICtrlComboBox_SetCurSel($Hash_Combobox,3)
  75. HotKeySet("{F6}","Ende")
  76. #Region Hashfunctions made by Ward (http://www.autoitscript.com/forum)
  77. Global  $_MD5Opcode = '0xC85800005356576A006A006A008D45A850E8280000006A00FF750CFF75088D45A850E8440000006A006A008D45A850FF7510E8710700005F5E5BC9C210005589E58B4D0831C0894114894110C70101234567C7410489ABCDEFC74108FEDCBA98C7410C765432105DC21000C80C0000538B5D088B4310C1E80383E03F8945F88B4510C1E0030143103943107303FF43148B4510C1E81D0143146A40582B45F88945F4394510724550FF750C8B45F88D44031850E8A00700008D43185053E84E0000008B45F48945FC8B45FC83C03F39451076138B450C0345FC5053E8300000008345FC40EBE28365F800EB048365FC008B45102B45FC508B450C0345FC508B45F88D44031850E84D0700005BC9C21000C84000005356576A40FF750C8D45C050E8330700008B45088B088B50048B70088B780C89D021F089D3F7D321FB09D801C1034DC081C178A46AD7C1C10701D189C821D089CBF7D321F309D801C7037DC481C756B7C7E8C1C70C01CF89F821C889FBF7D321D309D801C60375C881C6DB702024C1C61101FE89F021F889F3F7D321CB09D801C20355CC81C2EECEBDC1C1C21601F289D021F089D3F7D321FB09D801C1034DD081C1AF0F7CF5C1C10701D189C821D089CBF7D321F309D801C7037DD481C72AC68747C1C70C01CF89F821C889FBF7D321D309D801C60375D881C6134630A8C1C61101FE89F021F889F3F7D321CB09D801C20355DC81C2019546FDC1C21601F289D021F089D3F7D321FB09D801C1034DE081C1D8988069C1C10701D189C821D089CBF7D321F309D801C7037DE481C7AFF7448BC1C70C01CF89F821C889FBF7D321D309D801C60375E881C6B15BFFFFC1C61101FE89F021F889F3F7D321CB09D801C20355EC81C2BED75C89C1C21601F289D021F089D3F7D321FB09D801C1034DF081C12211906BC1C10701D189C821D089CBF7D321F309D801C7037DF481C7937198FDC1C70C01CF89F821C889FBF7D321D309D801C60375F881C68E4379A6C1C61101FE89F021F889F3F7D321CB09D801C20355FC81C22108B449C1C21601F289D021F889FBF7D321F309D801C1034DC481C162251EF6C1C10501D189C821F089F3F7D321D309D801C7037DD881C740B340C0C1C70901CF89F821D089D3F7D321CB09D801C60375EC81C6515A5E26C1C60E01FE89F021C889CBF7D321FB09D801C20355C081C2AAC7B6E9C1C21401F289D021F889FBF7D321F309D801C1034DD481C15D102FD6C1C10501D189C821F089F3F7D321D309D801C7037DE881C753144402C1C70901CF89F821D089D3F7D321CB09D801C60375FC81C681E6A1D8C1C60E01FE89F021C889CBF7D321FB09D801C20355D081C2C8FBD3E7C1C21401F289D021F889FBF7D321F309D801C1034DE481C1E6CDE121C1C10501D189C821F089F3F7D321D309D801C7037D'
  78.         $_MD5Opcode &= 'F881C7D60737C3C1C70901CF89F821D089D3F7D321CB09D801C60375CC81C6870DD5F4C1C60E01FE89F021C889CBF7D321FB09D801C20355E081C2ED145A45C1C21401F289D021F889FBF7D321F309D801C1034DF481C105E9E3A9C1C10501D189C821F089F3F7D321D309D801C7037DC881C7F8A3EFFCC1C70901CF89F821D089D3F7D321CB09D801C60375DC81C6D9026F67C1C60E01FE89F021C889CBF7D321FB09D801C20355F081C28A4C2A8DC1C21401F289D031F031F801C1034DD481C14239FAFFC1C10401D189C831D031F001C7037DE081C781F67187C1C70B01CF89F831C831D001C60375EC81C622619D6DC1C61001FE89F031F831C801C20355F881C20C38E5FDC1C21701F289D031F031F801C1034DC481C144EABEA4C1C10401D189C831D031F001C7037DD081C7A9CFDE4BC1C70B01CF89F831C831D001C60375DC81C6604BBBF6C1C61001FE89F031F831C801C20355E881C270BCBFBEC1C21701F289D031F031F801C1034DF481C1C67E9B28C1C10401D189C831D031F001C7037DC081C7FA27A1EAC1C70B01CF89F831C831D001C60375CC81C68530EFD4C1C61001FE89F031F831C801C20355D881C2051D8804C1C21701F289D031F031F801C1034DE481C139D0D4D9C1C10401D189C831D031F001C7037DF081C7E599DBE6C1C70B01CF89F831C831D001C60375FC81C6F87CA21FC1C61001FE89F031F831C801C20355C881C26556ACC4C1C21701F289F8F7D009D031F001C1034DC081C1442229F4C1C10601D189F0F7D009C831D001C7037DDC81C797FF2A43C1C70A01CF89D0F7D009F831C801C60375F881C6A72394ABC1C60F01FE89C8F7D009F031F801C20355D481C239A093FCC1C21501F289F8F7D009D031F001C1034DF081C1C3595B65C1C10601D189F0F7D009C831D001C7037DCC81C792CC0C8FC1C70A01CF89D0F7D009F831C801C60375E881C67DF4EFFFC1C60F01FE89C8F7D009F031F801C20355C481C2D15D8485C1C21501F289F8F7D009D031F001C1034DE081C14F7EA86FC1C10601D189F0F7D009C831D001C7037DFC81C7E0E62CFEC1C70A01CF89D0F7D009F831C801C60375D881C6144301A3C1C60F01FE89C8F7D009F031F801C20355F481C2A111084EC1C21501F289F8F7D009D031F001C1034DD081C1827E53F7C1C10601D189F0F7D009C831D001C7037DEC81C735F23ABDC1C70A01CF89D0F7D009F831C801C60375C881C6BBD2D72AC1C60F01FE89C8F7D009F031F801C20355E481C291D386EBC1C21501F28B4508010801500401700801780C5F5E5BC9C20800C814000053E840000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008F45EC8B5D0C6A088D4310508D'
  79.         $_MD5Opcode &= '45F850E8510000008B4310C1E80383E03F8945F483F838730B6A38582B45F48945F0EB096A78582B45F48945F0FF75F0FF75ECFF750CE831F8FFFF6A088D45F850FF750CE823F8FFFF6A1053FF7508E8050000005BC9C210005589E55156578B7D088B750C8B4D10FCF3A45F5E595DC20C00'
  80. #EndRegion
  81. While 1
  82.     If $Zahl2=0 Then
  83.     If (BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Or BitAND(GUICtrlRead ($Variblen_Checkbox),$GUI_CHECKED)=1)  Then
  84.  
  85.         GUICtrlSetState($Hash_Combobox,$GUI_ENABLE)
  86.         $Zahl2=1
  87.     Else
  88.         GUICtrlSetState($Hash_Combobox,$GUI_DISABLE)
  89.         $Zahl2=1
  90.     EndIf
  91.     EndIf
  92.     $nMsg = GUIGetMsg()
  93.     Switch $nMsg
  94.         Case $GUI_EVENT_CLOSE
  95.             Exit
  96.         Case $Schlussel_Button
  97.             $randT=""
  98.             For $k=0 To Random(20,50,1)
  99.                 If Random(0,1,1)=1 Then
  100.                 $randT=$randT&chr(Random(65,90,1))
  101.                 Else
  102.                 $randT=$randT&chr(Random(97,122,1))
  103.                 EndIf
  104.             Next
  105.             GUICtrlSetData($Schlussel_Input,$randT)
  106.         Case $Schlussel_Input
  107.         Case $Datei_Input
  108.         Case $Datei_Button
  109.             $file=FileOpenDialog("Select file to obfuscate","","(*.au3)",1)
  110.             GUICtrlSetData($Datei_Input,$file)
  111.             if FileExists (guictrlread ($Datei_Input)) Then
  112.                 guictrlsetdata ($Label1,"Row: "&_FileCountLines (guictrlread ($Datei_Input))&@CRLF&@CRLF&"Size : "&FileGetSize (guictrlread ($Datei_Input))&" B"&@CRLF&@CRLF&"Estimated size "&@CRLF&"Post obfuscation: "&@CRLF&Round((FileGetSize(guictrlread ($Datei_Input))*5)/1024,1)&" KB")
  113.             EndIf
  114.         Case $Variblen_Checkbox
  115.             $Zahl2=0
  116.         Case $Funktionen_Checkbox
  117.             $Zahl2=0
  118.         Case $AutoITBefehleObfuscaten_Checkbox
  119.             If $Zahl=1 Then
  120.                 GUICtrlSetState($AutoITStarkObfuscate_Checkbox,$GUI_ENABLE)
  121.                 $Zahl=2
  122.             Else
  123.                 GUICtrlSetState($AutoITStarkObfuscate_Checkbox,$GUI_DISABLE)
  124.                 GUICtrlSetState($AutoITStarkObfuscate_Checkbox,$GUI_UNCHECKED)
  125.                 $Zahl=1
  126.             EndIf
  127.         Case $Hash_Combobox
  128.         Case $AutoITStarkObfuscate_Checkbox
  129.         Case $Kommentar_Checkbox
  130.         Case $Start
  131.         If GUICtrlRead($Schlussel_Input)<>"" and GUICtrlRead($Schlussel_Input)<>" " Then
  132.             If FileExists (guictrlread ($Datei_Input)) and _Filecountlines(guictrlread ($Datei_Input))<>0 and FileRead(guictrlread ($Datei_Input))<>"" Then
  133.             $file=guictrlread ($Datei_Input)
  134.             Obfuscate()
  135.             Else
  136.             MsgBox(0,"Invalid file","This file is invalid or missing")
  137.             EndIf
  138.         Else
  139.         If _GUICtrlComboBox_GetCurSel($Hash_Combobox) = 3 or _GUICtrlComboBox_GetCurSel($Hash_Combobox) = 5 or _GUICtrlComboBox_GetCurSel($Hash_Combobox) = 2  Then
  140.         If FileExists (guictrlread ($Datei_Input)) and _Filecountlines(guictrlread ($Datei_Input))<>0 and FileRead(guictrlread ($Datei_Input))<>"" Then
  141.         $file=guictrlread ($Datei_Input)
  142.         Obfuscate()
  143.         Else
  144.         MsgBox(0,"Invalid file","This file is invalid or missing")
  145.         EndIf
  146.         Else
  147.         If (BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=0 And BitAND(GUICtrlRead ($Variblen_Checkbox),$GUI_CHECKED)=0)  Then
  148.         If FileExists (guictrlread ($Datei_Input)) and _Filecountlines(guictrlread ($Datei_Input))<>0 and FileRead(guictrlread ($Datei_Input))<>"" Then
  149.  
  150.         $file=guictrlread ($Datei_Input)
  151.         Obfuscate()
  152.         Else
  153.         MsgBox(0,"Invalid file","This file is invalid or missing")
  154.         EndIf
  155.         Else
  156.         MsgBox(0,"Invalid characters","Please note that the key may only consist of letters")
  157.         EndIf
  158.         EndIf
  159.  
  160.         EndIf
  161.     EndSwitch
  162. WEnd
  163.  
  164.  
  165.  
  166. Func ArrayObfuscate()
  167. _FileReadToArray($file2,$arrays)
  168. $gros=UBound($arrays)-1
  169. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  170. _ArrayAdd($arrays,"Func _"&Hash(Chr($salt)&"_Arrays_Definition_Fuction"&Chr($salt),$key,$hash)&Chr($salt)&"()")
  171. _ArrayInsert($arrays,2,"_"&Hash(Chr($salt)&"_Arrays_Definition_Fuction"&Chr($salt),$key,$hash)&Chr($salt)&"()")
  172. Else
  173. _ArrayAdd($arrays,"Func _"&Chr($salt)&"_Arrays_Definition_Fuction"&Chr($salt)&"()")
  174. _ArrayInsert($arrays,2,"_"&Chr($salt)&"_Arrays_Definition_Fuction"&Chr($salt)&"()")
  175. EndIf
  176. For $i=1 To $gros
  177. If StringInStr($arrays[$i],"$")<>0 And StringInStr($arrays[$i],"[")<>0 And StringInStr($arrays[$i],"]")<>0 Then
  178. $Ok=1
  179.  
  180. $RightArray=_StringBetween($arrays[$i],"'","'")
  181. if IsArray($RightArray) Then
  182. For $g=0 To UBound($RightArray)-1
  183. if StringInStr($RightArray[$g],"$")<>0 And StringInStr($RightArray[$g],"[")<>0 And StringInStr($RightArray[$g],"]")<>0 Then
  184.     $Ok=1
  185. Else
  186.     $Ok=0
  187. EndIf
  188. Next
  189. EndIf
  190.  
  191. $RightArray=_StringBetween($arrays[$i],'"','"')
  192. if IsArray($RightArray) Then
  193. For $g=0 To UBound($RightArray)-1
  194. if StringInStr($RightArray[$g],"$")<>0 And StringInStr($RightArray[$g],"[")<>0 And StringInStr($RightArray[$g],"]")<>0 Then
  195.     $Ok=1
  196. Else
  197.     $Ok=0
  198. EndIf
  199. Next
  200. EndIf
  201.  
  202. $arra=_StringBetween($arrays[$i],"[","]")
  203. If IsArray($arra) and StringRegExp($arra[0],"(\d*)") and StringInStr($arra[0],"$")=0 And $Ok=1 Then
  204.  
  205. If StringRegExp($arrays[$i],"["&$arra[0]&"]") Then
  206.  
  207. If BitAND(GUICtrlRead ($Variblen_Checkbox),$GUI_CHECKED)=1 Then
  208. $obfus=Chr($salt)&"_"&Chr($salt)&Hash($arra[0],$key,$hash)
  209. Else
  210. $obfus="_"&Chr($salt)&$arra[0]&Chr($salt)
  211. EndIf
  212.  
  213. $arrays[$i]=StringReplace($arrays[$i],"["&$arra[0]&"]","["&"$"&$obfus&"]",1)
  214.  
  215. If BitAND(GUICtrlRead ($Variblen_Checkbox),$GUI_CHECKED)=1 Then
  216. _ArrayAdd($arrays,"Global $"&$obfus)
  217. _ArrayAdd($arrays,"Assign('"&$obfus&"', '"&$arra[0]&"')")
  218. Else
  219. _ArrayAdd($arrays,"Global $"&$obfus)
  220. _ArrayAdd($arrays,"Assign('"&$obfus&"', '"&$arra[0]&"')")
  221. EndIf
  222. EndIf
  223. EndIf
  224. EndIf
  225. $prozent=$i/UBound($arrays)*100
  226. ProgressSet($prozent,"Arrays become obfuscated")
  227. Next
  228. _ArrayAdd($arrays,"Endfunc")
  229. _FileWriteFromArray($file2,$arrays)
  230. endfunc
  231.  
  232.  
  233.  
  234.  
  235.  
  236. Func IncludesEinbinden()
  237. $i=0
  238. $includes=""
  239. $prozent=0
  240. $String=""
  241. For $hiu=0 To 1
  242. $i=0
  243. $read=FileRead($file)
  244. $read=StringStripWS ($read,8)
  245.  
  246. While StringRegExp($read,"#include<(\w+)")=1 or StringRegExp($read,'#include"(\w+)')=1
  247. $String=""
  248. $read=FileRead($file)
  249. $read=StringStripWS ($read,8)
  250. If StringInStr($read,"#include")<>0 Then
  251. $SplitDatei=StringSplit($file,"\")
  252. For $a=1 To $SplitDatei[0]-1
  253. $String=$String&$SplitDatei[$a]&"\"
  254. Next
  255. $read=StringStripWS ($read,8)
  256. If StringRegExp($read,"#include<")=1 Then
  257. $between=_StringBetween ($read,"#include<",">")
  258. Else
  259. $between=_StringBetween ($read,'#include"','"')
  260. EndIf
  261. If IsArray($between) Then
  262. $String=$String&$between[0]
  263. $String=StringReplace($String,">","")
  264. $String=StringReplace($String,'"',"")
  265. If FileExists($String) Then
  266. $read=StringReplace($read,$between[0],FileRead($String))
  267. Else
  268. If FileExists(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir")&"\Include\String.au3") Then
  269. $read=StringStripWS ($read,8)
  270.     $String=StringReplace($String,"<","")
  271.     $file3=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir")&"\Include\"&$between[0]
  272.     if FileExists($file3)=0 Then
  273.         $file3=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir")&"\Include\"&_StringProper($between[0])
  274.     Else
  275.     $read=StringStripWS ($read,8)
  276.     $between[0]=StringStripWS($between[0],8)
  277.     if FileExists($file3) Then
  278.     If StringInStr($includes,$between[0])=0 Then
  279.     $includes=$includes&" "&$between[0]
  280.     _ReplaceStringInFile($file,"#include<"&$between[0]&">",FileRead($file3),0,0)
  281.     _ReplaceStringInFile($file,"#include <"&$between[0]&">",FileRead($file3),0,0)
  282.     _ReplaceStringInFile($file,"#include  <"&$between[0]&">",FileRead($file3),0,0)
  283.     _ReplaceStringInFile($file,'#include"'&$between[0]&'"',FileRead($file3),0,0)
  284.     _ReplaceStringInFile($file,'#include "'&$between[0]&'"',FileRead($file3),0,0)
  285.     _ReplaceStringInFile($file,'#include  "'&$between[0]&'"',FileRead($file3),0,0)
  286.     _ReplaceStringInFile($file,'#include-once',"")
  287.     $i=$i+1
  288.     Else
  289.  
  290.  
  291.     _ReplaceStringInFile($file,"#include<"&$between[0]&">","")
  292.     _ReplaceStringInFile($file,"#include <"&$between[0]&">","")
  293.     _ReplaceStringInFile($file,"#include  <"&$between[0]&">","")
  294.     _ReplaceStringInFile($file,'#include"'&$between[0]&'"',"")
  295.     _ReplaceStringInFile($file,'#include "'&$between[0]&'"',"")
  296.     _ReplaceStringInFile($file,'#include  "'&$between[0]&'"',"")
  297.     _ReplaceStringInFile($file,'#include-once',"")
  298.     $i=$i+1
  299. EndIf
  300. EndIf
  301. _ArrayDelete($between,0)
  302. EndIf
  303. EndIf
  304. EndIf
  305. EndIf
  306. Else
  307. $read2=$read
  308. EndIf
  309.  
  310.  
  311. $counter=StringRegExp($read,"#include<(\w+)",3)
  312. $counter2=StringRegExp($read,'#include"(\w+)',3)
  313. $gesamt=$i+UBound($counter)+UBound($counter2)
  314. $prozent=($i/$gesamt)*100
  315. ProgressSet($prozent,"Includes intergrate "&@CRLF&"Rest Includes "&UBound($counter))
  316.  
  317. WEnd
  318. Next
  319. $read=FileRead($file)
  320. _FileCreate($file)
  321. FileClose($file)
  322. FileWrite($file,$read)
  323. EndFunc
  324.  
  325.  
  326.  
  327.  
  328. Func KommentareEntfernen()
  329. _FileReadToArray($file,$kommentar)
  330.  
  331.  
  332. $grose=UBound($kommentar)-1
  333. For $i=1 to $grose
  334. $prozent=$i/$grose*100
  335. ProgressSet($prozent,"Comments are removed "&@CRLF&"current line: "&$i&" of "&$grose)
  336. If $grose<>$i Then
  337. If $kommentar[$i]="" or $kommentar[$i]=" " Then
  338. _ArrayDelete($kommentar,$i)
  339. $grose=$grose-1
  340. $i=$i-1
  341. EndIf
  342. if StringInStr(StringStripWS($kommentar[$i],8),";")= 1 Then
  343. ;~ _ReplaceStringInFile($file,$kommentar[$i],"",1,0)
  344. _ArrayDelete($kommentar,$i)
  345. $grose=$grose-1
  346. $i=$i-1
  347. Else
  348. if StringInStr(StringStripWS($kommentar[$i],8),";~")= 1 Then
  349. _ArrayDelete($kommentar,$i)
  350. $grose=$grose-1
  351. $i=$i-1
  352. endif
  353. endif
  354.  
  355.  
  356.  
  357. If StringInStr($kommentar[$i],"#cs",1)=1 Then
  358. do
  359. _ArrayDelete($kommentar,$i)
  360. $grose=$grose-1
  361. Until $i=$grose-2 or StringRegExp($kommentar[$i],"#ce")
  362. If StringRegExp($kommentar[$i],"#ce") Then
  363. _ArrayDelete($kommentar,$i)
  364. $i=$i-1
  365. $grose=$grose-1
  366. EndIf
  367. EndIf
  368.  
  369. If StringInStr($kommentar[$i],";")<>0 Then
  370.     $komm2=StringStripWS($kommentar[$i],8)
  371.     $aaaa=0
  372.     $len=StringLen($kommentar[$i])
  373.     Do
  374.         $aaaa+=1
  375.         $komm3=StringRight ($komm2,$aaaa)
  376.         If $len<=$aaaa Then ExitLoop
  377.     Until StringInStr(StringStripWS($komm3,8),"$")=1 And(StringInStr(StringStripWS($komm3,8),");")=1 Or StringInStr(StringStripWS($komm3,8),'";')=1)
  378.     If $len>$aaaa Then
  379.     $kommentar[$i]=StringTrimRight($kommentar[$i],$aaaa)
  380.     EndIf
  381. EndIf
  382.  
  383. If StringInStr(StringStripWS($kommentar[$i],8),"EndFunc;",2)=1 Then
  384. $kommentar[$i]="EndFunc"
  385. Endif
  386.  
  387.  
  388. Else
  389. ExitLoop
  390. EndIf
  391. Next
  392.  
  393. _FileCreate($file)
  394. FileClose($file)
  395. _FileWriteFromArray($file,$kommentar,1)
  396.  
  397.  
  398.  
  399. EndFunc
  400.  
  401.  
  402.  
  403.  
  404. Func Obfuscate() ;---> Function Obfuscate()
  405. ProgressOn("Obfuscate","progress:")
  406. $save=FileRead($file)
  407. $file4=StringTrimRight($file,4)&"-backup.au3"
  408. _FileCreate($file4)
  409. FileClose($file4)
  410. FileWrite($file4,$save)
  411.  
  412. KommentareEntfernen()
  413. $prozent=0
  414. ProgressSet($prozent)
  415. if BitAND(GUICtrlRead ($Includes_Checkbox),$GUI_CHECKED)=1 Then
  416. IncludesEinbinden()
  417. EndIf
  418. $hash=_GUICtrlComboBox_GetCurSel($Hash_Combobox)
  419. #Region FileOpen
  420. Dim $functions[1]
  421. If $file="" or $file=1 Then
  422. Exit
  423. EndIf
  424. $schlussel=GUICtrlRead($Schlussel_Input)
  425. #EndRegion
  426.  
  427. #Region File erstellen
  428. $file2=StringTrimRight($file,4)
  429. $file2=$file2&"-obfuscated.au3"
  430. _FileCreate($file2)
  431. FileClose($file2)
  432. #EndRegion
  433.  
  434. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  435. If StringInStr(FileRead($file),"Func Quersumme($zahl)"&@CRLF&"local $split")=0 Then
  436. $befehl=@CRLF & _
  437. "Func Quersumme($zahl)" &@CRLF & _
  438. 'local $split=StringSplit($zahl,"")'&@CRLF & _
  439. "$zahl=0"&@CRLF & _
  440. "For $i=1 To UBound($split)-1"&@CRLF & _
  441. "$zahl=$zahl+$split[$i]"&@CRLF & _
  442. "Next"&@CRLF & _
  443. "return $zahl"&@CRLF & _
  444. "EndFunc"
  445. FileWrite($file,$befehl)
  446. EndIf
  447. EndIf
  448. #Region Search for functions and add to array $ functions (will be needed later)
  449.  
  450. KommentareEntfernen()
  451. for $i=0 to _FileCountLines($file)
  452. $prozent=($i/_FileCountLines($file))*100
  453. ProgressSet($prozent,"Functions are searched")
  454. $prozent=0
  455. $read=FileReadLine($file,$i)
  456. $read=StringStripWS ($read,1)
  457. If IsArray(_StringBetween($read,"func" & chr(32),"(")) Then
  458.     $temp = _StringBetween($read,"func" & chr(32),"(")
  459.     $temp[0]=StringStripWS($temp[0],8)
  460.     _ArrayAdd($functions,$temp[0]&"(")
  461. ;~  $temp2=_StringBetween($read,"func","(")
  462. ;~  $temp2=StringStripWS ($temp2,8)
  463. ;~  StringReplace($temp2&"(",$temp2&"("," _" & Hash($temp[0],$schlussel,$hash)&"(")
  464.  
  465. If IsArray($functions) Then
  466. If $functions[0]="" or $functions[0]=" " Then
  467. _ArrayDelete($functions,0)
  468. EndIf
  469. EndIf
  470. EndIf
  471. #EndRegion
  472. #Region Variables are replaced with hash
  473. $befehl=$read
  474. $read = $read&";"
  475.     If StringRegExp($read,"(.*\x24\w+.*)") == 1 Then
  476.         $temp = StringRegExp($read,"(\x24\w*)",3)
  477.     if BitAND(GUICtrlRead ($Variblen_Checkbox),$GUI_CHECKED)=1 Then
  478.         For $a = 0 to UBound($temp) -1 Step 1
  479.             $temp[$a] = StringTrimLeft($temp[$a],1)
  480.                     $read = StringRegExpReplace($read,"\x24" & $temp[$a] & "(\W)","$_" & Hash($temp[$a],$schlussel,$hash)& "\1",$hash)
  481.         $prozent=($a/UBound($temp))*100-1
  482.         ProgressSet($prozent,"Variables are hashed")
  483.         Next
  484.     EndIf
  485.         EndIf
  486. $read=StringTrimRight($read,1)
  487.  
  488. FileWrite($file2,$read&@CRLF)
  489. Next
  490. #EndRegion
  491. #Region Functions throughout the script that are in the $ functions array are now replaced by hashes throughout the script
  492. FileOpen($file2,1)
  493. $read=FileRead($file2)
  494. $read=StringStripWS ($read,2)
  495. _filecreate($file2)
  496. FileClose($file2)
  497.  
  498. if BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  499. For $hj = 0 to UBound($functions) -1 Step 1
  500.     $prozent=int(($hj/UBound($functions))*100)
  501.     ProgressSet($prozent,"Functions are replaced by hashes")
  502.     If $functions[0]<>"" and $functions[0]<>" " Then
  503. ;~      $read = StringReplace($read ,$functions[$hj],"_" & Hash($functions[$hj],$schlussel,$hash)&"(")
  504.         $read=StringReplace($read," (","(")
  505.         $read = StringReplace($read ,$functions[$hj],"_" & Hash($functions[$hj],$schlussel,$hash)&"(")
  506.         $read = StringReplace($read ,"'"&StringTrimRight($functions[$hj],1)&"'","'"&"_" & Hash($functions[$hj],$schlussel,$hash)&"'")
  507.         $read = StringReplace($read ,'"'&StringTrimRight($functions[$hj],1)&'"','"'&"_" & Hash($functions[$hj],$schlussel,$hash)&'"')
  508.  
  509.     EndIf
  510. Next
  511. EndIf
  512. FileWrite($file2,$read)
  513.  
  514.  
  515. #EndRegion
  516. #Region Die restlichen AutoIT Befehle werden ersetzt
  517. Dim $read[_FileCountLines($file2)+3]
  518. for $i=0 to _FileCountLines($file2)
  519. $read[$i]=FileReadLine($file2,$i)
  520. Next
  521. $count=_FileCountLines($file2)
  522. $splitstring=""
  523. $write=""
  524. $read4=FileRead($file2)
  525.  
  526. #Region Strings are replaced by variables
  527. If BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  528. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1  Then
  529. _ArrayAdd($read,"Func _"&Chr($salt)&Hash(Chr($salt)&'_Variable1Definition2Function3',$schlussel,$hash)&"()")
  530. Else
  531. _ArrayAdd($read,"Func _"&Chr($salt)&"_"&Chr($salt)&'_Variable_Definition_Function'&"()")
  532. EndIf
  533. $count=_FileCountLines($file2)
  534. for $i=0 to $count
  535. $splitstring=""
  536. $prozent=int(($i/$count)*100)
  537. ProgressSet($prozent,"Strings are replaced by variables")
  538.  
  539.  
  540. For $iiii=0 To 1
  541. $temp3=StringInStr($read[$i],"'")
  542. $temp4=StringInStr($read[$i],'"')
  543.  
  544.  
  545.  
  546. If $temp4 < $temp3 Or $temp3=0 Then
  547. $betw=_StringBetween($read[$i],'"','"')
  548. ElseIf $temp3 < $temp4 Or $temp4=0 Then
  549. $betw=_StringBetween($read[$i],"'","'")
  550. EndIf
  551.  
  552.  
  553. ;~  ProgressOff()
  554. ;~ MsgBox(0,"test","Read : "&$read[$i]&@CRLF&"Temp4 : "&$temp4&@CRLF&"Temp3 : "&$temp3)
  555.  
  556. if IsArray($betw) Then
  557.  
  558. if $betw[0]<>"" and StringLen($betw[0])<400 Then
  559. $betw2=StringStripWS($betw[0],8)
  560. $betw2=StringRegExpReplace ($betw2, "(\W)",$i&chr($salt))
  561.  
  562. $var4="$"&Chr($salt)&"_"&Hash(Chr($salt)&$betw2&'_constCharString1',$schlussel,3)
  563. _ArrayAdd($read,"Global "&$var4)
  564. If $temp4 > $temp3 Then
  565. _ArrayAdd($read,'Assign("'&StringTrimLeft($var4,1)&'", "'&$betw[0]&'")')
  566. Else
  567. _ArrayAdd($read,"Assign('"&StringTrimLeft($var4,1)&"', '"&$betw[0]&"')")
  568. EndIf
  569.  
  570.  
  571.  
  572. If $temp4 < $temp3 Or $temp3=0 Then
  573. $read[$i]=StringReplace($read[$i],'"'&$betw[0]&'"'," "&$var4&" ")
  574. ;~ MsgBox(0,"test",'"'&$betw[0]&'"')
  575. ElseIf $temp3 < $temp4 Or $temp4=0 Then
  576.     $read[$i]=StringReplace($read[$i],"'"&$betw[0]&"'"," "&$var4&" ")
  577.     ;~ MsgBox(0,"test","'"&$betw[0]&"'")
  578. EndIf
  579.  
  580.  
  581.  
  582. EndIf
  583.  
  584. EndIf
  585. next
  586. $count=_FileCountLines($file2)
  587. Next
  588. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  589. _ArrayInsert($read,2,"_"&Chr($salt)&Hash(Chr($salt)&'_Variable1Definition2Function3',$schlussel,$hash)&"()")
  590. Else
  591. _ArrayInsert($read,2,"_"&Chr($salt)&"_"&Chr($salt)&'_Variable_Definition_Function'&"()")
  592. EndIf
  593.  
  594. _ArrayAdd($read,"EndFunc")
  595. _FileWriteFromArray($file2,$read,1)
  596. EndIf
  597. #EndRegion
  598.  
  599. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  600. ArrayObfuscate()
  601. EndIf
  602.  
  603.  
  604. ReDim $read[_FileCountLines($file2)+3]
  605. for $i=0 to _FileCountLines($file2)
  606. $read[$i]=FileReadLine($file2,$i)
  607. Next
  608.  
  609. $prozent=$prozent+10
  610. $cou=_FileCountLines($file2)
  611. _ArrayDelete($read,0)
  612. _ArrayDelete($read,0)
  613. _filecreate($file2)
  614. FileOpen($file2,1)
  615. for $i=0 to $cou
  616. $prozent=($i/$cou)*100
  617. ProgressSet($prozent,"AutoIT commands are obfuscated")
  618. $read[$i]=StringStripWS ($read[$i],4)
  619. $befehl=$read[$i]&@CRLF
  620. $split=StringSplit($read[$i],"")
  621. If $split[0]>=4 Then
  622. $test=$split[1]&$split[2]&$split[3]&$split[4]
  623. If ($split[1] <> "$") and ($split[1]&$split[2] <> "if") and $split[1] <> "" and $split[1] <> "#" and $split[1] <> ";" and $test<>"case" and $test<>"func" and $test<>"next" and $test<>"whil" and ($split[1]&$split[2]&$split[3]<>"for") and  $test<>"sele" and  $test<>"swit" and $test<>"ends" and $test<>"endi" and $test<>"endf" and $test<>"unti" and $test<>"else" and $test<>"redi" and $test<>"dim " and $test<>"loca" and $test<>"glob" and $test<>"exit" and $test<>"wend" and $test<>"retu" Then
  624.  
  625.  
  626. If StringinStr($read[$i],",_")<>0 Or StringinStr($read[$i]," _")<>0 Or StringinStr($read[$i],"&_")<>0 Or StringLen($read[$i])>400 Then
  627. $befehl=$read[$i]&@CRLF
  628. Else
  629.  
  630. $var2=StringToBinary($read[$i])
  631. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  632. $var2=StringReplace($var2,"3",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  633. $var2=StringReplace($var2,"1",'"&Stringlen("'&chr(Random(97,122,1))&'")&"',Random(1,3,1))
  634. $var2=StringReplace($var2,"2",'"&Stringlen("'&chr(Random(97,122,1))&chr(Random(65,90,1))&'")&"',Random(2,4,1))
  635. $var2=StringReplace($var2,"7",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,5,1))
  636. $var2=StringReplace($var2,"4",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  637.  
  638.  
  639.  
  640.  
  641. $if=random(0,4,1)
  642. If $if=0 Then
  643. $ran=Random(10,99,1)
  644. $test=BitXOR(8,$ran)
  645. $var3=StringTobinary('BitXOR('&$test&','&$ran&')')
  646. $var2=StringReplace($var2,"8",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"',Random(2,6,1))
  647. ElseIf $if=1 Then
  648. If ($split[1] <> "$") Then
  649. $ran1=Random(1,10,1)
  650. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  651. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  652. Else
  653. $var2=StringReplace($var2,"4",'"&Execute("'&" Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  654. EndIf
  655. EndIf
  656. Elseif $if=2 Then
  657. $ran5=Random(1,100000)
  658. $var3=StringTobinary('int(Cos(Sin ('&$ran5&'))^-1)')
  659. $var2=StringReplace($var2,"1",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"')
  660. Elseif $if=3 Then
  661. If ($split[1] <> "$") Then
  662. $ran1=Random(1,10,1)
  663. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  664. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  665. Else
  666. $var2=StringReplace($var2,"4",'"&Execute("'&" Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  667. EndIf
  668. EndIf
  669. Else
  670. $var2ran1=Random(1,9,1)
  671. $var2ran2=Random(1,9,1)
  672. $var2=StringReplace($var2,"8",'"&('&$var2ran1&'+'&$var2ran2&')^2-'&($var2ran2+$var2ran1)^2-8&'&"',Random(1,3,1))
  673. EndIf
  674. $var2=StringReplace($var2,'&""&',"&")
  675. EndIf
  676. if BitAND(GUICtrlRead ($AutoITBefehleObfuscaten_Checkbox),$GUI_CHECKED)=1 Then
  677. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  678. If StringLen($var2)<35 Then
  679. $var2=StringToBinary('Execute('&"'"&'BinaryToString("'&$var2&'")'&"'"&')')
  680. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  681. $var2=StringReplace($var2,"3",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  682. $var2=StringReplace($var2,"1",'"&Stringlen("'&chr(Random(97,122,1))&'")&"',Random(1,3,1))
  683. $var2=StringReplace($var2,"2",'"&Stringlen("'&chr(Random(97,122,1))&chr(Random(65,90,1))&'")&"',Random(2,4,1))
  684. $var2=StringReplace($var2,"7",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,5,1))
  685. $var2=StringReplace($var2,"4",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  686.  
  687. $if=random(0,4,1)
  688. If $if=0 Then
  689. $ran=Random(10,99,1)
  690. $test=BitXOR(8,$ran)
  691. $var3=StringTobinary('BitXOR('&$test&','&$ran&')')
  692. $var2=StringReplace($var2,"8",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"',Random(2,6,1))
  693. ElseIf $if=1 Then
  694. If ($split[1] <> "$") Then
  695. $ran1=Random(1,10,1)
  696. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  697. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  698. Else
  699. $var2=StringReplace($var2,"4",'"&Execute("'&"Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  700. EndIf
  701. EndIf
  702. Elseif $if=2 Then
  703. $ran5=Random(1,100000)
  704. $var3=StringTobinary('int(Cos(Sin ('&$ran5&'))^-1)')
  705. $var2=StringReplace($var2,"1",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"')
  706. Elseif $if=3 Then
  707. If ($split[1] <> "$") Then
  708. $ran1=Random(1,10,1)
  709. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  710. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  711. Else
  712. $var2=StringReplace($var2,"4",'"&Execute("'&" Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  713. EndIf
  714. EndIf
  715. Else
  716. $var2ran1=Random(1,9,1)
  717. $var2ran2=Random(1,9,1)
  718. $var2=StringReplace($var2,"8",'"&('&$var2ran1&'+'&$var2ran2&')^2-'&($var2ran2+$var2ran1)^2-8&'&"',Random(1,3,1))
  719. EndIf
  720. $var2=StringReplace($var2,'&""&',"&")
  721. EndIf
  722. EndIf
  723. EndIf
  724. $befehl=StringReplace($read[$i],$read[$i],'Execute(BinaryToString("'&$var2&'"))'&@CRLF)
  725.  
  726.  
  727. EndIf
  728. EndIf
  729. Else
  730. If ($split[1]&$split[2] <> "if") and $test<>"case" and $split[1] <> "" and $split[1] <> "#" and $split[1] <> ";"and $test<>"func" and $test<>"next" and $test<>"whil" and ($split[1]&$split[2]&$split[3]<>"for") and  $test<>"sele" and  $test<>"swit" and $test<>"ends" and $test<>"endi" and $test<>"endf" and $test<>"unti" and $test<>"else" and $test<>"redi" and $test<>"dim " and $test<>"loca" and $test<>"glob" and $test<>"exit" and $test<>"wend" and $test<>"retu" Then
  731. If StringRegExp($read[$i],"=")=1  Then
  732. If StringinStr($read[$i],",_")<>0 Or StringinStr($read[$i],"&_")<>0 Or StringinStr($read[$i]," _")<>0 Or StringLen($read[$i])>1600 Then
  733. $befehl=$read[$i]&@CRLF
  734. Else
  735. $StringSplit=StringSplit($read[$i],"=")
  736. $var2=StringToBinary($StringSplit[2])
  737. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  738. $var2=StringReplace($var2,"3",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  739. $var2=StringReplace($var2,"1",'"&Stringlen("'&chr(Random(97,122,1))&'")&"',Random(1,3,1))
  740. $var2=StringReplace($var2,"2",'"&Stringlen("'&chr(Random(97,122,1))&chr(Random(65,90,1))&'")&"',Random(2,4,1))
  741. $var2=StringReplace($var2,"7",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,5,1))
  742. $var2=StringReplace($var2,"4",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  743.  
  744. $if=random(0,4,1)
  745. If $if=0 Then
  746. $ran=Random(10,99,1)
  747. $test=BitXOR(8,$ran)
  748. $var3=StringTobinary('BitXOR('&$test&','&$ran&')')
  749. $var2=StringReplace($var2,"8",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"',Random(2,6,1))
  750. ElseIf $if=1 Then
  751. If ($split[1] <> "$") Then
  752. $ran1=Random(1,10,1)
  753. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  754. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  755. Else
  756. $var2=StringReplace($var2,"4",'"&Execute("'&"Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  757. EndIf
  758. EndIf
  759. Elseif $if=2 Then
  760. $ran5=Random(1,100000)
  761. $var3=StringTobinary('int(Cos(Sin ('&$ran5&'))^-1)')
  762. $var2=StringReplace($var2,"1",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"')
  763. Elseif $if=3 Then
  764. If ($split[1] <> "$") Then
  765. $ran1=Random(1,10,1)
  766. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  767. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  768. Else
  769. $var2=StringReplace($var2,"4",'"&Execute("'&" Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  770. EndIf
  771. EndIf
  772. Else
  773. $var2ran1=Random(1,9,1)
  774. $var2ran2=Random(1,9,1)
  775. $var2=StringReplace($var2,"8",'"&('&$var2ran1&'+'&$var2ran2&')^2-'&($var2ran2+$var2ran1)^2-8&'&"',Random(1,3,1))
  776. EndIf
  777. $var2=StringReplace($var2,'&""&',"&")
  778. EndIf
  779.  
  780. if BitAND(GUICtrlRead ($AutoITBefehleObfuscaten_Checkbox),$GUI_CHECKED)=1 Then
  781. If StringinStr($read[$i],",_")<>0 Or StringinStr($read[$i],"&_")<>0  Then
  782. $befehl=$read[$i]&@CRLF
  783. Else
  784. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  785. If StringLen($var2)< 35 Then
  786.  
  787. $var2=StringToBinary('Execute('&"'"&'BinaryToString("'&$var2&'")'&"'"&')')
  788. if BitAND(GUICtrlRead ($AutoITStarkObfuscate_Checkbox),$GUI_CHECKED)=1 Then
  789. $var2=StringReplace($var2,"3",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  790. $var2=StringReplace($var2,"1",'"&Stringlen("'&chr(Random(97,122,1))&'")&"',Random(1,3,1))
  791. $var2=StringReplace($var2,"2",'"&Stringlen("'&chr(Random(97,122,1))&chr(Random(65,90,1))&'")&"',Random(2,4,1))
  792. $var2=StringReplace($var2,"7",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,5,1))
  793. $var2=StringReplace($var2,"4",'"&Stringlen("'&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&chr(Random(65,90,1))&'")&"',Random(1,3,1))
  794. $if=random(0,4,1)
  795. If $if=0 Then
  796. $ran=Random(10,99,1)
  797. $test=BitXOR(8,$ran)
  798. $var3=StringTobinary('BitXOR('&$test&','&$ran&')')
  799. $var2=StringReplace($var2,"8",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"',Random(2,6,1))
  800. ElseIf $if=1 Then
  801. If ($split[1] <> "$") Then
  802. $ran1=Random(1,10,1)
  803. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  804. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  805. Else
  806. $var2=StringReplace($var2,"4",'"&Execute("'&"Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  807. EndIf
  808. EndIf
  809. Elseif $if=2 Then
  810. $ran5=Random(1,100000)
  811. $var3=StringTobinary('int(Cos(Sin ('&$ran5&'))^-1)')
  812. $var2=StringReplace($var2,"1",""&'"'&"&Execute(Binarytostring('"&$var3&"'))&"&'"')
  813. Elseif $if=3 Then
  814. If ($split[1] <> "$") Then
  815. $ran1=Random(1,10,1)
  816. If BitAND(GUICtrlRead ($Funktionen_Checkbox),$GUI_CHECKED)=1 Then
  817. $var2=StringReplace($var2,"4",'"&Execute("_'&Hash("Quersumme(",$schlussel,$hash)&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  818. Else
  819. $var2=StringReplace($var2,"4",'"&Execute("'&"Quersumme"&'('&$ran1&'*9)-5")&"',Random(1,4,1))
  820. EndIf
  821. EndIf
  822. Else
  823. $var2ran1=Random(1,9,1)
  824. $var2ran2=Random(1,9,1)
  825. $var2=StringReplace($var2,"8",'"&('&$var2ran1&'+'&$var2ran2&')^2-'&($var2ran2+$var2ran1)^2-8&'&"',Random(1,3,1))
  826. EndIf
  827. $var2=StringReplace($var2,'&""&',"&")
  828. EndIf
  829. EndIf
  830. EndIf
  831. $read[$i]=$StringSplit[1]&"="&StringReplace($StringSplit[2],$StringSplit[2],'Execute(BinaryToString("'&$var2&'"))')
  832. EndIf
  833. EndIf
  834. EndIf
  835. Else
  836. $befehl=$read[$i]&@crlf
  837. EndIf
  838. EndIf
  839. $befehl=$read[$i]&@crlf
  840. EndIf
  841. If ($split[1] = ";") Then
  842. $befehl=StringReplace($read[$i],$read[$i],"")
  843. EndIf
  844. Else
  845. $befehl=$read[$i]&@crlf
  846. EndIf
  847. FileWrite($file2,$befehl)
  848.  
  849.  
  850. If StringinStr($read[$i],",_")<>0 or StringinStr($read[$i],"&_")<>0 or StringinStr($read[$i]," _")<>0 Then
  851. do
  852. $i=$i+1
  853. $befehl=$read[$i]&@CRLF
  854. FileWrite($file2,$befehl)
  855. Until (StringinStr($read[$i],",_")=0 and StringinStr($read[$i],"&_")=0 and StringinStr($read[$i]," _")=0) or $i=UBound($read)-1
  856. EndIf
  857.  
  858. #EndRegion
  859. Next
  860. FileWrite($file2,$befehl)
  861. FileClose($file2)
  862. FileClose($file)
  863. ProgressOff()
  864. MsgBox(0,"Finished","Obfuscation succesed")
  865. EndFunc ;---> Funktionsende Obfuscate()
  866.  
  867.  
  868. Func Hash($var,$key="Thunder",$hash=0) ;---> Funktionsanfang Hash($var,$key,$hash)
  869. $var=chr($salt)&"_"&chr($salt)&$var&chr($salt)
  870. $String=$var
  871.  
  872. If $hash=0 Then
  873. $String=ShadowHash($var,$key)
  874. ElseIf $hash=1 Then
  875. $String=_RC4($var, $key)
  876. ElseIf $hash=2 Then
  877. $String=_CRC32($var)
  878. ElseIf $hash=3 Then
  879. $String=_MD5($var)
  880. ElseIf $hash=4 Then
  881. $String=_MD5($var)
  882. $String=_RC4($String, $key)
  883. ElseIf $hash=5 Then
  884. $String=_MD5($var)
  885. $String=_CRC32($String)
  886. ElseIf $hash=6 Then
  887. $String=ShadowHash($var,$key)
  888. $String=_RC4($String, $key)
  889. ElseIf $hash=7 Then
  890. $String=_CRC32($var)
  891. $String=_RC4($String, $key)
  892. ElseIf $hash=8 Then
  893. $String=_CRC32($var)
  894. $String=ShadowHash($String,$key)
  895. $String=_RC4($String, $key)
  896. $String=_MD5($String)
  897.  
  898. EndIf
  899.  
  900. $String=Chr($salt)&$String
  901. Return $String
  902. EndFunc ;---> Funktionsende Hash($var,$key,$hash)
  903.  
  904. Func ShadowHash($var,$key)
  905.     $StrSpl=StringSplit($var,"")
  906.     $String=0
  907.     $tes=0
  908.     $StrSpl2=StringSplit($key,"")
  909. For $c=1 To $StrSpl2[0]-1
  910.     $tes=$tes+Asc($StrSpl2[$c])
  911. Next
  912. For $b=1 To $StrSpl[0]-1
  913.     $StrSpl[$b]=Asc($StrSpl[$b])
  914.     $String=BitXOr(BitXOR(($String+BitXOR(Mod($StrSpl[$b]^$b,$b^$StrSpl[$b]),(5^0.5-1)/2))*Int($b/2),$StrSpl[$b]),1+((5^0.5-1)/2))-(($StrSpl2[0]+$tes+$salt2))
  915. next
  916. If $StrSpl[1]="a" or $StrSpl[1]="e" or $StrSpl[1]="u" or $StrSpl[1]="i" Then $String=$String&$tes
  917. $String=_StringToHex($String)
  918. $String="DE"&$String&"DE"
  919. Return $String
  920. EndFunc
  921.  
  922. #Region Hashfunctions made by Ward (http://www.autoitscript.com/forum)
  923. Func _RC4($Data, $Key)
  924.     Local $Opcode = "0xC81001006A006A005356578B551031C989C84989D7F2AE484829C88945F085C00F84DC000000B90001000088C82C0188840DEFFEFFFFE2F38365F4008365FC00817DFC000100007D478B45FC31D2F775F0920345100FB6008B4DFC0FB68C0DF0FEFFFF01C80345F425FF0000008945F48B75FC8A8435F0FEFFFF8B7DF486843DF0FEFFFF888435F0FEFFFFFF45FCEBB08D9DF0FEFFFF31FF89FA39550C76638B85ECFEFFFF4025FF0000008985ECFEFFFF89D80385ECFEFFFF0FB6000385E8FEFFFF25FF0000008985E8FEFFFF89DE03B5ECFEFFFF8A0689DF03BDE8FEFFFF860788060FB60E0FB60701C181E1FF0000008A840DF0FEFFFF8B750801D6300642EB985F5E5BC9C21000"
  925.     Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]")
  926.     DllStructSetData($CodeBuffer, 1, $Opcode)
  927.  
  928.     Local $Buffer = DllStructCreate("byte[" & BinaryLen($Data) & "]")
  929.     DllStructSetData($Buffer, 1, $Data)
  930.  
  931.     DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
  932.                                                     "ptr", DllStructGetPtr($Buffer), _
  933.                                                     "int", BinaryLen($Data), _
  934.                                                     "str", $Key, _
  935.                                                     "int", 0)
  936.  
  937.     Local $Ret = DllStructGetData($Buffer, 1)
  938.     $Buffer = 0
  939.     $CodeBuffer = 0
  940.     Return $Ret
  941. EndFunc
  942.  
  943. Func _CRC32($Data, $CRC32 = -1)
  944.     Local $Opcode = '0xC800040053BA2083B8EDB9000100008D41FF516A0859D1E8730231D0E2F85989848DFCFBFFFFE2E78B5D088B4D0C8B451085DB7416E3148A1330C20FB6D2C1E80833849500FCFFFF43E2ECF7D05BC9C21000'
  945.  
  946.     Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]")
  947.     DllStructSetData($CodeBuffer, 1, $Opcode)
  948.  
  949.     Local $Input = DllStructCreate("byte[" & BinaryLen($Data) & "]")
  950.     DllStructSetData($Input, 1, $Data)
  951.  
  952.     Local $Ret = DllCall("user32.dll", "uint", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
  953.                                                     "ptr", DllStructGetPtr($Input), _
  954.                                                     "int", BinaryLen($Data), _
  955.                                                     "uint", $CRC32, _
  956.                                                     "int", 0)
  957.  
  958.     $Input = 0
  959.     $CodeBuffer = 0
  960.  
  961. Return $Ret[0]
  962. EndFunc
  963.  
  964. Func _MD5($Data)
  965.     Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($_MD5Opcode) & "]")
  966.     DllStructSetData($CodeBuffer, 1, $_MD5Opcode)
  967.  
  968.     Local $Input = DllStructCreate("byte[" & BinaryLen($Data) & "]")
  969.     DllStructSetData($Input, 1, $Data)
  970.  
  971.     Local $Digest = DllStructCreate("byte[16]")
  972.  
  973.     DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
  974.                                                     "ptr", DllStructGetPtr($Input), _
  975.                                                     "int", BinaryLen($Data), _
  976.                                                     "ptr", DllStructGetPtr($Digest), _
  977.                                                     "int", 0)
  978.  
  979.     Local $Ret = DllStructGetData($Digest, 1)
  980.     $Input = 0
  981.     $Digest = 0
  982.     $CodeBuffer = 0
  983.     Return $Ret
  984. EndFunc
  985. #EndRegion
  986.  
  987. Func _StringBetweenReplace($string,$start,$end,$replacestring,$replace_times=0,$casesensitive=0)
  988.     If $casesensitive=0 Then
  989.         $casesensitive_between=-1
  990.     Else
  991.         $casesensitive_between=$casesensitive
  992.     EndIf
  993.     $string_found=_StringBetween($string,$start,$end,$casesensitive_between)
  994.     If IsArray($string_found) Then
  995.         $string_end=StringReplace($string,$string_found[0],$replacestring,$replace_times,$casesensitive)
  996.     Else
  997.         $string_end=-1
  998.     EndIf
  999.     Return $string_end
  1000. EndFunc
  1001.  
  1002. Func Ende()
  1003.     Exit
  1004. EndFunc
  1005. Func _StringAdd($string,$searchpattern,$add,$sre = 0)
  1006.     $string = StringSplit($string,"",2)
  1007.     If $searchpattern == "" Then
  1008.         Return _ArrayToString($string,$add)
  1009.     Else
  1010.         If $sre = 1 Then
  1011.             If $add = "" Then
  1012.                 $add = "."
  1013.             EndIf
  1014.             StringRegExpReplace($string,$searchpattern,$searchpattern & $add)
  1015.         Else
  1016.             StringReplace($string,$searchpattern,$searchpattern & $add)
  1017.         EndIf
  1018.         Return $string
  1019.     Endif
  1020.     Return -1
  1021. EndFunc
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top