Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: BuYS - Understanding functions!!! Share/Save - My123World.Com!

  1. #1
    Garage Member
    Join Date
    Sep 2010
    Location
    Chennai
    Posts
    83
    Blog Entries
    1

    BuYS - Understanding functions!!!

    Consider this program, your objective would be to make the program print "you win"

    Code:
    #include<stdio.h>
    main()
    {
    int flag;
    char buffer[20];
    gets(buffer);
    if(flag==0x41420043)
    printf("you win\n");
    else
    printf("you lose\n");
    }
    Enjoy!!!

    References: gera's insecure programming page

  2. #2
    ... I am no Expert b0nd.g4h@gmail.com b0nd's Avatar
    Join Date
    Jul 2010
    Location
    irc.freenode.net #g4h
    Posts
    744
    That seems a good one sebas_phoenix. I got the loop hole along with a doubt. I will get back to it soon.
    [*] To follow the path: look to the master, follow the master, walk with the master, see through the master,
    ------> become the master!!! <------
    [*] Everyone has a will to WIN but very few have the will to prepare to WIN
    [*] Invest yourself in everything you do, there's fun in being serious

  3. #3
    Garage Member
    Join Date
    Sep 2010
    Location
    Chennai
    Posts
    83
    Blog Entries
    1
    Quote Originally Posted by b0nd View Post
    That seems a good one sebas_phoenix. I got the loop hole along with a doubt. I will get back to it soon.
    Thanks . And waiting for ur pm

  4. #4
    done got the solution with help from fb1 to get output was almost right

    thanks to him sent you PM
    Last edited by silentph33r; 03-26-2011 at 09:32 PM.

  5. #5
    Garage Member
    Join Date
    Sep 2010
    Location
    Chennai
    Posts
    83
    Blog Entries
    1
    Quote Originally Posted by silent123 View Post
    done got the solution with help from fb1 to get output was almost right

    thanks to him sent you PM
    nice one!!! cant send u a pm coz post count <15.. anyways nice job

  6. #6
    ... I am no Expert b0nd.g4h@gmail.com b0nd's Avatar
    Join Date
    Jul 2010
    Location
    irc.freenode.net #g4h
    Posts
    744
    PM Sent....
    It took some time but was worth spending time on it along with full on discussion with fb1.
    [*] To follow the path: look to the master, follow the master, walk with the master, see through the master,
    ------> become the master!!! <------
    [*] Everyone has a will to WIN but very few have the will to prepare to WIN
    [*] Invest yourself in everything you do, there's fun in being serious

  7. #7
    Super Commando Dhruv abhaythehero's Avatar
    Join Date
    Sep 2010
    Location
    Lucknow/Pune,India
    Posts
    466
    Blog Entries
    2
    @sebas_phoenix do we have to some change in the code or put a special type of input without changing the code ? :O
    In the world of 0s and 1s, are you a zero or The One !

  8. #8
    ... I am no Expert b0nd.g4h@gmail.com b0nd's Avatar
    Join Date
    Jul 2010
    Location
    irc.freenode.net #g4h
    Posts
    744
    Quote Originally Posted by abhaythehero View Post
    @sebas_phoenix do we have to some change in the code or put a special type of input without changing the code ? :O
    Abhay, you do not need to change the code.
    [*] To follow the path: look to the master, follow the master, walk with the master, see through the master,
    ------> become the master!!! <------
    [*] Everyone has a will to WIN but very few have the will to prepare to WIN
    [*] Invest yourself in everything you do, there's fun in being serious

  9. #9
    Super Commando Dhruv abhaythehero's Avatar
    Join Date
    Sep 2010
    Location
    Lucknow/Pune,India
    Posts
    466
    Blog Entries
    2
    1 more thing .. do we have to to compile the program via same method as sebas_phoneix mentioned in his tutorial ?? I mean disabling and giving gcc all that parameters ?
    In the world of 0s and 1s, are you a zero or The One !

  10. #10
    Garage Member
    Join Date
    Sep 2010
    Location
    Chennai
    Posts
    83
    Blog Entries
    1
    Quote Originally Posted by abhaythehero View Post
    1 more thing .. do we have to to compile the program via same method as sebas_phoneix mentioned in his tutorial ?? I mean disabling and giving gcc all that parameters ?
    i was using ubuntu 10.04 for that tutorials, so it is necessary to give those switches except -mpreferred-stack-boundary which is just for stack alignment size to be 4 bytes.. giving those switches makes it easier..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •