亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? packer.cpp

?? UPX 源代碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/* packer.cpp --   This file is part of the UPX executable compressor.   Copyright (C) 1996-2007 Markus Franz Xaver Johannes Oberhumer   Copyright (C) 1996-2007 Laszlo Molnar   All Rights Reserved.   UPX and the UCL library are free software; you can redistribute them   and/or modify them under the terms of the GNU General Public License as   published by the Free Software Foundation; either version 2 of   the License, or (at your option) any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; see the file COPYING.   If not, write to the Free Software Foundation, Inc.,   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.   Markus F.X.J. Oberhumer   Laszlo Molnar   markus@oberhumer.com      ml1050@users.sourceforge.net *///#define WANT_STL#include "conf.h"#include "file.h"#include "packer.h"#include "filter.h"#include "linker.h"#include "ui.h"/*************************************************************************//**************************************************************************/Packer::Packer(InputFile *f) :    bele(NULL),    fi(f), file_size(-1), ph_format(-1), ph_version(-1),    uip(NULL), linker(NULL),    last_patch(NULL), last_patch_len(0), last_patch_off(0){    if (fi != NULL)        file_size = fi->st_size();    uip = new UiPacker(this);    memset(&ph, 0, sizeof(ph));}Packer::~Packer(){    delete uip; uip = NULL;    delete linker; linker = NULL;}// for PackMastervoid Packer::assertPacker() const{    assert(getFormat() > 0);    assert(getFormat() <= 255);    assert(getVersion() >= 11);    assert(getVersion() <= 14);    assert(strlen(getName()) <= 13);    // info: 32 is limit for show_all_packers() in help.cpp    assert(strlen(getFullName(opt)) <= 28);    assert(strlen(getFullName(NULL)) <= 28);    if (bele == NULL) fprintf(stderr, "%s\n", getName());    assert(bele != NULL);#if 1    Linker *l = newLinker();    if (bele != l->bele) fprintf(stderr, "%s\n", getName());    assert(bele == l->bele);    delete l;#endif}/*************************************************************************// public entries called from class PackMaster**************************************************************************/void Packer::doPack(OutputFile *fo){    uip->uiPackStart(fo);    pack(fo);    uip->uiPackEnd(fo);}void Packer::doUnpack(OutputFile *fo){    uip->uiUnpackStart(fo);    unpack(fo);    uip->uiUnpackEnd(fo);}void Packer::doTest(){    uip->uiTestStart();    test();    uip->uiTestEnd();}void Packer::doList(){    uip->uiListStart();    list();    uip->uiListEnd();}void Packer::doFileInfo(){    uip->uiFileInfoStart();    fileInfo();    uip->uiFileInfoEnd();}/*************************************************************************// default actions**************************************************************************/void Packer::test(){    unpack(NULL);}void Packer::list(){    uip->uiList();}void Packer::fileInfo(){    // FIXME: subclasses should list their sections here    // We also should try to get a nice layout...}bool Packer::testUnpackVersion(int version) const{    if (version != ph_version && ph_version != -1)        throwCantUnpack("program has been modified; run a virus checker!");    if (!canUnpackVersion(version))        throwCantUnpack("I am not compatible with older versions of UPX");    return true;}bool Packer::testUnpackFormat(int format) const{    if (format != ph_format && ph_format != -1)        throwCantUnpack("program has been modified; run a virus checker!");    return canUnpackFormat(format);}bool ph_skipVerify(const PackHeader &ph){    if (M_IS_DEFLATE(ph.method))        return false;    if (M_IS_LZMA(ph.method))        return false;    if (ph.level > 1)        return false;    return true;}/*************************************************************************// compress - wrap call to low-level upx_compress()**************************************************************************/bool Packer::compress(upx_bytep i_ptr, unsigned i_len, upx_bytep o_ptr,                      const upx_compress_config_t *cconf_parm){    ph.u_len = i_len;    ph.c_len = 0;    assert(ph.level >= 1); assert(ph.level <= 10);    // Avoid too many progress bar updates. 64 is s->bar_len in ui.cpp.    unsigned step = (ph.u_len < 64*1024) ? 0 : ph.u_len / 64;    // save current checksums    ph.saved_u_adler = ph.u_adler;    ph.saved_c_adler = ph.c_adler;    // update checksum of uncompressed data    ph.u_adler = upx_adler32(i_ptr, ph.u_len, ph.u_adler);    // set compression paramters    upx_compress_config_t cconf; cconf.reset();    if (cconf_parm)        cconf = *cconf_parm;    // cconf options    if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))    {        if (opt->crp.crp_ucl.c_flags != -1)            cconf.conf_ucl.c_flags = opt->crp.crp_ucl.c_flags;        if (opt->crp.crp_ucl.p_level != -1)            cconf.conf_ucl.p_level = opt->crp.crp_ucl.p_level;        if (opt->crp.crp_ucl.h_level != -1)            cconf.conf_ucl.h_level = opt->crp.crp_ucl.h_level;        if (opt->crp.crp_ucl.max_offset != UINT_MAX && opt->crp.crp_ucl.max_offset < cconf.conf_ucl.max_offset)            cconf.conf_ucl.max_offset = opt->crp.crp_ucl.max_offset;        if (opt->crp.crp_ucl.max_match != UINT_MAX && opt->crp.crp_ucl.max_match < cconf.conf_ucl.max_match)            cconf.conf_ucl.max_match = opt->crp.crp_ucl.max_match;#if defined(WITH_NRV)        if (ph.level >= 7 || (ph.level >= 4 && ph.u_len >= 512*1024))            step = 0;#endif    }    if (M_IS_LZMA(ph.method))    {        oassign(cconf.conf_lzma.pos_bits, opt->crp.crp_lzma.pos_bits);        oassign(cconf.conf_lzma.lit_pos_bits, opt->crp.crp_lzma.lit_pos_bits);        oassign(cconf.conf_lzma.lit_context_bits, opt->crp.crp_lzma.lit_context_bits);        oassign(cconf.conf_lzma.dict_size, opt->crp.crp_lzma.dict_size);        oassign(cconf.conf_lzma.num_fast_bytes, opt->crp.crp_lzma.num_fast_bytes);    }    if (M_IS_DEFLATE(ph.method))    {        oassign(cconf.conf_zlib.mem_level, opt->crp.crp_zlib.mem_level);        oassign(cconf.conf_zlib.window_bits, opt->crp.crp_zlib.window_bits);        oassign(cconf.conf_zlib.strategy, opt->crp.crp_zlib.strategy);    }    if (uip->ui_pass >= 0)        uip->ui_pass++;    uip->startCallback(ph.u_len, step, uip->ui_pass, uip->ui_total_passes);    uip->firstCallback();    //OutputFile::dump("data.raw", in, ph.u_len);    // compress    int r = upx_compress(i_ptr, ph.u_len, o_ptr, &ph.c_len,                         uip->getCallback(),                         ph.method, ph.level, &cconf, &ph.compress_result);    //uip->finalCallback(ph.u_len, ph.c_len);    uip->endCallback();    if (r == UPX_E_OUT_OF_MEMORY)        throwOutOfMemoryException();    if (r != UPX_E_OK)        throwInternalError("compression failed");    if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))    {        const ucl_uint *res = ph.compress_result.result_ucl.result;        //ph.min_offset_found = res[0];        ph.max_offset_found = res[1];        //ph.min_match_found = res[2];        ph.max_match_found = res[3];        //ph.min_run_found = res[4];        ph.max_run_found = res[5];        ph.first_offset_found = res[6];        //ph.same_match_offsets_found = res[7];        if (cconf_parm)        {            assert(cconf.conf_ucl.max_offset == 0 || cconf.conf_ucl.max_offset >= ph.max_offset_found);            assert(cconf.conf_ucl.max_match == 0 || cconf.conf_ucl.max_match >= ph.max_match_found);        }    }    //printf("\nPacker::compress: %d/%d: %7d -> %7d\n", ph.method, ph.level, ph.u_len, ph.c_len);    if (!checkCompressionRatio(ph.u_len, ph.c_len))        return false;    // return in any case if not compressible    if (ph.c_len >= ph.u_len)        return false;    // update checksum of compressed data    ph.c_adler = upx_adler32(o_ptr, ph.c_len, ph.c_adler);    // Decompress and verify. Skip this when using the fastest level.    if (!ph_skipVerify(ph))    {        // decompress        unsigned new_len = ph.u_len;        r = upx_decompress(o_ptr, ph.c_len, i_ptr, &new_len, ph.method, &ph.compress_result);        if (r == UPX_E_OUT_OF_MEMORY)            throwOutOfMemoryException();        //printf("%d %d: %d %d %d\n", ph.method, r, ph.c_len, ph.u_len, new_len);        if (r != UPX_E_OK)            throwInternalError("decompression failed");        if (new_len != ph.u_len)            throwInternalError("decompression failed (size error)");        // verify decompression        if (ph.u_adler != upx_adler32(i_ptr, ph.u_len, ph.saved_u_adler))            throwInternalError("decompression failed (checksum error)");    }    return true;}#if 0bool Packer::compress(upx_bytep in, upx_bytep out,                      const upx_compress_config_t *cconf){    return ph_compress(ph, in, out, cconf);}#endifbool Packer::checkDefaultCompressionRatio(unsigned u_len, unsigned c_len) const{    assert((int)u_len > 0);    assert((int)c_len > 0);    if (c_len >= u_len)        return false;    unsigned gain = u_len - c_len;    if (gain < 512)             // need at least 512 bytes gain        return false;#if 1    if (gain >= 4096)           // ok if we have 4096 bytes gain        return true;    if (gain >= u_len / 16)     // ok if we have 6.25% gain        return true;    return false;#else    return true;#endif}bool Packer::checkCompressionRatio(unsigned u_len, unsigned c_len) const{    return checkDefaultCompressionRatio(u_len, c_len);}bool Packer::checkFinalCompressionRatio(const OutputFile *fo) const{    const unsigned u_len = file_size;    const unsigned c_len = fo->getBytesWritten();    return checkDefaultCompressionRatio(u_len, c_len);}/*************************************************************************// decompress**************************************************************************/void ph_decompress(PackHeader &ph, const upx_bytep in, upx_bytep out,                   bool verify_checksum, Filter *ft){    unsigned adler;    // verify checksum of compressed data    if (verify_checksum)    {        adler = upx_adler32(in, ph.c_len, ph.saved_c_adler);        if (adler != ph.c_adler)            throwChecksumError();    }    // decompress    unsigned new_len = ph.u_len;    int r = upx_decompress(in, ph.c_len, out, &new_len, ph.method, &ph.compress_result);    if (r == UPX_E_OUT_OF_MEMORY)        throwOutOfMemoryException();    if (r != UPX_E_OK || new_len != ph.u_len)        throwCompressedDataViolation();    // verify checksum of decompressed data    if (verify_checksum)    {        if (ft)            ft->unfilter(out, ph.u_len);        adler = upx_adler32(out, ph.u_len, ph.saved_u_adler);        if (adler != ph.u_adler)            throwChecksumError();    }}void Packer::decompress(const upx_bytep in, upx_bytep out,                        bool verify_checksum, Filter *ft){    ph_decompress(ph, in, out, verify_checksum, ft);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女高潮久久久| eeuss国产一区二区三区| 国产亚洲综合色| 欧美色网站导航| 国产盗摄视频一区二区三区| 偷窥国产亚洲免费视频| 国产精品国产三级国产| 亚洲精品在线电影| 欧美日韩中字一区| 91丨九色丨蝌蚪富婆spa| 国产精一区二区三区| 日韩国产精品久久久久久亚洲| 亚洲欧洲一区二区在线播放| 久久久亚洲精品石原莉奈| 欧美绝品在线观看成人午夜影视| 99热在这里有精品免费| 国产麻豆91精品| 乱中年女人伦av一区二区| 亚洲电影一级黄| 又紧又大又爽精品一区二区| 国产精品私人影院| 久久久久久久久一| 精品理论电影在线| 在线综合视频播放| 欧美精品久久天天躁| 欧美色爱综合网| 欧美性一二三区| 欧美午夜电影网| 91久久精品网| 色综合网色综合| 色国产综合视频| 一本到不卡精品视频在线观看| 国产成人午夜片在线观看高清观看| 麻豆精品在线播放| 久久se这里有精品| 国产在线精品免费av| 久久97超碰色| 国产一区 二区 三区一级| 久久99国产精品久久99果冻传媒| 六月丁香婷婷色狠狠久久| 久久9热精品视频| 狠狠色综合日日| 国产精品亚洲成人| 粉嫩av一区二区三区在线播放 | 岛国精品一区二区| 国产自产2019最新不卡| 国产成人午夜精品影院观看视频| 国产成人精品三级麻豆| www.日本不卡| 色综合久久久网| 精品视频资源站| 欧美一区二区三区不卡| 精品成人一区二区| 国产精品国产自产拍在线| 亚洲免费av网站| 香蕉av福利精品导航 | 成人综合在线观看| 99久久夜色精品国产网站| 成人黄色软件下载| 在线观看视频一区二区欧美日韩| 欧美日韩国产综合视频在线观看| 日韩午夜在线影院| 久久天堂av综合合色蜜桃网| 国产精品私人影院| 亚洲成av人在线观看| 精品制服美女丁香| 国产成人av电影在线| 色综合天天综合在线视频| 欧美伦理视频网站| 久久人人爽爽爽人久久久| 国产精品久久久久久久久久免费看| 亚洲精品国产成人久久av盗摄| 午夜久久久久久久久| 国产麻豆91精品| 91成人免费电影| 2023国产精品自拍| 亚洲精品免费一二三区| 日韩精品电影在线观看| 成人黄色国产精品网站大全在线免费观看| 色哟哟一区二区三区| 欧美一级片在线| 国产精品日产欧美久久久久| 日韩高清中文字幕一区| 成人久久18免费网站麻豆| 91精品久久久久久久久99蜜臂| 国产亚洲一区字幕| 日韩国产精品久久久久久亚洲| 国产不卡视频在线观看| 69av一区二区三区| 中文字幕欧美一| 激情六月婷婷久久| 在线观看www91| 欧美国产激情二区三区 | 亚洲成年人网站在线观看| 国产美女精品在线| 欧美日韩国产精选| 国产精品青草久久| 久久爱www久久做| 欧美三级视频在线| 国产精品不卡一区二区三区| 奇米影视一区二区三区| 91免费观看视频| 国产亚洲美州欧州综合国| 性做久久久久久免费观看| 成人av第一页| 国产午夜精品久久久久久免费视| 日韩—二三区免费观看av| 在线观看视频91| 国产精品高清亚洲| 国产精品羞羞答答xxdd| 日韩一级精品视频在线观看| 亚洲成在线观看| 91在线精品一区二区| 欧美激情一区不卡| 国产美女精品在线| 精品欧美一区二区久久| 日韩精品福利网| 欧美精品少妇一区二区三区| 亚洲精品自拍动漫在线| thepron国产精品| 国产拍欧美日韩视频二区| 国产一区二区伦理片| 欧美成人激情免费网| 蜜桃传媒麻豆第一区在线观看| 欧美午夜精品理论片a级按摩| 亚洲精品你懂的| 91网站最新地址| 亚洲日本在线观看| 99久久精品免费精品国产| 中文字幕高清不卡| 丁香婷婷综合激情五月色| 久久男人中文字幕资源站| 韩国一区二区三区| 精品国产一区二区三区忘忧草| 麻豆成人av在线| 日韩欧美一级在线播放| 久久91精品久久久久久秒播| 日韩欧美三级在线| 国产乱码精品1区2区3区| 久久精品亚洲一区二区三区浴池| 国产成人综合网| 国产精品免费观看视频| 99在线视频精品| 亚洲一卡二卡三卡四卡| 欧美日韩一二三区| 免费成人你懂的| 欧美精品一区二区高清在线观看 | 麻豆免费看一区二区三区| 欧美tk—视频vk| 国产精品1024久久| 亚洲欧美日韩国产中文在线| 欧美网站一区二区| 美女视频免费一区| 久久精品男人天堂av| 97精品国产露脸对白| 亚洲综合视频在线| 日韩欧美国产午夜精品| 国产一区在线精品| 国产精品色哟哟网站| 欧美日韩电影在线| 麻豆国产欧美一区二区三区| 精品国产制服丝袜高跟| 不卡视频一二三四| 天堂影院一区二区| 国产视频一区不卡| 日本韩国精品一区二区在线观看| 亚洲狠狠爱一区二区三区| 在线电影院国产精品| 国产一区在线观看麻豆| 亚洲卡通动漫在线| 日韩视频一区二区在线观看| 国产成人av电影| 亚洲18影院在线观看| 久久嫩草精品久久久久| 91网站最新地址| 极品美女销魂一区二区三区免费 | 久久精品一区蜜桃臀影院| 99久久精品免费看| 免费精品视频最新在线| 自拍av一区二区三区| 日韩免费一区二区三区在线播放| 99国产精品久| 麻豆国产一区二区| 一区二区三区成人| 精品对白一区国产伦| 欧美伊人久久久久久久久影院 | 亚洲美女在线一区| 精品国产网站在线观看| 色8久久人人97超碰香蕉987| 国内精品在线播放| 亚洲成人先锋电影| 国产精品久久免费看| 日韩一区二区三区视频在线观看| 91视频91自| 国产成人精品亚洲日本在线桃色| 视频在线在亚洲| 一区二区三区四区在线| 国产欧美一区二区三区鸳鸯浴 | 亚洲欧美日韩久久精品| 欧美精品一区二区在线观看|