TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Gzip and Zip File Extraction from stdin
2 points
by
textmode
over 2 years ago
<p><pre><code> /* remove HTTP headers from multiple gzip or single zip from stdin */ int fileno(FILE *); #define jmp (yy_start) = 1 + 2 * #define echo do{if(fwrite(yytext,(size_t)yyleng,1,yyout)){}}while(0) xa "\x1f\x8b" /* GZIP magic number */ xb "\x50\x4B\x03\x04" /* ZIP magic number */ %s xa %option noyywrap noinput nounput %% {xa}|{xb} echo;jmp xa; <xa>"HTTP" jmp 0; <xa>.|\n echo; \n|. %% int main(){ yylex();exit(0);}</code></pre>
no comments
no comments