Board logo

标题: [原创]批处理调用系统“打开文件”对话框-exe挟持 [打印本页]

作者: weasel     时间: 2009-5-12 13:42    标题: [原创]批处理调用系统“打开文件”对话框-exe挟持

存为xxxx.bat
@echo off
echo.================================================
echo       exe挟持又一法,请选择要挟持的EXE文件
echo.================================================
Call :FileOpen_vbs
for /f "delims=" %%a in ('cscript.exe //nologo FileOpen.vbs') do set strFolder=%%a
>"%strFolder%.MANIFEST" echo 挟持!!
echo.%strFolder%文件已经被挟持!!&&pause&&del FileOpen.vbs&&goto :eof
:FileOpen_vbs
>FileOpen.vbs echo set objFile = CreateObject("SAFRCFileDlg.FileOpen")
>>FileOpen.vbs echo intRet = objFile.OpenFileOpenDlg
>>FileOpen.vbs echo if intret then
>>FileOpen.vbs echo Wscript.Echo objFile.filename
>>FileOpen.vbs echo wscript.quit
>>FileOpen.vbs echo end if
goto :eof

作者: s11ss     时间: 2009-5-13 03:43
manifest?
作者: weasel     时间: 2009-5-13 13:05
目录下新建一个文件或文件夹,命名为"程序名字.EXE.MANIFEST",和exe文件同名从而禁止exe文件运行
作者: qinchun36     时间: 2009-7-6 09:19
受教了 , 原来 manifest 是干这个用的 !!
作者: Hanyeguxing     时间: 2009-7-6 13:56


  Quote:
Originally posted by weasel at 2009-5-13 13:05:
目录下新建一个文件或文件夹,命名为"程序名字.EXE.MANIFEST",和exe文件同名从而禁止exe文件运行

要是我在这个.manifest里写入例如这些呢:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="*" version="5.1.0.0" type="win32" name="Microsoft.Windows.Shell.shell32"/>     <description>Windows Shell</description>  <dependency>                              <dependentAssembly>                   <assemblyIdentity                 type="win32"                name="Microsoft.Windows.Common-Controls" version="6.0.0.0"           publicKeyToken="6595b64144ccf1df" language="*"                processorArchitecture="*"   />                                </dependentAssembly>                  </dependency>                             </assembly>                              

作者: kinglzk2000     时间: 2009-9-12 10:18
e 这个感觉不错 。。
作者: 523066680     时间: 2009-9-12 10:31
1.经典灌水句子:学习了!

2.重定向改进

  Quote:
( echo,set objFile = CreateObject^("SAFRCFileDlg.FileOpen"^)
echo,intRet = objFile.OpenFileOpenDlg
echo,if intret then
echo,Wscript.Echo objFile.filename
echo,wscript.quit
echo,end if)>fileopen.vbs

[ Last edited by 523066680 on 2009-9-12 at 10:35 ]
作者: Hanyeguxing     时间: 2009-9-12 10:58
这个方法不是对所有exe都好用的,例如winrar,内置了.manifest就不可以这样用。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
  version="1.0.0.0"
  processorArchitecture="X86"
  name="WinRAR"
  type="win32"/>
<description>WinRAR archiver</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>
<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="6.0.0.0"
      processorArchitecture="X86"
      publicKeyToken="6595b64144ccf1df"
      language="*"/>
  </dependentAssembly>
</dependency>
</assembly>