游戏乐悠悠网游开发网

 找回密码
 立即注册
查看: 2785|回复: 6
打印 上一主题 下一主题

[工具源码] UnPackTool工具运行错误原因

[复制链接]
  • TA的每日心情
    擦汗
    2014-7-21 21:38
  • 签到天数: 7 天

    [LV.3]偶尔看看II

    鲜花(0) 鸡蛋(0)
    楼主
    发表于 2014-7-8 06:59:59 | 显示全部楼层
    1. #include "stdafx.h"
    2. #include "ZipArchive/ZipArchive.h"
    3. #include <iostream>
    4. #include <list>
    5. #include <string>
    6. #include <sstream>

    7. const char* const PACK_PASSWORD = "#7qlcRkfanwlrodldi#";

    8. int main(int argc, char *argv[])
    9. {
    10.         try
    11.         {
    12.                 for (int i = 1; i < argc; i++)
    13.                 {
    14.                         CZipArchive mZip;

    15.                         // Nome do arquivo que irá ser extraido
    16.                         char msg[2048] = "";
    17.                         sprintf(msg, "Extraindo arquivo: %s.", argv[i]);
    18.                         std::cout << msg << std::endl;
    19.                         mZip.Open(argv[i], CZipArchive::zipOpen);
    20.                         mZip.SetPassword(PACK_PASSWORD);
    21.                         for (int x = 0; x < mZip.GetCount(); ++x)
    22.                         {
    23.                                 CZipFileHeader header;
    24.                                 mZip.GetFileInfo(header, static_cast<WORD>(x));
    25.                                 if (header.IsDirectory())
    26.                                         continue;
    27.                                 printf("Extraindo: %s\n", header.GetFileName().c_str());
    28.                                 mZip.ExtractFile(x, "output");
    29.                         }
    30.                         mZip.Close();
    31.                 }
    32.         }

    33.         catch( CZipBaseException & ex )
    34.         {
    35.                 std::cout << ex.what() << std::endl;
    36.         }

    37.         return 0;
    38. }
    复制代码
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    小黑屋|手机版|Archiver|Online Game Xingbarking Dev Team  

    GMT+8, 2024-5-17 13:11 , Processed in 0.139792 second(s), 30 queries .

    Powered by Discuz! X3.2 Licensed

    © 2001-2013 Comsenz Inc.

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