南瓜园

 找回密码
 注册
查看: 1148|回复: 0

chm文件反编译器

[复制链接]
发表于 2010-9-12 11:00:52 | 显示全部楼层 |阅读模式
:: chm文件反编译器 V1.2
:: code by namejm 2007.12.27~2008.3.13 bbs.bathome.cn CMD@XP
::
:: 功能:
::   单个/批量反编译chm文件,并保持资源的原始结构。
:: 使用方式有两种:
::     ① 把单个或指定个数的文件直接拖放到本程序。
::     ② 直接双击运行。此时处理的是当前目录下所有以.chm为后缀的文件
:: 执行过程及处理效果:
::   因为 hh -decompile 语句不能使用引号,所以,先把原始资源释放到
:: 短文件名格式的文件夹中,释放完毕后再改名;
::   两种执行方式都有简单的容错处理;反编译后的资源放在单独的文件夹
:: 中,此文件夹位于当前目录,并以chm文件名命名。
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set TT=chm文件反编译器 1.2
echo.&echo.&echo     正在反编译CHM文件,请稍候...
cd /d "%~dp0"
:: 以拖动文件到批处理文件上的方式运行批处理时,%cd% 的值将会强制转换为
:: %homepath%,因此,上一条语句非常关键!
del /a /f 伪chm文件列表.txt 2>nul
if "%~1"=="" goto All
:Some
title %TT%-正在处理"%~nx1"
if /i not "%~x1"==".chm" (
    cls
    echo.&echo.&echo    "%~nx1"不是chm文件
    echo.&set /p=    请按任意键继续...
    cls
    echo.&echo.&echo     正在反编译CHM文件,请稍候...
    shift
    if "%~2"=="" exit
    goto Some
)
if not "%~1"=="" (
    title %TT%-正在处理"%~nx1"
    rd /q /s "%~n1" 2>nul
    hh -decompile %~sn1 %~snx1
    if not exist %~sn1 (
        echo "%~nx1">>伪chm文件列表.txt
    ) else (
        ren %~sn1 "%~n1" 2>nul
    )
    shift
    if not "%~2"=="" goto Some
)
exit
:All
for /f "delims=" %%i in ('dir /a-d /b *.chm 2^>nul') do (
    title %TT%-正在处理"%%~nxi"
    rd /q /s "%%~ni" 2>nul
    hh -decompile %%~sni %%~snxi
    if not exist %%~sni (
        echo "%%~nxi">>伪chm文件列表.txt
    ) else (
        ren %%~sni "%%~ni" 2>nul
    )
您需要登录后才可以回帖 登录 | 注册

本版积分规则

请大家牢记南瓜园网址 www.nan2008.com

QQ|小黑屋|手机版|Archiver|南瓜园

GMT+8, 2024-9-23 22:27 , Processed in 0.104946 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表