pwnable.kr —— blackjack

question#

1
2
3
4
5
6
7
8
9
Hey! check out this C implementation of blackjack game!
I found it online
* http://cboard.cprogramming.com/c-programming/114023-simple-blackjack-program.html

I like to give my flags to millionares.
how much money you got?


Running at : nc pwnable.kr 9009

analyse#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
int betting() //Asks user amount to bet
{
printf("\n\nEnter Bet: $");
scanf("%d", &bet);

if (bet > cash) //If player tries to bet more money than player has
{
printf("\nYou cannot bet more money than you have.");
printf("\nEnter Bet: ");
scanf("%d", &bet);
return bet;
}
else return bet;
} // End Function

可以看到当输入bet后,会与cash比较,数了以后cash=cash-bet
那么输入一个大的负数,并且输掉应该就可以了

get flag#

输入bet:-100000000,然后选择Stay输掉,再进入下一场即可获得flag

flagYaY_I_AM_A_MILLIONARE_LOL

评论