 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
fatal rival How do I cheat?
Reputation: 0
Joined: 08 Jul 2007 Posts: 8
|
Posted: Sun Jul 22, 2007 10:50 am Post subject: this is the source code for my crackme |
|
|
this is real simmple:
it is made is c++
| Code: | #include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string pass1("root");
string pass2("beer");
string pass3("rocks");
char guess1[15];
char guess2[15];
char guess3[15];
int out=0;
while(1){
cout<<"the first pass is 4 letters"<<endl;
while(1){
cout<<"first password ";
cin.getline(guess1,14);
if (pass1==guess1){
cout<<"\nyou got the first pass, and the second pass is 4 letters long";
out+=1;
break ;
}
}
while(1){
cout<<"\nsecond password ";
cin.getline(guess2,14);
if (pass2==guess2){
cout<<"\nyou got the second pass, and the third pass is 5 letters long";
out+=1;
break ;
}
}
while(1){
cout<<"\nthird password ";
cin.getline(guess3,14);
if (pass3==guess3){
cout<<"\nYou got all the passwords!";
cout<<"\nThe sentence is:'root beer rocks'!";
out+=1;
break ;
}
}
getchar();
if (out==3)
break;
}
return 0;
} |
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sun Jul 22, 2007 11:08 am Post subject: |
|
|
Simpler.
| Code: |
#include <stdio.h>
int main(int argc, char *argv[])
{
char * passes[] = {"lolhax", "root", "beer", "rocks", NULL}, mm[500]; int i;
for(i = 1; passes[i] != NULL; i++)
{
printf("Please guess password #%d\n", i);
scanf("%s", &mm);
if (!strcmp(mm, passes[i])) {
printf("Correct!\n");
if (passes[i+1] == NULL) {
printf("You win! The sentence is \"%s %s %s\"!\n", passes[i-2], passes[i-1], passes[i]);
getchar();
}
} else {
printf("WRONG!\n");
i--;
}
}
}
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|