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

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

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

本篇关键词:信息代码地址 
黑客防线网安网讯:     if( (ip1Num<=searchIpNum) && (searchIpNum<=ip2Num) )...{             fs.seekg(exeOffset+pos, ios_base::beg);             ip1Num=read4Bit(fs); #if defined _DEBUG_          ...
     if( (ip1Num<=searchIpNum) && (searchIpNum<=ip2Num) )...{
            fs.seekg(exeOffset+pos, ios_base::beg);
            ip1Num=read4Bit(fs);
#if defined _DEBUG_
            cout<<"  Last position:"<<endl<<endl;
            printIpNum(ip1Num);
            cout<<"pos="<<pos<<"   ";
#endif
            pos=read3Bit(fs);
#if defined _DEBUG_
            cout<<"pos="<<pos<<endl;
#endif
            fs.seekg(exeOffset+pos, ios_base::beg);
         ip2Num=read4Bit(fs);
#if defined _DEBUG_
            printIpNum(ip2Num);
#endif
            break;
        }else if(ip1Num>searchIpNum)...{
            endNum = midNum;
        }else if(ip2Num<searchIpNum)...{
            beginNum = midNum;
        }
    }
#if defined _DEBUG_
    cout<<endl<<"Found position:"<<fs.tellg()<<endl;
#endif
    ipAddr=new char[512];
    memset(ipAddr, 0, 512);
    iRead = readString(fs, exeOffset, ipAddr);
    if(iRead>0)...{
        cout<<ipAddr<<"  ";
    }
    memset(ipAddr, 0, 512);
    iRead = readString(fs, exeOffset, ipAddr);
    if(iRead>0)...{
        cout<<ipAddr;
    }
    delete[]ipAddr;
    fs.close();
    return 0;
}
long read4Bit(ifstream& f)...{
    long t; char c[4];
    t=0;
    f.read((char*)&t, 4);
    return t;
}
long read3Bit(ifstream& f)...{
    long t;
    f.read((char*)&t, 3);
    return t;
}
int readString(ifstream& f, long exeOffset, char * str)...{
    char ipFlag; long ipSeek, tmpSeek;
    int ret;
    ipFlag=f.get();
    if(ipFlag==0x1) ...{ // 重定向模式1: 城市信息隨國家信息定向
        ipSeek=read3Bit(f);
        f.seekg(exeOffset+ipSeek, ios_base::beg);
    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-15119-1.html
网站维护教程更新时间:2012-04-04 22:50:25  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer