C++ 查詢wry.dat中的IP地址信息代码(4)_C/C++语言_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

C++ 查詢wry.dat中的IP地址信息代码(4)

作者:黑客防线网安C/C++教程基地 来源:黑客防线网安C/C++教程基地 浏览次数:0

本篇关键词:信息代码地址 
黑客防线网安网讯:     ret=readString(f, exeOffset, str);     }else if(ipFlag == 0x2) ...{ // 重定向模式2: 城市信息沒有隨國家信息定向         ipSeek=read3Bit(f);         tmpSeek=f.tellg();      ...

     ret=readString(f, exeOffset, str);
    }else if(ipFlag == 0x2) ...{ // 重定向模式2: 城市信息沒有隨國家信息定向
        ipSeek=read3Bit(f);
        tmpSeek=f.tellg();
        f.seekg(exeOffset+ipSeek, ios_base::beg);
        ret=readString(f, exeOffset, str);
        f.seekg(exeOffset+tmpSeek, ios_base::beg);
    } else ...{
        f.seekg(-1, ios_base::cur);
        ret=read2Zero(f, str);
    }
    return ret;
}

int read2Zero(ifstream& f, char*buf)...{
    f.get(buf, 128, 0);
    return strlen(buf);
}


void printHelp(char* exePath)...{
    char *fileName;
    fileName=strrchr(exePath,’’);
    if(fileName==NULL)...{
        strcpy(fileName, exePath);
    }else...{
        fileName++;
    }
    cout<<endl
        <<"Wry IP Search Beta by cangwu.lee@gmail.com "
        <<"Usage:"
        <<" "<<fileName<<"<ip address> <Path to wry.dat> "
        <<endl;
    free(fileName);
}


DWORD convertIP(char*sip)...{

    char *c1, *c2, *c3, *c4;
    DWORD i1, i2, i3, i4, dd;

#if defined _DEBUG_
    cout<<" ip="<<sip<<endl;
#endif

    c1 = strtok(sip, " ,.-");
    if(c1==NULL)...{
        cout<<"IP address incorrect."<<endl;
        return 0;
     }
    c2 = strtok(NULL," ,.-");if(c2==NULL)c2="0";
    c3 = strtok(NULL," ,.-");if(c3==NULL)c3="0";
    c4 = strtok(NULL," ,.-");if(c4==NULL)c4="0";
    i1=atol(c1); i2=atol(c2); i3=atol(c3); i4=atol(c4);
    if(i1<0 || i2<0 || i3<0 || i4<0
        || i1>254 || i2>255 || i3>255 || i4>255)...{
        cout<<"IP address incorrect."<<endl;
        delete[]c1;      delete[]c2;     delete[]c3;     delete[]c4;
        return 0;
    }

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-15120-1.html
网站维护教程更新时间:2012-04-04 22:50:25  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer