[ News ] [ Issues ] [ Authors ] [ Comments ] [ Search ] [ Stats ] [ Contact ]


..[ Phrack Magazine ]..
.:: PHRACK ISSUES ::.

Issues: [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ] [ 16 ] [ 17 ] [ 18 ] [ 19 ] [ 20 ] [ 21 ] [ 22 ] [ 23 ] [ 24 ] [ 25 ] [ 26 ] [ 27 ] [ 28 ] [ 29 ] [ 30 ] [ 31 ] [ 32 ] [ 33 ] [ 34 ] [ 35 ] [ 36 ] [ 37 ] [ 38 ] [ 39 ] [ 40 ] [ 41 ] [ 42 ] [ 43 ] [ 44 ] [ 45 ] [ 46 ] [ 47 ] [ 48 ] [ 49 ] [ 50 ] [ 51 ] [ 52 ] [ 53 ] [ 54 ] [ 55 ] [ 56 ] [ 57 ] [ 58 ] [ 59 ] [ 60 ] [ 61 ] [ 62 ] [ 63 ] [ 64 ] [ 65 ] [ 66 ] [ 67 ] [ 68 ]
Current issue : #50 | Release date : 09/04/1997 | Editor : daemon9
IntroductionPhrack Staff
Phrack LoopbackPhrack Staff
Line Noisevarious
Phrack Prophile on Aleph1Phrack Staff
Linux TTY hijackinghalflife
Juggernautroute
SNMP insecuritiesAlhambra
Cracking NT PasswordsNihil
SS7 Diverter plansMastermind
Skytel Paging and VoicemailpbxPhreak
Hardwire Interfacing under LinuxProfessor
PC Application Level SecuritySideshow Bob
DTMF signalling and decodingMr. Blue
DCO Operating Systemmrnobody
Phrack World NewsAlhambra
extract.cPhrack Staff
Title : extract.c
                                .oO Phrack 50 Oo.

                            Volume Seven, Issue Fifty

                                     16 of 16

                      extract.c by Phrack Staff and sirsyko


---------------------8<------------CUT-HERE----------->8---------------------
 
/*  extract.c by Phrack Staff and sirsyko 
 *
 *  Phrack Magazine, 1997 
 *
 *  Extracts textfiles from a specially tagged flatfile into a hierarchical 
 *  directory strcuture. Use to extract source code from any of the articles 
 *  in Phrack Magazine (first appeared in Phrack 50).
 *
 *  gcc -o extract extract.c
 *  
 *  ./extract filename   
 * 
 */   

 
#include <stdio.h>
#include <sys/stat.h>
#include <string.h>

int main(int argc, char **argv){ 

    char *s="<++> ",*e="<-->",b[256],*bp; 
    FILE *f,*o = NULL; 
    int l, n, i=0; 

    l = strlen(s); 
    n = strlen(e); 

    if(argc<2) {
        printf("Usage: %s <inputfile>\n",argv[0]);
        exit(1); 
    }

    if(! (f=fopen(argv[1], "r"))) {
        printf("Could not open input file.\n");
	exit(1);
    }

    while(fgets(b, 256, f)){ 

        if(!strncmp (b, s, l)){ 
	    b[strlen(b)-1] = '\0'; 

	    if((bp=strchr(b+l+1,'/')))
	        while (bp){ 
		    *bp='\0';
		    mkdir(b+l, 0700); 
		    *bp='/';
		    bp=strchr(bp+1,'/'); 
		}
	    if((o = fopen(b+l, "w"))) 
	        printf("- Extracting %s\n",b+l);
	    else {
		printf("Could not extract '%s'\n",b+l);
		exit(1);
	    }
	} 
        else if(!strncmp (b, e, n)){
	    if(o) fclose(o);
	    else {
	        printf("Error closing file.\n");
		exit(1);
	    }
        } 
        else if(o) {
            fputs(b, o);
            i++;
        }
    }
    if(!i) printf("No extraction tags found.\n");
    return(0);
}

---------------------8<------------CUT-HERE----------->8---------------------

EOF

Comments :
« Back - 1 - Next »
Although most famous for its extensive selection of bags, Louis Vuitton is no one trick pony. As part of the new Fall/Winter 2012 Collection, the Louis Vuitton mens metal lace-up boots are discreetly stylish.
http://www.chanel255bagshop.com/chanel 2.55
juicy couture outlet, on September 4th 2012 at 8:57 pm :
Juicy couture exclusive sponsorship of CCTV prime time variety show "honest variety" host Zhu Xun on the mirror, clothing,the interpretation Juicy couture dress elegant and intellectual beauty. Moderator Zhu Xun the dressed Juicy couture clothing in each program, elegant and generous image of the audience in a relaxed sensual entertainment to enhance the visual cognition of brands and products.

read more:
http://www.juicycoutureoutlet-online.weebly.com
http://www.juicycoutureoutletcheap.com/
http://www.juicycouturebagsstore.com/


Add a new comment : (require validation)
Username : (required)
Email : (will not be published) (required)
Antispam : (required)
Text in English only: (required)
[ News ] [ Issues ] [ Authors ] [ Comments ] [ Search ] [ Stats ] [ Contact ]
© Copyleft 1985-2012, Phrack Magazine.