Classes

Results 1 to 3 of 3
  1. #1
    Enthusiast gazettefan is offline
    MemberRank
    Feb 2009 Join Date
    49Posts

    Classes

    Programming using classes, is there a way to be more....clear, soft and easy than to use classes? ^^

    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <iostream>
    #include <tlhelp32.h>
    
    using namespace std;
    
    class MemoryCheck {
      int ProcessLevel, DesiredAdress, DesiredData, Jiji, Koji, Nodame;
      char MainLevel[1024];
      public:
        void AdressInfo (int); //naze ore ha (ni)2dai class wo shiyo- subeki ka
        void LevelInfo (char *);
        void DataInfo (int);
        int LevelSeizure() 
        {
            return (ProcessLevel);
        } 
        int DataSeizure()
        {
            return (DesiredData);
        }
        int AdressSeizure()
        {
            return (DesiredAdress);
        }
        char LevelChar()
        {
             return (*MainLevel);
        } 
        int LevelJiji()
        {
            return (Jiji);
        }
        int LevelKoji()
        {
            return (Koji);
        }
        void ReturnProcess ()
                 {
                   HANDLE hProcessSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
                   PROCESSENTRY32 ProcessEntry = {0};
                   ProcessEntry.dwSize = sizeof(ProcessEntry);
                   BOOL Return = FALSE;
                   Return = Process32First(hProcessSnapShot,&ProcessEntry);
                   do{	
                         HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessEntry.th32ProcessID);
    	                 if(hProcess)
    	                  {
                                MemoryCheck MemBuffer;
    	                        BOOL NodameCurrentInfo = ReadProcessMemory(hProcess,(void *)MemBuffer.AdressSeizure(),&Nodame,4,NULL);
    		                    if(Nodame == MemBuffer.DataSeizure())
    		                    {
                                        ProcessLevel = 0x1AC;
                                }
                           }CloseHandle(hProcess);     
    	           }while(Process32Next(hProcessSnapShot,&ProcessEntry));
                 CloseHandle(hProcessSnapShot); 
         }  
    };
    
    MemoryCheck MemInfo;
    
    void MemoryCheck::AdressInfo (int AdressParser) {
      DesiredAdress = AdressParser;
      if(GetCurrentProcess()) { Jiji = 0x4AB; }
    }
    void MemoryCheck::DataInfo (int DataParser) {
         DesiredData = DataParser;
         if(GetCurrentProcess()) { Koji = 0x4AB; }
    }
         
    
    int main () {
      MemInfo.AdressInfo (0x00213458);
      MemInfo.DataInfo (-897129893);
      MemInfo.DataSeizure();
      MemInfo.AdressSeizure();
      MemInfo.ReturnProcess();
      cout << MemInfo.LevelSeizure() << endl;
      if(MemInfo.LevelJiji() != MemInfo.LevelKoji()) cout << MemInfo.LevelJiji() << endl;
      if(MemInfo.LevelSeizure() == 428) cout << "Found!" << endl;
      system("PAUSE"); //gcc chigatteiru ne..
      return EXIT_SUCCESS;
    }
    Im sorry, I was going to use [Development] but also to be a discussion,

    I mean, it is so MUCH harder to understand this is script using classes than to make it the original way, I confess that if it wasn't I to code it, I would not understand it hehe
    not a release or anything else, so... what do you guys think about classes...?
    Last edited by gazettefan; 08-08-11 at 01:46 AM.


  2. #2
    Ancient One cmb is offline
    DeveloperRank
    Mar 2007 Join Date
    1,035Posts

    Re: Classes

    congrats on discovering OOP, now you will fall in love with it's wonderful world of modularity

  3. #3
    Enthusiast gazettefan is offline
    MemberRank
    Feb 2009 Join Date
    49Posts

    Re: Classes

    Quote Originally Posted by cmb View Post
    congrats on discovering OOP, now you will fall in love with it's wonderful world of modularity
    This is EXACTLY what I'm talking about haha ^^



Advertisement