UCBUG游戏网-最安全的绿色下载站点!

ucbug游戏网 > 新闻中心 > 游戏开发 > → 征途外挂的vc部分源码(4)

征途外挂的vc部分源码(4)

作者:网络 来源:本站整理 时间:2009-06-25 05:41

        CSearch findKey;

        findKey.m_Search.Format("%s",cSearch);
        if( findKey.DoModal() == IDOK )
            sprintf(cSearch, findKey.m_Search);
        else
        {
            CloseHandle(Process);
            return;
        }

        ULONG lStart=0x02000000;
        while(1)
        {
            if( SearchKey( Process, lStart,0x06ffffff,cSearch, 1, &lRenAdd, 0 ) )
            {
                AfxMessageBox("角色未找到!!");
                CloseHandle( Process );
                return;
            }

            lStart = lRenAdd + strlen(cSearch)  ;

            if( ShowAttrib() < 0 )
                continue;

            CString ccc;
//            ccc.Format("角色属性正确吗? lStart=[%ld],lRenAdd=[%ld]",lStart,lRenAdd);
            ccc.Format("角色属性正确吗?");
            if( AfxMessageBox(ccc,MB_YESNO) == IDYES )
            {
                ULONG lAdd = lRenAdd - 0x3C4;
                char  cTmp[5];

                memcpy(cTmp, &lAdd, 4 );
                cTmp[4]='\0';

                TRACE("查找的基地址!地址=[0X%02X%02X%02X%02X]",cTmp[0],cTmp[1],cTmp[2],cTmp[3]);
               
                if(SearchKey( Process, 0x00,lRenAdd, cTmp, 1, &lAdd, 4 ) == 0 )
                {
                    char cAddr[20];
                    char cFileName[1024];
                    sprintf( cFileName,"%s\\地址.ini",gcAppPath);
                    lBaseAddr = lAdd;
                    sprintf(cAddr,"0X%08X", lAdd);
                    WritePrivateProfileString("Config","人物基地址",cAddr,cFileName);
                }
                break;
            }

        }
        CloseHandle( Process );

        SetTimer(2,1000,NULL);
}

void CZhengTuDlg::Dispose()
{
    if( lNumQuestion > 0 )
    {
        long i=0;
        while( i < lNumQuestion )
        {
            delete Question;
            i++;
        }
        delete Question;
        i=0;
        while( i < lNumQuestion )
        {
            delete Anser;
            i++;
        }
        delete Anser;
    }
    lNumQuestion = 0;
}

void CZhengTuDlg::ShowGuaiAttrib()
{
    HANDLE Process;
    ULONG  lGuaiAdd;
    char  cName[100];
    long  lA,lB;

    CStatic *pStatic;
    MyOpenProcess( &Process );
    ReadProcessMemory( Process, (LPVOID)(lBaseAddr + 0x4), &lGuaiAdd, 4, NULL );
   
    ReadProcessMemory( Process, (LPVOID)(lGuaiAdd + 0x4), cName, 20, NULL );
    ReadProcessMemory( Process, (LPVOID)(lGuaiAdd + 0x40), &lA, 4, NULL );
    ReadProcessMemory( Process, (LPVOID)(lGuaiAdd + 0x40 + 0x4) , &lB, 4, NULL );

    CloseHandle(Process);
   
    if( lA < 0 || lB < lA )
        return;

    pStatic=(CStatic *)GetDlgItem(IDC_STATIC7);
    pStatic->SetWindowText(cName);

    sprintf( cName, "%ld/%ld", lA, lB );
    pStatic=(CStatic *)GetDlgItem(IDC_STATIC9);
    pStatic->SetWindowText(cName);
}

void CZhengTuDlg::OnLButtonDblClk(UINT nFlags, CPoint point)
{
    // TODO: Add your message handler code here and/or call default
    CButton *cBt = (CButton *)GetDlgItem( IDC_BUTTON1 );

    if( cBt->IsWindowVisible() == TRUE )
        cBt->ShowWindow(SW_HIDE);
    else
        cBt->ShowWindow(SW_SHOW);
   
    CDialog::OnLButtonDblClk(nFlags, point);
}

void CZhengTuDlg::GetAppPath(char *cAppPath)
{
    GetModuleFileName(NULL, cAppPath, 1024 );
    for( int i=strlen(cAppPath)-1; i >= 1; i -- )
        if( cAppPath == '\\' )
        {
            cAppPath = '\0';
            break;
        }
    return;
}

相关文章