开始学习C语言了,希望能慢慢根据这些代码的修改和学习提高自己水平。
以下是作者原版信息:
/* ** 作者: Xiaomo.wabzsy ** 版本: v0.3 ** 发布时间: 2012/08/14 ** 本程序代码公开,您可以任意修改,发布. ** 如果您认为程序有什么需要改进的地方请发 E-mail到 xiaomo@wabzsy.com ,谢谢. */
1 #include <stdio.h> 2 #include <string.h> 3 #include <windows.h> 4 #include <time.h> 5 int main() 6 { 7 system("mode con cols=128 lines=32"); 8 int Last; 9 char szFilePath[MAX_PATH],Cmd[MAX_PATH],Line[MAX_PATH]; 10 FILE * File; 11 time_t t; 12 while(1) 13 { 14 memset(Cmd,0,sizeof(Cmd)); 15 memset(Line,0,sizeof(Line)); 16 GetModuleFileName(NULL,szFilePath,MAX_PATH); 17 Last=strrchr(szFilePath,'\\'); 18 szFilePath[Last-(int)szFilePath]='\0'; 19 printf("Running Path : %s\n",szFilePath); 20 GetShortPathName(szFilePath,Cmd,sizeof(Cmd)); 21 strcat(Cmd,"\\Bin\\SqlMap.exe "); 22 printf("[root@Hacker~]# Sqlmap "); 23 gets(Line); 24 //if(strcmp(strlwr(Line),"quit")==0 || strcmp(strlwr(Line),"exit")==0 ) exit(0); 25 if((strcmp(strlwr(Line),"quit")?strcmp(strlwr(Line),"exit"):0)==0)exit(0); 26 if(strcmp(strlwr(Line),"clear"))system("clear");continue; 27 28 strcat(Cmd,Line); 29 time(&t); 30 File=fopen(".\\Run.log","a"); 31 fprintf(File,"\n%sSqlmap %s\n",ctime(&t),Line); 32 fclose(File); 33 //printf("%s",Cmd); 34 system(Cmd); 35 } 36 system("pause"); 37 return 0; 38 }