本帖最后由 HOPE2021 于 2022-6-5 15:15 编辑
1.0.0002下半部分- :GetHex
- Echo.
- Echo. ^>^> 正在获取文件十六进制信息,此步骤将耗费较多时间,请耐心等待……
- Fsutil File CreateNew 1.$ %jFileSize% > Nul 2> Nul
- FC /B "%hFileName%" 1.$ > 2.$
- @Call :WriteVBS 1 2.$ 3.$
- Echo.
- Echo. ^>^> 正在整理文件十六进制信息,此步骤将耗费较多时间,请耐心等待……
- Cscript //Nologo WriteBin.VBS
- @Call :WriteVBS 2 %jFileSize%
- Echo.
- Echo. ^>^> 正在找回文件遗漏的十六进制信息,此步骤将耗费较多时间,请耐心等待……
- Cscript //Nologo WriteBn2.VBS
- FC /B "%hFileName%" 2.Tmp > 4.$
- @Call :WriteVBS 1 4.$ 5.$
- Echo.
- Echo. ^>^> 正在重新整理文件十六进制信息,此步骤将耗费较多时间,请耐心等待……
- Cscript //Nologo WriteBin.VBS
- Type 3.$ > tHexS.$
- Type 5.$ >> tHexS.$
- Echo.
- Echo. ^>^> 正在生成文件十六进制信息,此步骤将耗费较多时间,请耐心等待……
- Sort /Unique tHexS.$ /O tHex.Tmp
- Echo.
- Echo. ^>^> 正在生成文件十六进制码,此步骤将耗费较多时间,请耐心等待……
- @Call :WriteVBS 3 tHex.Tmp Hex.Tmp
- Cscript //Nologo WriteBn3.VBS
- @Goto :Eof
-
- :MakeBatch
- Echo.
- Echo. ^>^> 正在生成批处理脚本,此步骤将耗费较多时间,请耐心等待……
- (
- Echo.Dim objFSO, objFile, strLine
- Echo.Dim objOpFSO, objOpFile, strOpLine
- Echo.Dim i
- Echo.Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objOpFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objFile = objFSO.OpenTextFile^("Hex.Tmp", 1^)
- Echo.Set objOpFile = objOpFSO.CreateTextFile^("Mk.Bat"^)
- Echo.objOpFile.Write "@Echo Off" ^& vbCrLf ^& "@Goto :Main" ^& vbCrLf ^& vbCrLf ^& ":Main" ^& vbCrLf ^& vbTab ^& "@Call :Mk_%jFileName%" ^& vbCrLf ^& "@Exit /B" ^& vbCrLf ^& vbCrLf ^& ":Mk_%jFileName%" ^& vbCrLf ^& "Cd. > Mk.$" ^& vbCrLf
- Echo.i = 0
- Echo.Do Until objFile.atendofstream
- Echo. If i = 0 Then objOpFile.Write "(" ^& vbCrLf
- Echo. If ^(i + 1^) Mod 256 = 0 Then objOpFile.Write ") >> Mk.$" ^& vbCrLf ^& "(" ^& vbCrLf
- Echo. strLine = objFile.ReadLine
- Echo. objOpFile.WriteLine "Echo." ^& strLine
- Echo. i = i + 1
- Echo.Loop
- Echo.If i Mod 256 ^<^> 0 Then objOpFile.Write ") >> Mk.$" ^& vbCrLf
- Echo.If i Mod 256 = 0 Then objOpFile.Write "Cd.) >> Mk.$" ^& vbCrLf
- Echo.objFile.Close
- Echo.objOpFile.Close
- Echo.Set objFSO = Nothing
- Echo.Set objOpFSO = Nothing
- ) > $Make.VBS
- Cscript //Nologo $Make.VBS
- (
- Echo.^(
- Echo.Echo.Dim objFSO, objFile, strLine
- Echo.Echo.Dim objOpFSO, objOpFile, strOpLine
- Echo.Echo.Dim i
- Echo.Echo.Set objFSO = CreateObject^^^("Scripting.FileSystemObject"^^^)
- Echo.Echo.Set objOpFSO = CreateObject^^^("Scripting.FileSystemObject"^^^)
- Echo.Echo.Set objFile = objFSO.OpenTextFile^^^("Mk.$", 1^^^)
- Echo.Echo.Set objOpFile = objOpFSO.CreateTextFile^^^("Mk_.VBS"^^^)
- Echo.Echo.objOpFile.Write "Dim Bin_" ^^^& vbCrLf ^^^& "Bin_ = Array("
- Echo.Echo.Do Until objFile.AtEndOfStream
- Echo.Echo. strLine = objFile.ReadLine
- Echo.Echo. For i = 1 To Len^^^(strLine^^^) Step 2
- Echo.Echo. objOpFile.Write "&H" ^^^& Mid^^^(strLine, i, 2^^^) ^^^& ", "
- Echo.Echo. Next
- Echo.Echo. objOpFile.Write "_ " ^^^& vbCrLf
- Echo.Echo.Loop
- Echo.Echo.objOpFile.Write "-1)" ^^^& vbCrLf ^^^& vbCrLf
- Echo.Echo.objOpFile.WriteLine "Call WriteBinary(""%FName%"", Bin_)"
- Echo.Echo.objOpFile.Write vbCrLf
- Echo.Echo.objOpFile.WriteLine "Sub WriteBinary(FileName, Buf)"
- Echo.Echo.objOpFile.WriteLine " Dim I, aBuf, Size, bStream"
- Echo.Echo.objOpFile.WriteLine " Size = UBound(Buf) - 1: ReDim aBuf(Size \ 2)"
- Echo.Echo.objOpFile.WriteLine " For I = 0 To Size - 1 Step 2"
- Echo.Echo.objOpFile.WriteLine " aBuf(I \ 2) = ChrW(Buf(I + 1) * 256 + Buf(I))"
- Echo.Echo.objOpFile.WriteLine " Next"
- Echo.Echo.objOpFile.WriteLine " If I = Size Then aBuf(I \ 2) = ChrW(Buf(I))"
- Echo.Echo.objOpFile.WriteLine " aBuf=Join(aBuf, """")"
- Echo.Echo.objOpFile.WriteLine " Set bStream = CreateObject(""ADODB.Stream"")"
- Echo.Echo.objOpFile.WriteLine " bStream.Type = 1: bStream.Open"
- Echo.Echo.objOpFile.WriteLine " With CreateObject(""ADODB.Stream"")"
- Echo.Echo.objOpFile.WriteLine " .Type = 2 : .Open: .WriteText aBuf"
- Echo.Echo.objOpFile.WriteLine " .Position = 2: .CopyTo bStream: .Close"
- Echo.Echo.objOpFile.WriteLine " End With"
- Echo.Echo.objOpFile.WriteLine " bStream.SaveToFile FileName, 2: bStream.Close"
- Echo.Echo.objOpFile.WriteLine " Set bStream = Nothing"
- Echo.Echo.objOpFile.WriteLine "End Sub"
- Echo.Echo.objFile.Close
- Echo.Echo.objOpFile.Close
- Echo.Echo.Set objFSO = Nothing
- Echo.Echo.Set objOpFSO = Nothing
- Echo.^) ^> Mk$.VBS
- ) >> Mk.Bat
- (
- Echo.Cscript //Nologo Mk$.VBS
- Echo.Cscript //Nologo Mk_.VBS
- If /I %IsCompress%==True Echo.Expand /R "%FName%" ^> Nul 2^> Nul
- If /I %IsCompress%==True Echo.If Exist "%FName%" Del /Q "%FName%" ^> Nul 2^> Nul
- Echo.If Exist "Mk_.VBS" Del /Q "Mk_.VBS" ^> Nul 2^> Nul
- Echo.If Exist "Mk$.VBS" Del /Q "Mk$.VBS" ^> Nul 2^> Nul
- Echo.If Exist "Mk.$" Del /Q "Mk.$" ^> Nul 2^> Nul
- Echo.@Goto :Eof
- ) >> Mk.Bat
- If Exist Hex.Tmp Del /Q Hex.Tmp
- If Exist $Make.VBS Del /Q $Make.VBS
- @Goto :Eof
-
- :WriteVBS
- If %1==1 (
- (
- Echo.Dim objFSO, objFile, strLine
- Echo.Dim objOpFSO, objOpFile, strOpLine
- Echo.Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objOpFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objFile = objFSO.OpenTextFile^("%2", 1^)
- Echo.Set objOpFile = objOpFSO.CreateTextFile^("%3"^)
- Echo.objFile.SkipLine
- Echo.Do Until objFile.atendofstream
- Echo. strLine = objFile.ReadLine
- Echo. strOpLine = Split^(strLine, " "^)
- Echo. objOpFile.WriteLine strOpLine^(0^) ^& strOpLine^(1^)
- Echo.Loop
- Echo.objFile.Close
- Echo.objOpFile.Close
- Echo.Set objFSO = Nothing
- Echo.Set objOpFSO = Nothing
- ) > WriteBin.VBS
- )
- If %1==2 (
- (
- Echo.Dim objFSO, objFile, strLine, i
- Echo.Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objFile = objFSO.CreateTextFile^("2.Tmp"^)
- Echo.For i = 0 To %2 - 1
- Echo. objFile.Write Chr^(65^)
- Echo.Next
- Echo.objFile.Close
- Echo.Set objFSO=Nothing
- ) > WriteBn2.VBS
- )
- If %1==3 (
- (
- Echo.Dim objFSO, objFile, strLine
- Echo.Dim objOpFSO, objOpFile, strOp
- Echo.Dim i
- Echo.Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objOpFSO = CreateObject^("Scripting.FileSystemObject"^)
- Echo.Set objFile = objFSO.OpenTextFile^("%2", 1^)
- Echo.Set objOpFile = objOpFSO.CreateTextFile^("%3"^)
- Echo.i = 0
- Echo.Do Until objFile.atendofstream
- Echo. strLine = objFile.ReadLine
- Echo. strOp = Split^(strLine, ":"^)
- Echo. objOpFile.Write strOp^(1^)
- Echo. If ^(i + 1^) Mod 32 = 0 Then objOpFile.Write vbCrLf
- Echo. i = i + 1
- Echo.Loop
- Echo.objFile.Close
- Echo.objOpFile.Close
- Echo.Set objFSO = Nothing
- Echo.Set objOpFSO = Nothing
- ) > WriteBn3.VBS
- )
- @Goto :Eof
-
- :PrintWizardTitle
- @Cls
- For /L %%I in (0,1,1) Do Echo.
- Echo. 新建工程向导
- Set /P Str=# <Nul
- For /L %%I in (0,1,71) Do Set /P Str=#=<Nul
- Echo.
- For /L %%I in (0,1,1) Do Echo.
- @Goto :Eof
-
- :ReadHelp
- @Cls
- For /L %%I in (0,1,1) Do Echo.
- Echo. Hope(R) Any to Bat 自述文档
- Echo.
- Echo. Hope Any to Bat [Version 1.1.00002]
- Echo. (C) Copyright 2016-2022 Hope Corp.
- Echo.
- Echo. ·Hope(R) Any to Bat 是什么
- Echo. Hope(R) Any to Bat 是一款批处理嵌入包设计软件,它可以将任何文件插入到批
- Echo. 处理脚本中,并自动设计解包程序。此程序支持VBS技术,能更快的完成操作。
- Echo.
- Echo. ·Hope(R) Any to Bat 更新日志
- Echo. ·Version 1.0.0000 09/08/2021
- Echo.
- Echo. ·Version 1.0.0001[未发布] 19/08/2021
- Echo. 首次尝试VBS内核,兼容性极差
- Echo.
- Echo. ·Version 1.0.0002 05/06/2022
- Echo. 重新设计VBS内核,速度增强,
- Echo. 更改了界面。
- Echo. 未解决兼容性问题,打包程序目前只在 Windows 10 测试正常。
- Pause > Nul
- @Goto :Eof
复制代码
|