首页
社区
课程
招聘
对UPX的一些想法
2004-7-7 21:56 7697

对UPX的一些想法

2004-7-7 21:56
7697
加壳软件发展到今天,各种加壳技术层出不穷,作为后起之秀,似乎现在任何一个软件都能超越UPX,但我一直认为UPX还是最好的packer。特别之处是UPX是开放源码的,可是这么长时间,我也没发现有人研究UPX源码的文章,不知道这里有没有人感兴趣写一些这方面的文章,由于他的源码是跨平台,特别复杂,有没有高人能将其中的win32平台的代码rip出来,否则研读起来真的很费劲!

阿里云助力开发者!2核2G 3M带宽不限流量!6.18限时价,开 发者可享99元/年,续费同价!

收藏
点赞2
打赏
分享
最新回复 (22)
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-7 22:35
2
0
。。。
到z0mbie主页看看吧
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 09:58
3
0
换了N个代理还是无法访问,请给个代理,最好还能访问cjb.net
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 10:42
4
0
我的家底都快贴完了。。。
216.157.225.36:8080
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 10:51
5
0
哈哈,在我的强攻下,forgot小弟弟只能。。。。

thx,不过你的代理不管用,我的ADSL还是无法访问,怀念我的宽带时代。。。郁闷中,或者你给个转换过的域名吧,转换后一般直接就可以访问了
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 10:54
6
0
DNS?偶不会。。。靠代理上没法ping
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 10:57
7
0
干脆你把那个reverse 的UPX贴到这里算了,等。。。
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 11:01
8
0
freenrv2[b,d,e] & upx for code snippets
  =======================================

  1. lz encoding

     Lempel-Ziv encoding replaces repeated strings with (offset,length) codes.

     If we cant find duplicated string, we encode character itself.

     Both string and character in the packed stream are prefixed with one bit
     of data, indicating what kind of code is it.

     As such, we lose one bit when we encode character,
     but we achieve some compression when we replace duplicated string
     with (offset,length) code.

     Depending on algorithm modification,
     offset and/or length can be limited or not,
     and can be encoded using fixed and/or variable-length codes.

     The most interesting part of this class of algorithms is that if we will
     simply encode longest found strings (v1), we will not
     achieve the best compression ratio.

     Here is an example (spaces are used just for readability):

       Lets assume that (offset,length) code uses 1 bit for prefix,
       8 bits for offset and 4 bits for length,
       so it all uses 1+8+4=13 bits,
       and encoded character uses 1+8=9 bits of data.

                   data                                         length in bits
                   -------------------------------------------  --------------
       unpacked:   abc bcdefgh abcdefgh                         18*8     = 144
       packed (v1) abc (1,2#bc#) defgh (0,3#abc#) (5,5#defgh#)  8*9+3*13 = 111
       packed (v2) abc (1,2#bc#) defgh a (3,7#bcdefgh#)         9*9+2*13 = 107

     As you can see, scanning for longest repeated strings
     is not the best packing strategy.

  2. nrv2[b,d,e] algorithms (used by the UPX, binary distribution)

     Both algorithms differs by the format of the (offset,length)
     encoding.

     While encoding offset/length, numbers are divided into two parts:
     1st part is encoded as a fixed length code, 2nd part is encoded
     as a variable-length code.

     Also, if current offset matchs previous offset, it is encoded using
     just two bits.

  3. freenrv2b algorithm (see nrv2b.zip && nrv2bde.zip)

     This is nrv2b-compatible algorithm, difference is only in the compression
     method.

     We try to achieve "ideal" compression ratio, not taking into account
     compression time.

     Note, that such an ideality is limited by the algorithm and
     (offset,length)-encoding specifics, and other algorithms
     can achieve better ratio, for sure.

     Using kind of optimized brute force, we try all the possible
     variants. (see v1,v2 in the example above)

  4. upx for code snippets (see snupx.zip)

     Given some code snippet (32-bit x86 code without any headers),
     we try nrv2b,d,e methods and choose the best one.

     Then we produce the following code ("p" (packed) option):

       call X
       <packed data>
       X:
       pop esi
       sub esp, ALIGN4(unpacked_data_size)
       mov edi, esp
       <nrv2[b,d,e] decompressor code>
       jmp esp

     As such, we generate compressed, self-extracting code snippet.

     When "x" (xored) or "px" (packed+xored) options are specified,
     we also add "unxor" layer, which hides zero/cr/lf/slash characters.

  5. upx for code snippets/special edition (see snupxs.zip)

     This is the the same tool as previous one,
     except that only "p" option is supported,
     and instead of nrv2[b,d,e] algorithms we try
     their modifications (some of these modifications are equal to
     nrv2b,d,e algorithms), i.e. we generate (offset,length)-codes format
     and corresponding decompressor code on-the-fly.

     This is even more slow, but improves compression ratio, sometimes 10%+

  6. what for?

     The only idea was to compress some code snippets, such as shellcodes,
     engines, etc.

     Since in such a cases data length is only some kilobytes,
     compression time is not important, even when it grows as N*N,
     while making shellcode some bytes smaller always looks nice.
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 11:02
9
0
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 11:14
10
0
最初由 forgot 发布
点击下载:附件!snupxs300.rar_1089255758.rar
豁出去了


豁出去了?这样说想必你的project里的解压缩引擎是不是也参考这个的,哈哈!
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 11:14
11
0
我哪里有什么project...
雪    币: 279
活跃值: (375)
能力值: ( LV9,RANK:250 )
在线值:
发帖
回帖
粉丝
lordor 6 2004-7-8 12:13
12
0
foget,老底都翻完了?
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 12:15
13
0
混了这么久...再写错我的名我就真完了
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
intargent 2004-7-8 12:18
14
0
谢谢forgot(没写错吧),我下了:D
雪    币: 279
活跃值: (375)
能力值: ( LV9,RANK:250 )
在线值:
发帖
回帖
粉丝
lordor 6 2004-7-8 13:28
15
0
forgot,好像是写错了,sorry
看了一下那个:点击下载:附件!snupxs300.rar_1089255758.rar
可以用VC7编译,可是这个东西效率太低了吧,压一个50多K的东西,半天时间
雪    币: 260
活跃值: (81)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
pll621 2004-7-8 13:56
16
0
最初由 dREAMtHEATER 发布
换了N个代理还是无法访问,请给个代理,最好还能访问cjb.net

受不了dt了,用这个吧
202.64.73.194:80
81.suaa.snfc.snfccafj.dsl.att.net:80
218.103.122.183:3128
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 14:28
17
0
老妖终于来了!!!!!!!
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 14:34
18
0
还是没有一个能访问的,郁闷中..........
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 14:41
19
0
老妖都看不过dt的bt行径:D
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 14:48
20
0
QQ代理公布器XP
雪    币: 255
活跃值: (165)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dREAMtHEATER 2004-7-8 17:02
21
0
我到专门的代理网站查了很多代理,没有一个能用的,原来一试准灵,现在不知道为什么就不行了,靠!难道你们都能访问就我不成
雪    币: 6073
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2004-7-8 17:14
22
0
最初由 dREAMtHEATER 发布
我到专门的代理网站查了很多代理,没有一个能用的,原来一试准灵,现在不知道为什么就不行了,靠!难道你们都能访问就我不成

"god damn this abnormal man...so he can't use the proxy"
                                            -- forgot
:D :D :D
雪    币: 109
活跃值: (36)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
pll823 2004-7-8 17:15
23
0
给你一个可用的超级代理,6小时有效,goodmorning提供

使用方法:直接在地址栏输入:

https://141.154.122.147/
游客
登录 | 注册 方可回帖
返回