#NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\IDE\Resources\img\ICO-Obfuscator.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Description=Rend illisible les scripts FSProg, mais toujours exécutables. #AutoIt3Wrapper_Res_Fileversion=1.2.0.0 #AutoIt3Wrapper_Res_ProductVersion=1,2,0,0 #AutoIt3Wrapper_Res_LegalCopyright=© 2012 LeCoindAide.com #AutoIt3Wrapper_Res_Language=1036 #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Run_Obfuscator=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #Region AutoIt3Wrapper directives section #EndRegion #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Auteur: TT22 Fonction du Script : Obfuscateur pour FSProg. #ce ---------------------------------------------------------------------------- ; Début du script - Ajouter votre code ci-dessous. #include #include If UBound($CmdLine) > 1 Then $File = $CmdLineRaw;Cherche les paramètres. If (StringLeft($File,1) = '"' Or StringLeft($File,1) = "'") And (StringRight($File,1) = '"' Or StringRight($File,1) = "'") Then;Supprime les " ou ' au début et à la fin. $File = StringTrimLeft($File,1) $File = StringTrimRight($File,1) EndIf Else $File = FileOpenDialog("Choisissez le script à convertir...",-1,"Fichiers FSProg (*.fsp)");Choix du fichier. EndIf If @error Then Exit;Getsion des erreurs... If Not FileExists($File) Then MsgBox(16,"Obfuscator : Erreur","Erreur !"&@CRLF&@CRLF&"Le fichier choisis n'existe pas !") Exit EndIf If Not FileCopy($File,StringTrimRight($File,4)&" - Obfuscator.fsp") Then MsgBox(16,"Obfuscator : Erreur","Erreur !"&@CRLF&@CRLF&"Le fichier choisis n'a pas pu être copié !") Exit EndIf SplashTextOn("Obfuscator","Obfuscation en cours..."&@CRLF&"Veuillez patienter.",500,70) $File = StringTrimRight($File,4)&" - Obfuscator.fsp" Dim $Func[52] = ["fWrite","fRead","fDel","fCreate","fMove","fCopy","fRun","dDel","dCreate","dMove","dCopy","pDel","pSet","pExist","pWait","mMove","mLeft","mRight","kSend","kDown","kUp","message","exit","sleep","console","random","sSetErr","sExitCode","sWriteErr","sGetOsInfo","strLeft","strRight","strReplace","strInStr","strLen","sGetEnv","sSetEnv","cWrite","cClear","cGet","cTitle","cExec","isDeclared","fExist","dExist","wActivate","wWait","wSetPos","wGetPos","wSetSize","wGetSize","wExist"] Dim $RandomReplace[52] = [GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace(),GetRandomReplace()] Dim $FuncSize[52] = [6,5,4,7,5,5,4,4,7,5,5,4,4,6,5,5,5,6,5,5,3,7,4,5,7,6,7,9,9,10,7,8,10,8,6,7,7,6,6,4,6,5,10,6,6,9,5,7,7,8,8,6] Dim $Alpha[26] = ["A","b","c","d","E","f","g","h","I","j","k","l","m","n","O","p","q","r","s","T","U","v","w","x","Y","z"] $Header = '//\ Fichier rendu illisible par "Obfuscator.exe", développé par TT22 pour FSProg.'&@CRLF&"#replace OBF 1"&@CRLF&"#replace "&$RandomReplace[0]&" fWrite"&@CRLF&"#replace "&$RandomReplace[1]&" fRead"&@CRLF&"#replace "&$RandomReplace[2]&" fDel"&@CRLF&"#replace "&$RandomReplace[3]&" fCreate"&@CRLF&"#replace "&$RandomReplace[4]&" fMove"&@CRLF&"#replace "&$RandomReplace[5]&" fCopy"&@CRLF&"#replace "&$RandomReplace[6]&" fRun"&@CRLF&"#replace "&$RandomReplace[7]&" dDel"&@CRLF&"#replace "&$RandomReplace[8]&" dCreate"&@CRLF&"#replace "&$RandomReplace[9]&" dMove"&@CRLF&"#replace "&$RandomReplace[10]&" dCopy"&@CRLF&"#replace "&$RandomReplace[11]&" pDel"&@CRLF&"#replace "&$RandomReplace[12]&" pSet"&@CRLF&"#replace "&$RandomReplace[13]&" pExist"&@CRLF&"#replace "&$RandomReplace[14]&" pWait"&@CRLF&"#replace "&$RandomReplace[15]&" mMove"&@CRLF&"#replace "&$RandomReplace[16]&" mLeft"&@CRLF&"#replace "&$RandomReplace[17]&" mRight"&@CRLF&"#replace "&$RandomReplace[18]&" kSend"&@CRLF&"#replace "&$RandomReplace[19]&" kDown"&@CRLF&"#replace "&$RandomReplace[20]&" kUp"&@CRLF&"#replace "&$RandomReplace[21]&" message"&@CRLF&"#replace "&$RandomReplace[22]&" exit"&@CRLF&"#replace "&$RandomReplace[23]&" sleep"&@CRLF&"#replace "&$RandomReplace[24]&" console"&@CRLF&"#replace "&$RandomReplace[25]& " random"&@CRLF&"#replace "&$RandomReplace[26]&" sSetErr"&@CRLF&"#replace "&$RandomReplace[27]&" sExitCode"&@CRLF&"#replace "&$RandomReplace[28]&" sWriteErr"&@CRLF&"#replace "&$RandomReplace[29]&" sGetOsInfo"&@CRLF&"#replace "&$RandomReplace[30]&" strLeft"&@CRLF&"#replace "&$RandomReplace[31]&" strRight"&@CRLF&"#replace "&$RandomReplace[32]&" strReplace"&@CRLF&"#replace "&$RandomReplace[33]&" strInStr"&@CRLF&"#replace "&$RandomReplace[34]&" strLen"&@CRLF&"#replace "&$RandomReplace[35]&" sGetEnv"&@CRLF&"#replace "&$RandomReplace[36]&" sSetEnv"&@CRLF&"#replace "&$RandomReplace[37]&" cWrite"&@CRLF&"#replace "&$RandomReplace[38]&" cClear"&@CRLF&"#replace "&$RandomReplace[39]&" cGet"&@CRLF&"#replace "&$RandomReplace[40]&" cTitle"&@CRLF&"#replace "&$RandomReplace[41]&" cExec"&@CRLF&"#replace "&$RandomReplace[42]&" isDeclared"&@CRLF&"#replace "&$RandomReplace[43]&" fExist"&@CRLF&"#replace "&$RandomReplace[44]&" dExist"&@CRLF&"#replace "&$RandomReplace[45]&" wActivate"&@CRLF&"#replace "&$RandomReplace[46]&" wWait"&@CRLF&"#replace "&$RandomReplace[47]&" wSetPos"&@CRLF&"#replace "&$RandomReplace[48]&" wGetPos"&@CRLF&"#replace "&$RandomReplace[49]&" wSetSize"&@CRLF&"#replace "&$RandomReplace[50]&" wGetSize"&@CRLF&"#replace "&$RandomReplace[51]&" wExist"&@CRLF $FileContent = FileRead($File) $FileContentSplit = StringSplit($FileContent,@CRLF) $FileContentSplit = _ParseString($FileContentSplit) ; Inclusion des fichiers... For $i = 1 To $FileContentSplit[0] Step 2 If StringLeft($FileContentSplit[$i],8) == "#include" Then If StringInStr($FileContentSplit[$i],"<") Then $FileTemp = _StringBetween($FileContentSplit[$i],"<",">") If UBound($FileTemp) Then $FileToInclude = $FileTemp[0] Else SplashOff() MsgBox(16,"Fsp2Exe : Erreur","Erreur !"&@CRLF&@CRLF&'Directive "#include" incorrecte à la ligne '&Ceiling($i/2)&" !") FileDelete($File);Supprime le fichier. Exit EndIf If Not FileExists(@ScriptDir&"\Includes\"&$FileToInclude) Then SplashOff() MsgBox(16,"Fsp2Exe : Erreur","Erreur !"&@CRLF&@CRLF&'Directive "#include" incorrecte à la ligne '&Ceiling($i/2)&" !"&@CRLF&"Le fichier désigné n'existe pas !") FileDelete($File);Supprime le fichier. Exit EndIf $FileContentTemp = FileRead(@ScriptDir&"\Includes\"&$FileToInclude) $FileContentSplitTemp = StringSplit($FileContentTemp,@CRLF) $FileContentSplitTemp = _ParseString($FileContentSplitTemp) $Temp = "" For $j = 1 To $FileContentSplitTemp[0] Step 2 If $FileContentSplitTemp[$j] <> "" Then $Temp &= $FileContentSplitTemp[$j]&@CRLF Next $FileContentSplit[$i] = $Temp ElseIf StringInStr($FileContentSplit[$i],'"') Then $FileTemp = _StringBetween($FileContentSplit[$i],'"','"') If UBound($FileTemp) Then $FileToInclude = $FileTemp[0] Else SplashOff() MsgBox(16,"Fsp2Exe : Erreur","Erreur !"&@CRLF&@CRLF&'Directive "#include" incorrecte à la ligne '&Ceiling($i/2)&" !") FileDelete($File);Supprime le fichier. Exit EndIf If Not FileExists(ParseFile($FileToInclude,$File)) Then SplashOff() MsgBox(16,"Fsp2Exe : Erreur","Erreur !"&@CRLF&@CRLF&'Directive "#include" incorrecte à la ligne '&Ceiling($i/2)&" !"&@CRLF&"Le fichier désigné n'existe pas !") FileDelete($File);Supprime le fichier. Exit EndIf $FileContentTemp = FileRead(ParseFile($FileToInclude,$File)) $FileContentSplitTemp = StringSplit($FileContentTemp,@CRLF) $FileContentSplitTemp = _ParseString($FileContentSplitTemp) $Temp = "" For $j = 1 To $FileContentSplitTemp[0] Step 2 If $FileContentSplitTemp[$j] <> "" Then $Temp &= $FileContentSplitTemp[$j]&@CRLF Next $FileContentSplit[$i] = $Temp EndIf EndIf Next $Return = "" FileDelete($File) For $i = 1 To $FileContentSplit[0] Step 2 If $FileContentSplit[$i] <> "" Then $Return &= $FileContentSplit[$i]&@CRLF EndIf Next $ResultToWrite = $Return For $i = 0 To 51 Step 1;Replace les fonctions sources... $ResultToWrite = StringReplace($ResultToWrite,$Func[$i],$RandomReplace[$i],0,1) Next $StringBetween = _StringBetween($Return,"$",";");Replace les variables... For $i = 0 To UBound($StringBetween)-1 Step 1 $ResultToWrite = StringReplace($ResultToWrite,"$"&$StringBetween[$i]&";","$"&GetRandomReplace()&";",0,1) Next FileDelete($File) FileWrite($File,$Header&$ResultToWrite) SplashOff() MsgBox(64,"FSProg : Obfuscator","Traitement du fichier terminé !"&@CRLF&"Le fichier est disponnible ici : "&$File) Func GetRandomReplace() Dim $Alpha[26] = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] $Random = "" For $i = 0 To 17 Step 1 If Random(0,1,1) = 0 Then $Random &= Random(0,9,1) Else If Random(0,1,1) = 0 Then $Random &= $Alpha[Random(0,25,1)] Else $Random &= StringUpper($Alpha[Random(0,25,1)]) EndIf EndIf Next Return $Random EndFunc Func ParseFile($String,$File) If StringInStr($String,":") Then Return $String Else $Split = StringSplit($File,"\") $Path = "" For $i = 1 To UBound($Split)-2 Step 1 $Path&=$Split[$i]&"\" Next $Return=$Path&$String Return $Return EndIf EndFunc Func _ParseString($FileContentSplit) For $i = 1 To $FileContentSplit[0] Step 2 While (StringLeft($FileContentSplit[$i],1) = " " Or StringLeft($FileContentSplit[$i],1) = " ") $FileContentSplit[$i] = StringTrimLeft($FileContentSplit[$i],1) WEnd If StringLeft($FileContentSplit[$i],2) = "//" And StringLeft($FileContentSplit[$i],3) <> "//\" Then $FileContentSplit[$i] = "" EndIf Next Return $FileContentSplit EndFunc