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 and Zip File Extraction from stdin

2 pointsby textmodeover 2 years ago
<p><pre><code> &#x2F;* remove HTTP headers from multiple gzip or single zip from stdin *&#x2F; int fileno(FILE *); #define jmp (yy_start) = 1 + 2 * #define echo do{if(fwrite(yytext,(size_t)yyleng,1,yyout)){}}while(0) xa &quot;\x1f\x8b&quot; &#x2F;* GZIP magic number *&#x2F; xb &quot;\x50\x4B\x03\x04&quot; &#x2F;* ZIP magic number *&#x2F; %s xa %option noyywrap noinput nounput %% {xa}|{xb} echo;jmp xa; &lt;xa&gt;&quot;HTTP&quot; jmp 0; &lt;xa&gt;.|\n echo; \n|. %% int main(){ yylex();exit(0);}</code></pre>

no comments

no comments