本帖最后由 smss 于 2019-6-25 21:11 编辑
- dir /b /a-h /s "%1" | find "manifest.xml" 1>nul 2>nul&&set /p H=输入任意字符混淆代码,按回车不混淆代码:
- (for /f "delims=" %%b in ('dir /b /a-h /s "%1\*.xml"') do (set "P=%%~dpb"
- cd /d "%~dp0"
- copy "%%b" "%~dp0manifest.xml"
- if /i "%%~nxb"=="config.xml" (if "%H%" NEQ "" (copy "%%~dpbconfig.xml" "%~dp0config.xml")
- )
-
- if /i "%%~nxb"=="manifest.xml" (if "%H%" NEQ "" (powershell.exe -command "&{%~dp0混淆代码.ps1}")
- PowerShell -exec ByPass "&'%~dp0同步后缀.ps1'" "!P:~,-1!") else (PowerShell -exec ByPass "&'%~dp0注释空行.ps1'")
-
- if "%H%" NEQ "" (if exist "%~dp0config.xml" (move "%~dp0config.xml" "%%~dpbconfig.xml"
- del "%~dp0config.xml"
- attrib "%%~dpbconfig.xml" +h)
- )
- move "%~dp01.xml" "%%b"&attrib "%%b" +h
- ))1>nul 2>nul &&echo 所有代码处理完毕||echo 无需处理完美跳过!
复制代码 文件目录结构如下
manifest.xml文件所在文件夹下可能有config.xml
H不等于"" 执行"混淆代码.ps1"+"同步后缀.ps1"
等于"" 时仅执行"同步后缀.ps1"
再对其它xml(含config.xml)名称不等于manifest.xml执行"注释空行.ps1"
处理后 再移动回去 并加隐藏- @echo off
- dir /b /a-h /s "%1" | find "manifest.xml" 1>nul 2>nul&&set /p H=输入任意字符混淆代码,按回车不混淆代码:
- echo ---------------------------------所有manifest.xml-----------------------------------------
- for /f "delims=" %%b in ('dir /b /a-h /s "%1\*manifest.xml"') do (set "P=%%~dpb"
- copy "%%b" "%~dp0manifest.xml"
- cd /d "%~dp0"
- if "%H%" NEQ "" (if exist "%%~dpbconfig.xml" (copy "%%~dpbconfig.xml" "%~dp0config.xml")
- powershell.exe -command "&{%~dp0混淆代码.ps1}")
- PowerShell -exec ByPass "&'%~dp0同步后缀.ps1'" "!P:~,-1!"
- move "%~dp01.xml" "%%b"
- attrib "%%b" +h
- if "%H%" NEQ "" (if exist "%~dp0config.xml" (move "%~dp0config.xml" "%%~dpbconfig.xml"
- attrib "%%~dpbconfig.xml" +h))
- )
- pause
-
- echo ------------------------------------所有.xml-----------------------------------------
- for /f "delims=" %%a in ('dir /b /a-h /s "%1\*.xml"') do (
- if /i "%%~nxa" NEQ "manifest.xml" (copy "%%a" "%~dp0manifest.xml"
- cd /d "%~dp0"
- PowerShell -exec ByPass "&'%~dp0注释空行.ps1'"
- move "%~dp01.xml" "%%a"
- attrib "%%a" +h
- ))
- pause
复制代码
|