最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I create a zip file that would decompress into an enormous file? - Stack Overflow

programmeradmin2浏览0评论

I want to create a .zip file that would, theoretically, decompress into a .txt file containing a terabyte of '7's. I obviously can't create the file and compress it myself without a terabyte of memory, so I'm looking for a way to create a .zip file of only a few '7's and modify it somehow.

I've been studying the zip standard and the hex dumps of some small, zipped files, but I haven't been able to pick out a pattern.

I want to create a .zip file that would, theoretically, decompress into a .txt file containing a terabyte of '7's. I obviously can't create the file and compress it myself without a terabyte of memory, so I'm looking for a way to create a .zip file of only a few '7's and modify it somehow.

I've been studying the zip standard and the hex dumps of some small, zipped files, but I haven't been able to pick out a pattern.

Share Improve this question asked Feb 6 at 1:59 kubleekakubleeka 113 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Answering the title question, one way is to overlap zip entries. See David Fifield's zip bomb.

I obviously can't create the file and compress it myself without a terabyte of memory

You can certainly create a zip file with a giant entry, without having to have a file on your system with that entry, or need a large amount of memory. zip can take input from stdin:

    head -c 1099511627776 /dev/zero | tr \\0 7 | zip big.zip -

You'll need to be very patient, and have room for a gigabyte zip file.

发布评论

评论列表(0)

  1. 暂无评论