If (lcase (right (wscript. fullname, 11) = "wscript.exe") then
Wscript. echo "Execute it under the cmd.exe Plz! Thx ."
Wscript. quit
End if
If Wscript. Arguments. count = 0 Then
Usage ()
Wscript. quit
End If
Function ReadGif (sStr)
Dim I, iHex, sPath, oStream
Set oStream = CreateObject ("Adodb. Stream ")
OStream. Type = 1
OStream. Open
OStream. LoadFromFile sStr
For I = 1 To LenB (oStream. Read ())
OStream. Position = 0
IHex = Hex (AscB (MidB (oStream. Read (), I, 1 )))
If Len (iHex) = 1 Then iHex = "0" & iHex
ReadGif = ReadGif & iHex
Next
OStream. Close
Set oStream = Nothing
End Function
Function CutAndJoin (sSource, iLong, sJoiner)
Dim I, N
N = Len (sSource)/iLong
If (N <> Fix (N) Then N = Fix (N) + 1
For I = 0 To N-1
CutAndJoin = CutAndJoin & Mid (sSource, I * iLong + 1, iLong) & sJoiner
Next
If (N> 0) Then CutAndJoin = Left (CutAndJoin, Len (CutAndJoin)-Len (sJoiner ))
End Function
Function ReplaceTest (str, patrn, replStr)
Dim regEx and str1 create variables.
Set regEx = New RegExp to create a regular expression.
RegEx. Pattern = patrn setting mode.
RegEx. IgnoreCase = True is case sensitive.
ReplaceTest = regEx. Replace (str, replStr) to Replace.
End Function
Set Arg = Wscript. Arguments
Temp = "& H" & CutAndJoin (ReadGif (arg (0), 2, "& H ")
Temp1 = CutAndJoin (temp, 4 ,",")
Temp2 = CutAndJoin (temp1, 80, Chr (13 ))
Temp3 = Split (temp2, Chr (13 ))
For I = 0 To UBound (temp3)
Temp4 = temp4 & Replacetest (ReplaceTest (temp3 (I), "^", "a = a &" & Chr (34), "$", Chr (34 )) & Chr (13)
Next
Function writef (cpp)
Set FSO = CreateObject ("Scripting. FileSystemObject ")
With fso. opentextfile (cpp, 2, true)
. Writeline temp4
. Close
End
Set fso = Nothing
End Function
Writef (arg (1 ))
Function usage ()
Wscript. echo "| Useage: |"
Wscript. echo "| cscript.exe shellcode. vbs x. bin test. bas |"
Wscript. echo "| ex: |"
Wscript. echo "| cscript.exe shellcode. vbs c: pythonivy. bin c: est. bas |"
Wscript. echo "+ ------------------------------------------------------------------- +" & chr (10)
End function