TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Gzip File Extraction from stdin

3 pointsby textmodealmost 4 years ago
Note only extracts the first GZIP file. How to decompress multiple, consecutive GZIP files on stdin from the network (HTTP&#x2F;1.1 pipelining)<p><pre><code> cat &gt; 054.l; int fileno(FILE *); #define jmp BEGIN #define echo ECHO xa &quot;\x1f\x8b&quot; &#x2F;* GZIP magic number *&#x2F; %s xa %option noyywrap noinput nounput %% {xa} echo;jmp xa; &lt;xa&gt;.|\n echo; \n|. %% int main(){ yylex();exit(0);} ^D flex -8Crf 054.l cc -pipe -static lex.yy.c -o yy054 example usage: printf &#x27;GET &#x2F;file.gz\r\nHost: example.com\r\nConnection: close\r\n\r\n&quot; |nc -vv example.com 80|yy054|zcat</code></pre>

1 comment

gus_massaalmost 4 years ago
Id would be better to start a blog to collect these post. Old post here have very low visibility.<p>Also in a blog you can classify them by subject, and are easier to link.