[VC++学挂] 读取内存数据

ExpandedBlockStart.gif 代码
void  CMy2Dlg::OnMemoryRead() 
{
    
//  baseURL 23581628
    HWND GameH;
    DWORD ProcessID,Mybyte;
    HANDLE ProcessH;
    
int  Money;
    GameH 
=  ::FindWindow(NULL, " Farm Frenzy 3 " );
    
if  (GameH  != 0 )
    {
        
// this->m_data = (int)GameH;
        ::GetWindowThreadProcessId(GameH, & ProcessID);        
        ProcessH
= ::OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
        
if  (::ReadProcessMemory(ProcessH,(LPVOID) 0x23581628 ,(LPVOID) & Money, 4 , & Mybyte))
        {
            
this -> m_data  =  Money;
        }
        
else
            
this -> m_data  =   0 ;
    }
    UpdateData(
false );
    
}

 测试程序:疯狂农场3

转载于:https://www.cnblogs.com/rogee/archive/2010/10/03/1841637.html

你可能感兴趣的:([VC++学挂] 读取内存数据)