-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsethc.cpp
More file actions
64 lines (57 loc) · 1.1 KB
/
sethc.cpp
File metadata and controls
64 lines (57 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
bool get_access()
{
std::cout<<"Input password: ";
std::string in;
getline(std::cin, in);
int length=in.length();
int sum=0;
int sum2;
int sum3;
int sum4=0;
for(int i=0; i<length; i++)
sum += in[i];
sum2=in[0];
for(int i=1; i<length; i++)
sum2=sum2^in[i];
sum3=in[0];
for(int i=1; i<length; i++)
sum3=sum3%in[i];
for(int i=1; i<=length; i++)
sum4=sum4+in[i-1]*i;
if(sum==883) //x
{
std::cout<<" (i) check 1/4 passed\n";
if(sum2==31) //y
{
std::cout<<" (i) check 2/4 passed\n";
if(sum3==15) //z
{
std::cout<<" (i) check 3/4 passed\n";
if(sum4==3970) //a
{
std::cout<<" (i) check 4/4 passed\n";
return 1;
}
else //i know this else is useless, but I FUCKING SWEAR that without it, it doesn't work on dev-c++!!!
{
std::cout<<"Wrong password.\n";
system("pause");
return 0;
}
}
}
}
else
{
std::cout<<"Wrong password.\n";
system("pause");
return 0;
}
}
int main(){
system("mode 168");
if(get_access())
system("cmd");
return 0;
}