salut tout le monde.
je souhaite convertir une script vbs en vbe je sais que c'est est possible par par l'éditeur vbsript factory mais je sais pas comment.
Si quelqu'un connait un lien ou un tutoriel merci bien de me le communiquer.
Cordialement.








salut tout le monde.
je souhaite convertir une script vbs en vbe je sais que c'est est possible par par l'éditeur vbsript factory mais je sais pas comment.
Si quelqu'un connait un lien ou un tutoriel merci bien de me le communiquer.
Cordialement.
Voici un petit VBScript pour encoder tes scripts vbs
il faut juste remplacer MonFichier.vbs par le nom de ton script VBS et le nom de sortie de ton script encodé VBE MonFichier_encode.vbe
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 Set scrEnc = CreateObject("Scripting.Encoder") Set scrFSO = CreateObject("Scripting.FileSystemObject") myfile = scrFSO.OpenTextFile("MonFichier.vbs").ReadAll If scrFSO.FileExists("MonFichier_encode.vbe") Then scrFSO.DeleteFile "MonFichier_encode.vbe", True myFileEncode=scrENC.EncodeScriptFile(".vbs", myfile, 0, "") Set ts = scrFSO.CreateTextFile("MonFichier_encode.vbe", True, False) ts.Write myFileEncode ts.close
Vous pouvez consulter ce lien pour encoder
et ce lien pour décoder
voila Ce script en ligne de commande encode tout fichier vbs,js,asp,html,...
screncode.wsf
et ce script en ligne de commande décode tout fichier vbe,je,asp,html,...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <job> <runtime> <description author="jcb"> --------------------------------------------------------------------- Ce script en ligne de commande encode tout fichier vbs,js,asp,html,... à l'identique de l'encodeur "screnc.exe" de Microsoft : http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp JCB © 2004 --------------------------------------------------------------------- </description> <unnamed name = "srce" helpstring = "Nom de fichier source à encoder" type = "string" required = "true" /> <unnamed name = "dest" helpstring = "Nom de fichier destination encodé" type = "string" required = "true" /> <unnamed name = "A" helpstring = "Affichage du fichier encodé dans le bloc-notes" type = "string" required = "false" /> <example> Chaque nom de fichier doit être encadré par des guillemets s'il contient des espaces. Exemples : ---------- screncode.wsf "m:\mes scripts\monscript.vbs" h:\wsh\monscript.vbe screncode.wsf "k:\mon site\identdec.asp" D:\Inetpub\wwwroot\ident.asp --------------------------------------------------------------------- </example> </runtime> <script language="VBScript"> Const SW_SHOWNORMAL=1 Const ForReading=1 Const ForWriting=2 Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set shell = WScript.CreateObject("WScript.Shell") Set UnNamed = WScript.Arguments.UnNamed nu=UnNamed.count If nu<2 Then WScript.Arguments.ShowUsage WScript.Quit End If Srce=UnNamed(0) Dest=UnNamed(1) Display=false If nu>=3 then if lcase(UnNamed(2))="a" Then Display=true If not fso.FileExists(Srce) Then MsgBox "Le fichier " & Srce & " n'a pas été trouvé", vbCritical + vbOKOnly, "Encodage de fichier" WScript.Quit End If If fso.FileExists(Dest) Then rep=MsgBox("Le fichier destination " & Dest & " existe déjà." & VBCRLF & _ "Faut-il l'écraser ?", vbQuestion+vbYesNo, "Encodage de fichier") If rep<>vbYes Then WScript.Quit End If Set fs=fso.GetFile(Srce) pe=InstrRev(fs.Name,".") If pe>0 then ext=lcase(mid(fs.Name,pe)) else ext=".vbs" If ext=".wsf" Then ext=".html" Set fs = fso.OpenTextFile(Srce,ForReading,false) data=fs.readAll fs.close Set se=WScript.CreateObject("Scripting.Encoder") dataenc=se.EncodeScriptFile(ext,data, 0, "") Set fd = fso.CreateTextFile(Dest, true,false) fd.Write dataenc fd.close If Display Then cmd="notepad.exe """ & Dest & """" shell.run cmd,SW_SHOWNORMAL,false End If WScript.Quit '-------------------------------------------------------------------- </script> </job>
encodé au préalable à l'aide de l'encodeur "screnc.exe" de Microsoft ou à l'aide du script "screncode.wsf"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <job> <runtime> <description author="jcb"> --------------------------------------------------------------------- Ce script en ligne de commande décode tout fichier vbe,je,asp,html,... encodé au préalable à l'aide de l'encodeur "screnc.exe" de Microsoft : http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp ou à l'aide du script "screncode.wsf" JCB © 2004 / Jean-Luc Antoine © 2002 --------------------------------------------------------------------- </description> <unnamed name = "srce" helpstring = "Nom de fichier source à décoder" type = "string" required = "true" /> <unnamed name = "dest" helpstring = "Nom de fichier destination décodé" type = "string" required = "true" /> <unnamed name = "A" helpstring = "Affichage du fichier décodé dans le bloc-notes" type = "string" required = "false" /> <example> Chaque nom de fichier doit être encadré par des guillemets s'il contient des espaces. Exemples : ---------- scrdecode.wsf h:\wsh\monscript.vbe "m:\mes scripts\monscript.vbs" scrdecode.wsf D:\Inetpub\wwwroot\ident.asp "k:\mon site\identdec.asp" A --------------------------------------------------------------------- </example> </runtime> <script language="VBScript"> Const SW_SHOWNORMAL=1 Const ForReading=1 Const ForWriting=2 'Tags qui encadrent les chaines codées '--- Début Const TagDeb1="#@~^" Const TagDeb2="??????" '6 caractères variables,p.ex. "nQEAAA" ,"2BoAAA",... Const TagDeb3="==" LTD1=len(TagDeb1) LTD2=len(TagDeb2) LTD3=len(TagDeb3) LTD=LTD1+LTD2+LTD3 '--- Fin Const TagFin1="??????" '6 caractères variables,p.ex. "oX4HAA", "oW4AAA",... Const TagFin2="==^#~@" LTF1=len(TagFin1) LTF2=len(TagFin2) Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set shell = WScript.CreateObject("WScript.Shell") Set UnNamed = WScript.Arguments.UnNamed nu=UnNamed.count If nu<2 Then WScript.Arguments.ShowUsage WScript.Quit End If Srce=UnNamed(0) Dest=UnNamed(1) Display=false If nu>=3 then if lcase(UnNamed(2))="a" Then Display=true If not fso.FileExists(Srce) Then MsgBox "Le fichier " & Srce & " n'a pas été trouvé", vbCritical + vbOKOnly, "Décodage de fichier" WScript.Quit End If If fso.FileExists(Dest) Then rep=MsgBox("Le fichier destination " & Dest & " existe déjà." & VBCRLF & _ "Faut-il l'écraser ?", vbQuestion+vbYesNo, "Décodage de fichier") If rep<>vbYes Then WScript.Quit End If Set fs = fso.OpenTextFile(Srce,ForReading,false) data=fs.readAll fs.close ' boucle explorant les blocs codés ' repérés par les tags TagDeb1 et TagFin2 Do IndexFin=0 IndexDeb=Instr(data,TagDeb1) If IndexDeb>0 Then ' recherche de TagDeb3 ("==") LTD2 (6) caractères après le tag de début If Instr(IndexDeb,data,TagDeb3)=IndexDeb+LTD1+LTD2 Then ' recherche du tag de fin IndexFin=Instr(IndexDeb,data,TagFin2) If IndexFin>0 Then 'données non codées initiales data1=Left(data,IndexDeb-1) 'données codées IndexDeb2=IndexDeb+LTD 'il faut soustraire LTF1 (6) caractères avant le tag de fin data2=Mid(data,IndexDeb2,IndexFin-LTF1-IndexDeb2) 'données non codées finales data3=Mid(data,IndexFin+LTF2) data= data1 & Decode(data2) & data3 End If End If End If Loop Until IndexFin=0 Set fd = fso.CreateTextFile(Dest, true,false) fd.Write data fd.close If Display Then cmd="notepad.exe """ & Dest & """" shell.run cmd,SW_SHOWNORMAL,false End If WScript.Quit '-------------------------------------------------------------------- 'Partie inspirée de JL Antoine 'http://www.interclasse.com/scripts/decovbe.php Function Decode(ChEnc) Dim tDecode(127) StrCod=array("@&","@#","@*","@!","@$") StrDec=array(vbLf,vbCr,">" ,"<" ,"@" ) Const Combinaison="1231232332321323132311233213233211323231311231321323112331123132" Set se=WScript.CreateObject("Scripting.Encoder") For i=9 to 127 tDecode(i)="xxx" Next 'encodage des chaines "xxx" avec x=chr(i), i=9 -> 127 For i=9 to 127 chd=string(3,i) che=se.EncodeScriptFile(".vbs",chd,0,"") S=Mid(che,13,3) ch="" For j=1 to 3 c=Asc(Mid(S,j,1)) if not ((c = 42) and (i = 62)) then tDecode(c)=Left(tDecode(c),j-1) & chr(i) & Mid(tDecode(c),j+1) Next Next For i = lbound(StrCod) To ubound(StrCod) ChEnc=Replace(ChEnc,StrCod(i),StrDec(i)) Next index=-1 ChDec="" For i=1 to Len(ChEnc) oldcar=Mid(ChEnc,i,1) newcar=oldcar c=asc(oldcar) If c<128 Then index=index+1 If (c=9) or ((c>31) and (c<128)) Then If (c<>60) and (c<>62) and (c<>64) Then newcar=Mid(tDecode(c),Mid(Combinaison,(index mod 64)+1,1),1) End If ChDec=ChDec & newcar Next Decode=ChDec End Function '-------------------------------------------------------------------- </script> </job>








merci pour la réponse mais je dois utiliser le vbscript factory.








veuillez me communiquer le lien de l'aide








j'ai pas compris ta réponse.








Quand tu es dans FBS Factory tu appuies sur la touche F2 de ton clavier.
D’ailleurs la touche F2 permet d'appeler plus généralement l'aide de n'importe quel programme.
Partager