Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help with prank virus program

dudeapcdudeapc Member Posts: 12
my brother is a total ghost recon freak and is trying to get a w*rez of it so i made a fake w*rez and am putting this prog on there so he thinks he screwed up the computer. the code always quits out though how do i fix this??

#include

int main() {
int $number;
int $ready;
$number = 1;
//prepare for install
printf("Are you ready to install the free version of Ghost Recon?
");
printf("Install Directory: C:/program files/Red Storm Entertainment/Ghost Recon
");
printf("Press any key and press enter to continue
");
scanf("%c", $ready);
//fake install portion of the exe
while($number < 500) {
printf("1001010101010111101100010010110101");
printf("100010101010101000101111010101010101");
printf("1001010101010111101100010010110101");
printf("100010101010101000101111010101010101");
printf("1001010101010111101100010010110101");
printf("100010101010101000101111010101010101");
$number++;
if($number = 500) {
//haha v*rus installed part
printf("Installation of the Ghost Recon V*rus has been completed!
");
printf("Thank you for sending us all the files on your harddrive!!!
");
printf("Press any key to exit the Ghost Recon V*rus Install Program
");
scanf("%c", $ready);
}
}

}


i dont think the word v*rus is allowed so i had 2 censor it or w*arez

Comments

  • ZantosZantos Member Posts: 139
    Why don't you just kick him and call it a day :P
  • BASIC FriendBASIC Friend Member Posts: 354
    I compiled it and got a segmentation fault. That probably means that a pointer with a bad address was dereferenced. Look at your code and you won't see a pointer, but there is two. The scanf() function takes the address of a variable not the variable itself. In other words: A POINTER.

    [code]
    int a;
    int *ptr;

    scanf("%d", a); /* invalid */
    scanf("%d", &a); /* correct */

    ptr = &a;
    scanf("%d", ptr); /* also correct */
    [/code]

    Here you go, hope your brother enjoys his new game!!!!!!!!!!

    [code]
    #include


    int main() {
    int $number;
    int $ready;
    $number = 1;
    //prepare for install
    printf("

    Are you ready to install the free version of Ghost Recon?
    ");
    printf("Install Directory: C:/program files/Red Storm Entertainment/Ghost Recon
    ");
    printf("Press any key and press enter to continue
    ");
    scanf("%c", &($ready));
    //fake install portion of the exe
    while($number < 500) {
    printf("1001010101010111101100010010110101");
    printf("100010101010101000101111010101010101");
    printf("1001010101010111101100010010110101");
    printf("100010101010101000101111010101010101");
    printf("1001010101010111101100010010110101");
    printf("100010101010101000101111010101010101");
    $number++;
    }
    //haha v*rus installed part
    printf("

    Installation of the Ghost Recon V*rus has been completed!
    ");
    printf("Thank you for sending us all the files on your harddrive!!!
    ");
    printf("Press any key to exit the Ghost Recon V*rus Install Program
    ");
    scanf("%c", &($ready));


    }


    [/code]
  • dudeapcdudeapc Member Posts: 12
    [b][red]This message was edited by dudeapc at 2002-8-14 14:45:17[/red][/b][hr]
    that solves one problem but now when it runs it will do the whole install thing with all the 1's and 0's but then just quits i am trying to use a if loop to solve that but it still quits out, i know there is a thing in the control panel that prevents a dos program from exiting on finish but he wouldnt be able to figure out how to run it from the command prompt so i was planning on giving it a ghost recon icon and putting it on his desktop. while loops dont work either heres the code:

    #include





    int main() {

    int $number;

    int $ready;

    $number = 1;

    //prepare for install

    printf("

    Are you ready to install the free version of Ghost Recon?
    ");

    printf("Install Directory: C:/program files/Red Storm Entertainment/Ghost Recon
    ");

    printf("Press any key and press enter to continue
    ");

    scanf("%c", &($ready));

    //fake install portion of the exe

    while($number < 300) {

    printf("1001010101010111101100010010110101");

    printf("100010101010101000101111010101010101");

    printf("1001010101010111101100010010110101");

    printf("100010101010101000101111010101010101");

    printf("1001010101010111101100010010110101");

    printf("100010101010101000101111010101010101");

    $number++;

    if($number >= 301) {

    //haha virus installed part

    printf("

    Installation of the Ghost Recon Virus has been completed!
    ");

    printf("Thank you for sending us all the files on your harddrive!!!
    ");

    printf("Press any key to exit the Ghost Recon Virus Install Program
    ");

    scanf("%c", &($ready));
    }

    }


    }



  • DB1DB1 Member Posts: 1,142
    : [b][red]This message was edited by dudeapc at 2002-8-14 14:45:17[/red][/b][hr]
    : that solves one problem but now when it runs it will do the whole install thing with all the 1's and 0's but then just quits i am trying to use a if loop to solve that but it still quits out, i know there is a thing in the control panel that prevents a dos program from exiting on finish but he wouldnt be able to figure out how to run it from the command prompt so i was planning on giving it a ghost recon icon and putting it on his desktop. while loops dont work either heres the code:
    :
    : #include
    :
    :
    :
    :
    :
    : int main() {
    :
    : int $number;
    :
    : int $ready;
    :
    : $number = 1;
    :
    : //prepare for install
    :
    : printf("

    Are you ready to install the free version of Ghost Recon?
    ");
    :
    : printf("Install Directory: C:/program files/Red Storm Entertainment/Ghost Recon
    ");
    :
    : printf("Press any key and press enter to continue
    ");
    :
    : scanf("%c", &($ready));
    :
    : //fake install portion of the exe
    :
    : while($number < 300) {
    :
    : printf("1001010101010111101100010010110101");
    :
    : printf("100010101010101000101111010101010101");
    :
    : printf("1001010101010111101100010010110101");
    :
    : printf("100010101010101000101111010101010101");
    :
    : printf("1001010101010111101100010010110101");
    :
    : printf("100010101010101000101111010101010101");
    :
    : $number++;
    :
    : if($number >= 301) {
    :
    : //haha virus installed part
    :
    : printf("

    Installation of the Ghost Recon Virus has been completed!
    ");
    :
    : printf("Thank you for sending us all the files on your harddrive!!!
    ");
    :
    : printf("Press any key to exit the Ghost Recon Virus Install Program
    ");
    :
    : scanf("%c", &($ready));
    : }
    :
    : }
    :
    :
    : }
    :
    :
    :
    :
    Your while loop is wrong .. dont include the "if($number >= 301)" within the loop. You dont even need that statement at all. Within the while loop all its going to do is cause the 'haha' text to be printed 199 times while asking for an input each time. Also the reason it probably crashes is the "%c" in the scanf functions should be "%d". %c is for reading or printing chars, while %d is for reading / printing integers.. Look at the previous sample that "BASIC friend" wrote, it's correct.
  • Shawn CarterShawn Carter Member Posts: 0

    ____ [ http://forcoder.org ] free video tutorials and ebooks about / Go C++ Visual Basic Java MATLAB Ruby C C# PHP Perl PL/SQL Delphi JavaScript R Swift Python Scratch Visual Basic .NET Assembly Objective-C Crystal Rust ABAP Awk Hack Lua Scheme Fortran Erlang Logo Transact-SQL LabVIEW Clojure F# SAS Ada Dart COBOL Kotlin FoxPro VBScript Prolog Julia D ML Scala Lisp Apex Alice Bash /

Sign In or Register to comment.