Created
July 17, 2014 10:44
-
-
Save erayarslan/78fee1f8adf134ae5333 to your computer and use it in GitHub Desktop.
Arg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @author Eray Arslan | |
* @date 08.11.2012 | |
* @mail relf-@hotmail.com | |
*/ | |
#include <iostream> | |
using namespace std; | |
void hata(); | |
bool dogru_un=false; | |
bool dogru_ps=false; | |
string kullaniciadi; | |
string sifre; | |
string un="-username"; | |
string ps="-password"; | |
string dosya; | |
int main(int argc, char *argv[]) | |
{ | |
dosya=argv[0]; | |
if(argc==5) | |
{ | |
for(int i=0;i<=4;i++) | |
{ | |
if(argv[i]==un) | |
{ | |
kullaniciadi=argv[i+1]; | |
dogru_un=true; | |
} | |
if(argv[i]==ps) | |
{ | |
sifre=argv[i+1]; | |
dogru_ps=true; | |
} | |
} | |
if(dogru_un=true && dogru_ps==true) | |
{ | |
cout<<"[+] Kullanici Adi : "<<kullaniciadi<<endl; | |
cout<<"[+] Sifre : "<<sifre<<endl; | |
} | |
else | |
{ | |
hata(); | |
} | |
} | |
else | |
{ | |
hata(); | |
} | |
return 0; | |
} | |
void hata() | |
{ | |
cout<<endl<<"[-] Gecersiz arguman kullanimi."; | |
cout<<endl<<"[!] Kullanimi : "<<dosya<<" "<<un<<" <veri> "<<ps<<" <veri>"; | |
cout<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment