标题: [文本处理] Hope EasyCommand EasyEnCode 批处理加密器 [打印本页]
作者: HOPE2021 时间: 2021-10-10 10:10 标题: Hope EasyCommand EasyEnCode 批处理加密器
本帖最后由 HOPE2021 于 2021-10-10 15:12 编辑
____更新日志______________________________________
版本 1.0.0000 2021/10/10 本楼
版本 1.0.0001 2021/10/10 7楼
版本 1.0.0002 2021/10/10 15楼
版本 1.0.0003 2021/10/10 16楼
版本 1.0.0004 2021/10/10 17楼
版本 1.0.0005 2021/10/10 18楼
____操作手册______________________________________
http://www.bathome.net/redirect.php?goto=findpost&pid=246538&ptid=60317
代码- @Echo Off
- Cls
- Mode Con: Cols=120
- Color 0F
- Title Hope(R) Office EasyCommand EasyEnCode
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0000]
- Echo. ^>^> (C) Copyright 2016-2021 Hope Corp.
- If "%~1"=="" (
- Set FileNum=1
- ) Else (
- Set FileNum=2
- )
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
-
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0000]"
- Set "Pro=%Pro:"=%"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version 1.0.000].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
-
- Set "FileName=%FileName:"=%"
-
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
-
- If Not Exist %FileName% (
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
-
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- For /L %%i in (1,1,47) Do Call :RepeatBS
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Echo.
- Echo. 文件名: %FileName%
- Echo.
-
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
-
- Start /Wait "" "EnCode.VBS"
-
- If Exist "EnCode.VBS" Del "EnCode.VBS"
-
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
-
- If Exist "File.Bat" Del "File.Bat"
-
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0000]")(window.close)
-
- Start Explorer "%Cd%"
-
- Start "" "Notepad" "EnCode.Bat"
-
- Cd..
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- @Goto :Main
-
- :RepeatBS
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
-
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- @Goto :Eof
复制代码
By Hope2021
谢谢.
作者: HOPE2021 时间: 2021-10-10 10:13
本帖最后由 HOPE2021 于 2021-10-10 10:47 编辑
回复 1# HOPE2021
Hope(R) Office EasyCommand EasyEnCode 操作使用指南
___目录_________________________________________________
1. 那些文件不适合加密?
#1. 调用PowerShell
#2. 内嵌脚本,内嵌脚本无法加密
#3. 用For来处理自身文件的文本[并输出]
#4. 已经加密的文件
2. 加密方法
___正文_________________________________________________
1. 那些文件不适合加密?
#1. 调用PowerShell
例子:- #&cls&@powershell -c "Get-Content '%~0' | Select-Object -Skip 1 | Out-String | Invoke-Expression" & exit
- cls
- #------------------------初始化区------------------------------------
- [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") #加载WinForm库
- [void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
- $url = 'http://dict-co.iciba.com/api/dictionary.php?type=json&key=C6AAC87C99A4223504F6B7A79C628120&w={0}'
- #Windows API
- $code=@"
- using System;
- using System.Runtime.InteropServices;
- public static class GetApi{
- [DllImport("user32.dll")]
- public static extern bool SetWindowPos(IntPtr hWnd,IntPtr hWnd0,uint x,uint y,uint cx,uint cy,uint flag); //声明 Windows API 函数
- [DllImport("user32.dll")]
- private static extern bool ShowWindow(IntPtr hWnd,uint showType); //声明 Windows API 函数
- [DllImport("kernel32.dll")]
- private static extern IntPtr GetConsoleWindow(); //声明 Windows API 函数
- public static bool ShowConsoleWindow(uint showType){
- return ShowWindow(GetConsoleWindow(),showType);
- }
- }
- "@
- Add-Type -TypeDefinition $code
- #隐藏控制台窗口
- [void][GetApi]::ShowConsoleWindow(0)
-
- #------------------------界面区-------------------------------------
- #0.设置主窗口尺寸
- $mainFormWidth = 400 #主窗口宽度
- $mainFormHeight = 300 #主窗口高度
-
- #1.创建主窗口
- $form_main = New-Object "System.Windows.Forms.Form"
- $form_main.Width = $mainFormWidth #设置主窗口宽度
- $form_main.Height = $mainFormHeight #设置主窗口高度
- $form_main.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen #主窗口居中屏幕
- $form_main.Text = "在线英汉词典" #主窗口标题
- #主窗口置顶
- [GetApi]::SetWindowPos($form_main.Handle,-1,$form_main.Location.X,$form_main.Location.Y,$form_main.Width,$form_main.Height,64)
-
- #2.创建输入框
- $tb_input = New-Object 'System.Windows.Forms.TextBox'
- $tb_input.Height = $form_main.Height / 5
- $tb_input.Width = $form_main.Width
- $tb_input.BackColor = '#012456'
- $tb_input.ForeColor = 'yellow'
- $form_main.Controls.Add($tb_input)
-
- #创建显示框
- $rtb_show = New-Object 'System.Windows.Forms.RichTextBox'
- $rtb_show.Height = $form_main.Height - $tb_input.Height
- $rtb_show.Width = $form_main.Width
- $rtb_show.Location = New-Object 'System.Drawing.Point' 0,$tb_input.Height
- $rtb_show.BackColor = '#012456'
- $rtb_show.ForeColor = '#F5F5F5'
- $rtb_show.ReadOnly = $true
- $form_main.Controls.Add($rtb_show)
-
- #自定义方法
- function Print-Host($obj){ Write-Host ($obj | Out-String) }
- $js = New-Object 'System.Web.Script.Serialization.JavaScriptSerializer'
- $whr = New-Object -ComObject 'WinHttp.WinHttpRequest.5.1'
- #------------------------事件区-------------------------------------
- $tb_input.add_TextChanged({
- cls
- $whr.Open('GET',($url -f $tb_input.Text),$false)
- $errMsg = '';
- try{$whr.Send()}catch{$errMsg = $_.Exception.Message}
- if($whr.Status -ne 200){
- [System.Windows.Forms.MessageBox]::Show(('错误代码:{0} {1} {2}' -f $whr.Status,$whr.StatusText,$errMsg),'网络连接失败')
- return
- }
- $str = [System.Text.RegularExpressions.Regex]::Unescape($whr.ResponseText);
- $means = [System.Text.RegularExpressions.Regex]::Matches($str,'"means":\[".*?"\]}')
- if($means.Count -eq 0){ $means = [regex]::Matches($str,'"word_mean":".*?"') }
- $str = ''
- for($i = 0;$i -lt $means.Count;$i++){
- $str += '' + ($i + 1) + ":"
- $parts = ($means[$i].Value -replace '^.*:\["|"\]}$|word_mean|:','' -replace ',',',') -split '","'
- for($j = 0;$j -lt $parts.Count;$j++){ $str += "`t" + ($parts[$j] -replace '"','') + "`r`n" }
- $str += "`r`n"
- }
- Print-Host $str
- $rtb_show.Text = $str
- })
- $form_main.add_SizeChanged({
- $tb_input.Width = $form_main.Width
- $rtb_show.Height = $form_main.Height - $tb_input.Height
- $rtb_show.Width = $form_main.Width
- })
- $form_main.add_Load({$tb_input.Focus()})
- #------------------------结 束-------------------------------------
- #4.显示主窗口
- $form_main.ShowDialog()
复制代码
作者: HOPE2021 时间: 2021-10-10 10:15
回复 2# HOPE2021
#2. 内嵌脚本,内嵌脚本无法加密
例子:- @echo off
- Rem 来自https://www.dostips.com/forum/viewtopic.php?f=3&t=9848&p=63348
- Rem 作者Lauri
- chcp 936 > nul
- title 劳里的幻想世界
- color 03
- @goto INSTALL_COLOR
-
- :INSTALL_COLOR
- echo.
- echo.正在加载图形引擎...
- (
- echo.@echo off
- echo.chcp 936 ^> nul
- echo.Setlocal EnableDelayedExpansion
- echo.REM setlocal enableextensions
- echo.set dstdir=c:\tmpColorDirtoDelete
- echo.IF EXIST %%dstdir%% goto errExist
- echo.@mkdir %%dstdir%%
- echo.@cd %%dstdir%%
- echo.set count=0
- echo.REM DEFINISCO IL CARATTERE BACKSPACE!
- echo.set "$Defines=$BS" & set "$Details=Create $ESC Ascii-0x1B-27, Expansion insensitive"
- echo. for /f "delims=#" %%%%a in ^(
- echo. '"prompt #$H# &echo on &for %%%%b in (1) do rem"'
- echo. ^) do ^(
- echo. set "%%$Defines%%=%%%%a"
- echo. set "%%$Defines%%=!$BS:~0,1!"
- echo. ^)
- echo.FOR %%%%a IN ^(%%*^) DO ^(
- echo. FOR /F "usebackq delims=# tokens=1,*" %%%%b IN ^('%%%%a'^) DO ^(
- echo. REM echo %%%%b sara' di colore %%%%c
- echo. set /A count=!count!+1
- echo. set nomefile=%%%%b
- echo. IF %%%%c.==. ^(
- echo. set colore=03
- echo. ^) ELSE ^(
- echo. set colore=%%%%c
- echo. ^)
- echo. REM SET /P ".=" %%%%b
- echo. SET /P ".=%%$BS%% " ^<nul ^>%%%%b
- echo. REM echo !count!^>%%%%b
- echo. REM echo FINDSTR /A:%%%%c /C:"!count!" /S "%%%%b"
- echo. REM more %%%%b
- echo. set bin=%%%%b
- echo. ^)
- echo. REM FINE INNER FOR
- echo. REM echo FINDSTR /A:!colore! /C:"!count!" /S "!nomefile!"
- echo. FINDSTR /A:!colore! /C:" " /S "!nomefile!"
- echo. REM goto end
- echo.^)
- echo.REM FINE OUTER FOR
- echo.echo.
- echo.REM ERROR HANDLING
- echo.goto chiusura
- echo.:errExist
- echo.echo 临时目录%%dstdir%%已存在.在继续或更改批处理中的路径之前将其删除.
- echo.goto pulizia
- echo.:chiusura
- echo.:pulizia
- echo.cd..
- echo.rd /S /Q %%dstdir%%
- echo.goto end
- echo.:end
- ) > color.bat
- SetLocal EnableDelayedExpansion
复制代码
作者: HOPE2021 时间: 2021-10-10 10:24
回复 3# HOPE2021
#3. 用For来处理自身文件的文本[并输出]
例子:- @Echo Off
- Cd.>"%0.Bat"
- For /F "skip=6 delims=" %%i in ('Type %0') Do Echo.%%i >> "%0.Bat"
- Start "" "%0.Bat"
- Pause > Nul
-
- @Echo Off
- Echo.Hello,World!
- Pause > Nul
复制代码
作者: HOPE2021 时间: 2021-10-10 10:27
回复 4# HOPE2021
#4. 已经加密的文件
例子:- 汃൳䀊捅潨传晦摃㸮┢⸰慂≴潆䘯∠歳灩㘽搠汥浩㵳•┥湩⠠吧灹〥⤧䐠捅潨┮椥㸠 ̄┢⸰慂≴瑓牡⁴∢∠〥䈮瑡ഢ倊畡敳㸠丠汵䕀档晏൦䔊档效汬Ɐ潗汲Ⅴ慐獵 ̄畎
复制代码
作者: HOPE2021 时间: 2021-10-10 10:40
回复 5# HOPE2021
2. 加密方法
#1. 打开程序,将需要加密的文件拖入窗体
#2. 将需要加密的文件拖入到程序图标中
#3. 将程序另存为 EasyEnCode.Bat 或 EasyEnCode.Cmd ,在命令行输入: EasyEnCode "文件名"
作者: HOPE2021 时间: 2021-10-10 11:24
回复 1# HOPE2021
版本 1.0.0001- @Echo Off
- Cls
- Mode Con: Cols=120 Lines=2001
- Color 0F
- Title Hope(R) Office EasyCommand EasyEnCode
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0001]
- Echo. ^>^> (C) Copyright 2016-2021 Hope Corp.
- If "%~1"=="" (
- Set FileNum=1
- ) Else (
- Set FileNum=2
- )
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
-
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0001]"
- Set "Pro=%Pro:"=%"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version 1.0.0001].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
-
- Set "FileName=%FileName:"=%"
-
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
-
- If Not Exist %FileName% (
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
-
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
-
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
-
- If /I Not "%FilenameExtension%"==".Bat" (
- If /I Not "%FilenameExtension%"==".Cmd" (
- @Goto :Choice
- )
- )
-
- For /L %%i in (1,1,47) Do Call :RepeatBS
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Echo.
- Echo. 文件名: %FileName%
- Echo.
-
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
-
- Start /Wait "" "EnCode.VBS"
-
- If Exist "EnCode.VBS" Del "EnCode.VBS"
-
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
-
- If Exist "File.Bat" Del "File.Bat"
-
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0001]")(window.close)
-
- Start Explorer "%Cd%"
-
- Start "" "Notepad" "EnCode.Bat"
-
- Cd..
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- @Goto :Main
-
- :RepeatBS
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
-
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- @Goto :Eof
-
- :Choice
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- If /I Not "%Choice%"=="Y" (
- @Goto :Main
- )
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
复制代码
作者: cmd1152 时间: 2021-10-10 12:11
合作
作者: cmd1152 时间: 2021-10-10 12:19
好家伙,自动创建快捷方式
作者: HOPE2021 时间: 2021-10-10 12:21
回复 9# cmd1152
当然,所以不支持Win2000或更早版本
作者: cmd1152 时间: 2021-10-10 12:55
回复 10# HOPE2021
调试器功能安装中,请不要进行更新......
作者: cmd1152 时间: 2021-10-10 13:09 标题: Debug安装完成
本帖最后由 cmd1152 于 2021-10-10 13:26 编辑
Version 1.0.0002
打开Debug时for显示的Backspce字符被禁用,是因为不禁用会吃掉]
作者: cmd1152 时间: 2021-10-10 13:11
抱歉,刚刚的DeBug出现了一个小问题,请稍后...
作者: cmd1152 时间: 2021-10-10 13:15
正在优化代码并增加详细的Debug
作者: cmd1152 时间: 2021-10-10 13:22
本帖最后由 cmd1152 于 2021-10-10 13:28 编辑
Version 1.0.0002
代码优化完成
Debug安装完成- @set DeBug=1 % 0代表关闭DeBug,1代表打开DeBug %
- @%Cmd1152提供代码优化和Debug%
- @Echo Off
- Cls
- call :msg "设置窗口大小"
- Mode Con: Cols=120 Lines=6550
- call :msg "设置颜色"
- Color 0F
- call :msg "设置标题"
- Title Hope(R) Office EasyCommand EasyEnCode
- call :msg "设置编码"
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- call :msg "绘图"
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- call :msg "版权声明"
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0002]
- Echo. ^>^> (C) Copyright 2016-2021 Hope ^& Cms1152 Corp.
-
- If "%~1"=="" (
- Set FileNum=1
- call :msg "没有调用参数"
- ) Else (
- Set FileNum=2
- call :msg "有参数"
- )
- call :msg "创建文件夹"
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
- call :msg "set"
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0001]"
- Set "Pro=%Pro:"=%"
- call :msg "创建快捷方式"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version 1.0.0001].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- call :msg "输入"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- call :msg "参数显示"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
- call :msg "set"
- Set "FileName=%FileName:"=%"
-
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
-
- If Not Exist %FileName% (
- call :msg "返回:加密错误:找不到文件"
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
-
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
- call :msg "加密失败:内存错误:文件夹超过2048"
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
- call :msg "文件判断"
- If /I Not "%FilenameExtension%"==".Bat" (
- call :msg "不是bat文件"
- If /I Not "%FilenameExtension%"==".Cmd" (
- call :msg "不是批处理文件"
- @Goto :Choice
- )
- )
- call :msg "for 17"
- For /L %%i in (1,1,47) Do Call :RepeatBS
-
- Echo.
- call :msg "绘图"
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Echo.
- Echo. 文件名: %FileName%
- Echo.
- call :msg "正在加密..."
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- call :msg for返回%%j,最后会返回%%~zi<nul
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s] <Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
- call :msg "打开EnCode.vbs,等待他结束"
- Start /W "" "EnCode.VBS"
- Del /f "EnCode.VBS" 2>nul
-
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
-
- Del /f "File.Bat" 2>nul
- call :msg "完成"
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- call :msg for返回%%j,最后会返回%%~zi<nul
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s] <Nul
- )
- )
- Echo.
- call :msg "Msg"
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0001]")(window.close)
- call :msg "用资源管理器打开文件夹"
- Start Explorer "%Cd%"
- call :msg "用记事本打开程序"
- Start "" "Notepad" "EnCode.Bat"
-
- Cd..
- call :msg "绘图"
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- @Goto :Main
-
- :RepeatBS
- call :msg "Set Bs"
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
- call :msg "循环字体"
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- call :msg "写入文件EnCode.vbs"
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- call :msg "写入文件EnCode.vbs完成"
- @Goto :Eof
-
- :Choice
- call :msg "[信息]"
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# >> "
- If /I Not "%Choice%"=="Y" (
- call :msg "继续"
- @Goto :Main
- )
- call :msg "变量FilenameExtension=.Bat"
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
-
-
- :Msg
- if %debug%==1 (
- set /P= 调试:%~1<nul
- echo;
- )
- goto :eof
复制代码
作者: cmd1152 时间: 2021-10-10 13:35
本帖最后由 cmd1152 于 2021-10-10 13:52 编辑
1.0.0003
修复窗口太小
优化快捷方式和Debug- @set "DeBug=1" % 0代表关闭DeBug,1代表打开DeBug %
- @%Cmd1152提供代码优化和Debug%
- @Echo Off
- set Version=1.0.0003
- Cls
- call :msg "设置窗口大小"
- Mode Con: Cols=120 Lines=68800
- call :msg "设置颜色"
- Color 0F
- call :msg "设置标题"
- Title Hope(R) Office EasyCommand EasyEnCode
- call :msg "设置编码"
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- call :msg "绘图"
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- call :msg "版权声明"
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version %Version%]
- Echo. ^>^> (C) Copyright 2016-2021 Hope ^& Cms1152 Corp.
-
- If "%~1"=="" (
- Set FileNum=1
- call :msg "没有调用参数"
- ) Else (
- Set FileNum=2
- call :msg "有参数"
- )
- call :msg "创建文件夹"
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
- call :msg "set"
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version %Version%]"
- Set "Pro=%Pro:"=%"
- call :msg "创建快捷方式"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version %Version%].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- call :msg "输入"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- call :msg "参数显示"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
- call :msg "set"
- Set "FileName=%FileName:"=%"
-
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
-
- If Not Exist %FileName% (
- call :msg "返回:加密错误:找不到文件"
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
-
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
- call :msg "加密失败:内存错误:文件夹超过2048"
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
- call :msg "文件判断"
- If /I Not "%FilenameExtension%"==".Bat" (
- call :msg "不是bat文件"
- If /I Not "%FilenameExtension%"==".Cmd" (
- call :msg "不是批处理文件"
- @Goto :Choice
- )
- )
- call :msg "for 17"
- For /L %%i in (1,1,47) Do Call :RepeatBS
-
- Echo.
- call :msg "绘图"
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Echo.
- Echo. 文件名: %FileName%
- Echo.
- call :msg "正在加密..."
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- call :msg for返回%%j,最后会返回%%~zi<nul
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s] <Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
- call :msg "打开EnCode.vbs,等待他结束"
- Start /W "" "EnCode.VBS"
- Del /f "EnCode.VBS" 2>nul
-
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
-
- Del /f "File.Bat" 2>nul
- call :msg "完成"
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- call :msg for返回%%j,最后会返回%%~zi<nul
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s] <Nul
- )
- )
- Echo.
- call :msg "Msg"
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version %Version%]")(window.close)
- call :msg "用资源管理器打开文件夹"
- Start Explorer "%Cd%"
- call :msg "用记事本打开程序"
- Start "" "Notepad" "EnCode.Bat"
-
- Cd..
- call :msg "绘图"
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- @Goto :Main
-
- :RepeatBS
- call :msg "Set Bs"
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
- call :msg "循环字体"
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- call :msg "写入文件EnCode.vbs"
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- call :msg "写入文件EnCode.vbs完成"
- @Goto :Eof
-
- :Choice
- call :msg "[信息]"
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# >> "
- If /I Not "%Choice%"=="Y" (
- call :msg "继续"
- @Goto :Main
- )
- call :msg "变量FilenameExtension=.Bat"
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
-
-
- :Msg
- if %debug%==1 (
- set /P= 调试:%~1<nul
- echo;
- )
- goto :eof
复制代码
作者: HOPE2021 时间: 2021-10-10 15:02
回复 16# cmd1152
版本1.0.0004
增加程序调试和查看源码功能- @Echo Off
- Cls
- Mode Con: Cols=120 Lines=16384
- Color 0F
- Title Hope(R) Office EasyCommand EasyEnCode
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0004]
- Echo. ^>^> (C) Copyright 2016-2021 Hope Corp.
- Echo. ^>^> (C) Copyright 2020-2021 Hope2021 ^& Cmd1152 Corp.
- If "%~1"=="" (
- Set FileNum=1
- ) Else (
- Set FileNum=2
- )
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
-
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0004]"
- Set "Pro=%Pro:"=%"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version 1.0.0004].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
-
- Set "FileName=%FileName:"=%"
-
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
-
- If Not Exist %FileName% (
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
-
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
-
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
-
- If /I Not "%FilenameExtension%"==".Bat" (
- If /I Not "%FilenameExtension%"==".Cmd" (
- @Goto :Choice
- )
- )
-
- For /L %%i in (1,1,47) Do Call :RepeatBS
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Echo.
- Echo. 开始加密时间: %Time%
- Echo.
- Echo. 文件名: %FileName%
- Echo.
-
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
-
- Start /Wait "" "EnCode.VBS"
-
- If Exist "EnCode.VBS" Del "EnCode.VBS"
-
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
-
- If Exist "File.Bat" Del "File.Bat"
-
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (1,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
-
- Echo.
- Echo. 加密结束时间: %Time%
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0004]")(window.close)
-
- Start Explorer "%Cd%"
-
- Start "" "Notepad" "EnCode.Bat"
-
- Echo.
- Echo. ^>^> 加密完毕,是否要调试?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- Echo.
-
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- If /I Not "%Choice%"=="Y" (
- Cd..
- @Goto :Main
- )
-
- Start "" "EnCode.Bat"
-
- Echo.
-
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Call :Type " "
- Call :Type "_" 4
- Call :Type "Code"
- Call :Type "_" 108
- Echo.
- Echo.
-
- More "EnCode.Bat"
-
- Echo.
-
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Echo.
-
- Cd..
-
- @Goto :Main
-
- :RepeatBS
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
-
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- @Goto :Eof
-
- :Choice
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- If /I Not "%Choice%"=="Y" (
- @Goto :Main
- )
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
复制代码
作者: HOPE2021 时间: 2021-10-10 15:11
回复 16# cmd1152
版本1.0.0005
修复了需要加密文件大小为0时的显示和加密错误- @Echo Off
- Cls
- Mode Con: Cols=120 Lines=16384
- Color 0F
- Title Hope(R) Office EasyCommand EasyEnCode
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0005]
- Echo. ^>^> (C) Copyright 2016-2021 Hope Corp.
- Echo. ^>^> (C) Copyright 2020-2021 Hope2021 ^& Cmd1152 Corp.
- If "%~1"=="" (
- Set FileNum=1
- ) Else (
- Set FileNum=2
- )
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
-
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0005]"
- Set "Pro=%Pro:"=%"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version 1.0.0005].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
-
- Set "FileName=%FileName:"=%"
-
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
-
- If Not Exist %FileName% (
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
-
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
-
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
-
- If /I Not "%FilenameExtension%"==".Bat" (
- If /I Not "%FilenameExtension%"==".Cmd" (
- @Goto :Choice
- )
- )
-
- For /L %%i in (1,1,47) Do Call :RepeatBS
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Echo.
- Echo. 开始加密时间: %Time%
- Echo.
- Echo. 文件名: %FileName%
- Echo.
-
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (0,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
-
- Start /Wait "" "EnCode.VBS"
-
- If Exist "EnCode.VBS" Del "EnCode.VBS"
-
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
-
- If Exist "File.Bat" Del "File.Bat"
-
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (0,1,%%~zi) do (
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s]<Nul
- )
- )
- Echo.
-
-
- Echo.
- Echo. 加密结束时间: %Time%
-
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version 1.0.0005]")(window.close)
-
- Start Explorer "%Cd%"
-
- Start "" "Notepad" "EnCode.Bat"
-
- Echo.
- Echo. ^>^> 加密完毕,是否要调试?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- Echo.
-
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- If /I Not "%Choice%"=="Y" (
- Cd..
- @Goto :Main
- )
-
- Start "" "EnCode.Bat"
-
- Echo.
-
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Call :Type " "
- Call :Type "_" 4
- Call :Type "Code"
- Call :Type "_" 108
- Echo.
- Echo.
-
- More "EnCode.Bat"
-
- Echo.
-
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Echo.
-
- Cd..
-
- @Goto :Main
-
- :RepeatBS
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
-
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- @Goto :Eof
-
- :Choice
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- If /I Not "%Choice%"=="Y" (
- @Goto :Main
- )
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
复制代码
作者: cmd1152 时间: 2021-10-10 15:34
回复 18# HOPE2021
正在安装Debug...
作者: cmd1152 时间: 2021-10-10 15:55
本帖最后由 cmd1152 于 2021-10-10 15:58 编辑
Version=1.0.0005 优化+Debug 版- @set "DeBug=1" % 0代表关闭DeBug,1代表打开DeBug %
- @%Cmd1152提供代码优化和Debug%
- @Echo Off
- set "Version=1.0.0005 优化+Debug 版"
- Cls
- call :Debug "修改窗口大小"
- Mode Con: Cols=120 Lines=16384
- call :Debug "修改颜色"
- Color 0F
- call :Debug "修改标题"
- Title Hope(R) Office EasyCommand EasyEnCode
- call :Debug "修改代码页"
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- call :Debug "版权声明"
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version %Version%]
- Echo. ^>^> (C) Copyright 2016-2021 Hope Corp.
- Echo. ^>^> (C) Copyright 2020-2021 Hope2021 ^& Cmd1152 Corp.
- If "%~1"=="" (
- Set FileNum=1
- ) Else (
- Set FileNum=2
- )
- call :Debug "新建文件夹"
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
- call :Debug "变量设置"
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version %Version%]"
- Set "Pro=%Pro:"=%"
- call :Debug "创建快捷方式"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version %Version%].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- call :Debug "没有调用函数"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- call :Debug "有调用函数"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
- Set "FileName=%FileName:"=%"
- call :Debug "查找文件"
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
- call :Debug "判断文件是否存在"
- If Not Exist %FileName% (
- call :Debug "没有找到文件"
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
- call :Debug "文件夹名字的递增"
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
- call :Debug "文件夹超过2048"
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
- call :Debug "判断文件是否是批处理"
- If /I Not "%FilenameExtension%"==".Bat" (
- call :Debug "不是.bat文件"
- If /I Not "%FilenameExtension%"==".Cmd" (
- call :Debug "不是.Cmd文件"
- @Goto :Choice
- )
- )
- call :Debug "B变量设置"
- For /L %%i in (1,1,47) Do Call :RepeatBS
- call :Debug "绘图"
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
- call :Debug "[信息]"
- Echo.
- Echo. 开始加密时间: %Time%
- Echo.
- Echo. 文件名: %FileName%
- Echo.
- call :Debug "加密过程"
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (0,1,%%~zi) do (
- call :Debug for返回%%j,最后会返回%%~zi
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s] <Nul
- )
- )
- Echo.
-
- Call :VBScript_EnCode
- call :Debug "打开EnCode.VBS,并等待运行结束"
- Start /W "" "EnCode.VBS"
- call :Debug "删除EnCode.VBS"
- Del /f "EnCode.VBS" >nul 2>nul
- call :Debug "写入EnCode.Bat"
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
- call :Debug "删除File.Bat"
- Del /f "File.Bat" >nul 2>nul
- call :Debug "[信息]"
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (0,1,%%~zi) do (
- call :Debug for返回%%j,最后会返回%%~zi
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s] <Nul
- )
- )
- Echo.
-
- call :Debug "返回加密时间"
- Echo.
- Echo. 加密结束时间: %Time%
- call :Debug "绘图"
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
- call :Debug "Msg"
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version %Version%]")(window.close)
- call :Debug 用资源管理器打开%CD%
- Start Explorer "%Cd%"
- call :Debug "用记事本打开EnCode.Bat"
- Start "" "Notepad" "EnCode.Bat"
- call :Debug "加密完毕"
- Echo.
- Echo. ^>^> 加密完毕,是否要调试?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- If /I Not "%Choice%"=="Y" (
- call :Debug "返回上一级"
- Cd..
- @Goto :Main
- )
- call :Debug "运行EnCode.Bat"
- Start "" "EnCode.Bat"
-
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Call :Type " "
- Call :Type "_" 4
- Call :Type "Code"
- Call :Type "_" 108
- Echo.
- Echo.
- call :Debug "逐屏显示输出内容"
- More "EnCode.Bat"
-
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Echo.
-
- Cd..
-
- @Goto :Main
-
- :RepeatBS
- call :Debug "Bs的设置"
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
- call :Debug "绘图引擎"
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- call :Debug "写入EnCode.VBS"
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- call :Debug "写入EnCode.VBS结束"
- @Goto :Eof
-
- :Choice
- call :Debug "[提示信息]"
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# ^>^> "
- If /I Not "%Choice%"=="Y" (
- @Goto :Main
- )
- call :Debug "变量FilenameExtension=.Bat"
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
-
- goto :eof
- :Debug
- if %debug%==1 (
- set /P= 调试:%~1<nul
- echo;
- )
- goto :eof
复制代码
作者: cmd1152 时间: 2021-10-10 16:12
回复 17# HOPE2021
查看源码是没有用的
作者: HOPE2021 时间: 2021-10-10 16:27
回复 21# cmd1152
查看加密的源码
作者: cmd1152 时间: 2021-10-10 16:33
回复 22# HOPE2021
我还以为是
作者: cmd1152 时间: 2021-10-11 12:40
本帖最后由 cmd1152 于 2021-10-11 12:49 编辑
Version=1.0.0005 优化+Debug+加速 版- @set "DeBug=1" % 0代表关闭DeBug,1代表打开DeBug %
- @%Cmd1152提供代码优化和Debug%
- @Echo Off
- set "Version=1.0.0005 优化+Debug+加速 版"
- Cls
- call :Debug "修改窗口大小"
- Mode Con: Cols=120 Lines=16384
- call :Debug "修改颜色"
- Color 0F
- call :Debug "修改标题"
- Title Hope(R) Office EasyCommand EasyEnCode
- call :Debug "修改代码页"
- Chcp 936 > Nul
- Rem Hope(R) Office EasyCommand EasyEnCode
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "#" 116
- Echo.
- Call :Type " " 55
- Call :Type "EasyEnCode"
- Echo.
- Call :Type " "
- Call :Type "#" 116
- Echo.
- call :Debug "版权声明"
- Echo.
- Echo. ^>^> Hope(R) Office EasyCommand EasyEnCode [Version %Version%]
- Echo. ^>^> (C) Copyright 2016-2021 Hope Corp.
- Echo. ^>^> (C) Copyright 2020-2021 Hope2021 ^& Cmd1152 Corp.
- If "%~1"=="" (
- Set FileNum=1
- ) Else (
- Set FileNum=2
- )
- call :Debug "新建文件夹"
- Md "%UserProFile%\Desktop" >Nul 2>Nul
- Md "%UserProFile%\桌面" >Nul 2>Nul
- call :Debug "变量设置"
- Set "Pro=%0"
- Set "lnk=Hope(R) Office EasyCommand EasyEnCode [Version %Version%]"
- Set "Pro=%Pro:"=%"
- call :Debug "创建快捷方式"
- Mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\Hope Office EasyCommand EasyEnCode [Version %Version%].lnk""):b.TargetPath=""%Pro%"":b.WorkingDirectory=""%~dp0"":b.Save:close") >Nul 2>Nul
-
- @Goto :Main
-
- :Main
- Echo.
- Set "FileName=///*无此文件*///"
-
- If "%FileNum%"=="1" (
- call :Debug "没有调用函数"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:
- ) Else (
- call :Debug "有调用函数"
- Set /P FileName=# ^>^> 请将需要加密的文件拖动至此窗体:%~1<Nul
- Echo.
- Set FileName=%~1
- Set FileNum=1
- )
- Set "FileName=%FileName:"=%"
- call :Debug "查找文件"
- For /F %%I in ('Dir /b') Do (
- If "%%I"=="%FileName%" (
- Set "FileName=%Cd%\%FileName%"
- )
- )
-
- Set FileName="%FileName%"
- call :Debug "判断文件是否存在"
- If Not Exist %FileName% (
- call :Debug "没有找到文件"
- Echo.
- Echo. ^>^> 无此文件!无法加密...
- @Goto :Main
- )
-
- Set FilenameExtension=%FileName:~-5%
- Set FilenameExtension=%FilenameExtension:~0,4%
- call :Debug "文件夹名字的递增"
- For /L %%i in (1,1,2048) Do (
- If Not Exist "File-%%i\" (
- Md "File-%%i\" >Nul 2>Nul
- Set EnCodeDir=File-%%i\
- Set Num=%%i
- @Goto :EnCode
- )
- )
- call :Debug "文件夹超过2048"
- Echo.
- Echo. ^>^> 可分配的内存已经占满,无法加密...
-
- @Goto :Main
-
- :EnCode
-
- Set "Choice="
- call :Debug "判断文件是否是批处理"
- If /I Not "%FilenameExtension%"==".Bat" (
- call :Debug "不是.bat文件"
- If /I Not "%FilenameExtension%"==".Cmd" (
- call :Debug "不是.Cmd文件"
- @Goto :Choice
- )
- )
- call :Debug "B变量设置"
- For /L %%i in (1,1,47) Do Call :RepeatBS
- call :Debug "绘图"
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "正在加密"
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
- call :Debug "[信息]"
- Echo.
- Echo. 开始加密时间: %Time%
- Echo.
- Echo. 文件名: %FileName%
- Echo.
- call :Debug "加密过程"
- Cd %EnCodeDir%
-
- Copy %FileName% "%cd%\File.Bat" > Nul
-
- For /F %%i in ('dir /b File.Bat') do (
- For /L %%j in (0,2362,%%~zi) do (
- call :Debug for返回%%j,最后会返回%%~zi
- Set /P Bytes[FileName]=%Bs% 文件大小: %%j Byte[s] <Nul
- )
- Set /P Bytes[FileName]=%Bs% 文件大小: %%~zi Byte[s] <Nul
- )
- Echo.
-
- Call :VBScript_EnCode
- call :Debug "打开EnCode.VBS,并等待运行结束"
- Start /W "" "EnCode.VBS"
- call :Debug "删除EnCode.VBS"
- Del /f "EnCode.VBS" >nul 2>nul
- call :Debug "写入EnCode.Bat"
- >> "EnCode.Bat" Echo.
- >> "EnCode.Bat" Echo.Cls
- Type "File.Bat" >> "EnCode.Bat"
- call :Debug "删除File.Bat"
- Del /f "File.Bat" >nul 2>nul
- call :Debug "[信息]"
- Echo.
- Echo. 加密后的文件: "%Cd%\EnCode.Bat"
- Echo.
-
- For /F %%i in ('dir /b EnCode.Bat') do (
- For /L %%j in (0,2362,%%~zi) do (
- call :Debug for返回%%j,最后会返回%%~zi
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%j Byte[s] <Nul
- )
- Set /P Bytes[FileName]=%Bs% 加密后的大小: %%~zi Byte[s] <Nul
- )
- Echo.
-
- call :Debug "返回加密时间"
- Echo.
- Echo. 加密结束时间: %Time%
- call :Debug "绘图"
- Echo.
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
- call :Debug "Msg"
- Mshta VBScript:msgbox("加密%FileName:~1,-1%文件成功",64,"Hope(R) Office EasyCommand EasyEnCode [Version %Version%]")(window.close)
- call :Debug 用资源管理器打开%CD%
- Start Explorer "%Cd%"
- call :Debug "用记事本打开EnCode.Bat"
- Start "" "Notepad" "EnCode.Bat"
- call :Debug "加密完毕"
- Echo.
- Echo. ^>^> 加密完毕,是否要调试?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# >> "
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "+"
- Call :Type "=" 4
- Call :Type "=" 8
- Call :Type "=" 4
- Call :Type "+"
- Call :Type "=" 98
- Echo.
-
- If /I Not "%Choice%"=="Y" (
- call :Debug "返回上一级"
- Cd..
- @Goto :Main
- )
- call :Debug "运行EnCode.Bat"
- Start "" "EnCode.Bat"
-
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Call :Type " "
- Call :Type "_" 4
- Call :Type "Code"
- Call :Type "_" 108
- Echo.
- Echo.
- call :Debug "逐屏显示输出内容"
- More "EnCode.Bat"
-
- Echo.
- call :Debug "绘图"
- Call :Type " "
- Call :Type "_" 116
- Echo.
- Echo.
-
- Cd..
-
- @Goto :Main
-
- :RepeatBS
- call :Debug "Bs的设置"
- Set "Bs=%Bs%"
- @Goto :Eof
-
- :Type <Text> [Num]
- call :Debug "绘图引擎"
- %=Company {Hope Studio}=%
-
- %=Author {Hope Studio}=%
-
- If '%2'=='' (
- Set /p Text=#%~1<Nul
- @Goto :Eof
- )
- If Not '%2'=='' (
- For /l %%I in (1,1,%2) Do (
- Set /p Text=#%~1<Nul
- )
- )
-
- @Goto :Eof
-
- :VBScript_EnCode
- call :Debug "写入EnCode.VBS"
- > EnCode.VBS Echo.Function WriteTextFile(strPath, text)
- >> EnCode.VBS Echo.With CreateObject("ADODB.Stream")
- >> EnCode.VBS Echo..Open
- >> EnCode.VBS Echo..type = 2
- >> EnCode.VBS Echo..WriteText text
- >> EnCode.VBS Echo..SaveToFile strPath
- >> EnCode.VBS Echo..close()
- >> EnCode.VBS Echo.End With
- >> EnCode.VBS Echo.End Function
- >> EnCode.VBS Echo.
- >> EnCode.VBS Echo.Dim EnCode
- >> EnCode.VBS Echo.EnCode=WriteTextFile("EnCode.Bat","")
- call :Debug "写入EnCode.VBS结束"
- @Goto :Eof
-
- :Choice
- call :Debug "[提示信息]"
- Echo.
- Echo. ^>^> 此文件不是批处理文件,是否要加密?[Y/N][输入完毕后请按下回车]
- Echo.
- Set /p "Choice=# >> "
- If /I Not "%Choice%"=="Y" (
- @Goto :Main
- )
- call :Debug "变量FilenameExtension=.Bat"
- Set "FilenameExtension=.Bat"
- @Goto :EnCode
-
- goto :eof
- :Debug
- if %debug%==1 (
- set /P= 调试:%~1<nul
- echo;
- )
- goto :eof
复制代码
作者: cmd1152 时间: 2021-10-11 12:49
本帖最后由 cmd1152 于 2021-10-11 18:14 编辑
复制代码
>>不用转义
作者: cmd1152 时间: 2021-10-11 21:22
以前写的,和这个差不多是一样的,都是更改文件开头编码声明,但我这个能解密
http://www.bathome.net/viewthrea ... 6%C0%ED%BC%D3%C3%DC
作者: cmd1152 时间: 2021-10-11 21:25
你这个好像是不可逆的,能安全保护批处理
作者: xp3000 时间: 2021-10-12 16:53
回复 27# cmd1152
并不是不可逆的,这个是没有混淆可以查看
作者: cmd1152 时间: 2021-10-12 17:06
回复 28# xp3000
升级成 混淆 的试试
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |