Settings

Theme

Gzip and Zip File Extraction from stdin

2 points by textmode 3 years ago · 0 comments · 1 min read


   /* 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);}

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection