-_- Why does 'Working' Keep getting set to false.

Posts 1–6 of 6 · Page 1 of 1
-_- Why does 'Working' Keep getting set to false.
I don;t understand, The boolean 'Working' is set to true when warrock opens,and when its closed its set to false. The most fucked up part is when I press a key(a) to activate the hack, 'Working' is set to false. And I don't understand why the fuck it is. I programmed this by-myself and I am 100% sure there are only like no spots in which it turns false because a hotkey is pressed. Here. Ignore the comments, there there to keep me on track, Its not my first time programming C++, just my first time making a hack with it.

Code:
#define ProcessName
#include <cstdlib>
#include <iostream>
#include <string>
#include <windows.h>
#include <conio.h>
#include <dos.h>
#include <tlhelp32.h>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
bool WarrockFound = false;
HANDLE WarRockProcess = NULL;
bool Working = false;
bool InfStem = false;
bool ScopeOn = false;
long Temp;
char ReturnKey = '0';
long StemWrite = 1120403456;
LPVOID ScopeAddress = (void*) 0x00AB7E22;
LPVOID StemAddress = (void*) 0x008B9B04;

HANDLE GetProcess(void){
     bool TempBool = false;
     HANDLE ProcessSnap;
     PROCESSENTRY32 ProcessInformation;
     //Process Handle in Gen Declaration section
     ProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
     Process32First(ProcessSnap, &ProcessInformation);
     //Start Find Process
     TempBool = false;
     do
     {

              if(strcmp(ProcessInformation.szExeFile,"WarRock.exe") == 0)
              {
                    TempBool = true;
                    Working = true;
                    return OpenProcess(PROCESS_ALL_ACCESS, false, ProcessInformation.th32ProcessID);
                    break;
              }
     }while(Process32Next(ProcessSnap, &ProcessInformation));
     if(TempBool == true)
     {
                 Working = true;
     }else{
           Working = false;
     }
     //End Find Process
}
       
void Screen(void)
{
     system("cls");
     cout<<"_______________[Hacks Status]____________\n"<<endl;
     if(Working == false ){cout<<"Status : Cannot Find Warrocks Process"<<endl;}else{cout<<"Status : Warrock Found"<<endl;}
     cout<<"\n\nHacks:"<<endl;
     if(ScopeOn){cout<<"Scope [Activated]\n";}else{cout<<"Scope [Unactivated]\n";}
     if(InfStem){cout<<"InfStem [Activated]\n";}else{cout<<"InfStem [Unactivated]\n";}
     
}
int main(int argc, char *argv[])
{
    cout<<"Waiting For Okay.."<<endl;
    MessageBox(NULL,"Notes:\n   The twitching in the console is normal.\nIf you want to get rid of it you can increase your FrameRates.\nAnyways this hack was made with Dev-C++.\nIts better then all the VB\nHacks in the world put to gether, and you can't make fun of it! \nNor can you make fun of pokopeople Okay -_-\n\nPlease Note The Following Changes Have Taken Place: \n-No Commands\n-Uses 'Hot Keys'\n-Includes Scope\n-Includes Light Map\n-Includes InfStem\n\nINFOMRATION :\n  Hot Keys:\n              C - Scope On\n  Shift + C - Scope Off\n              P - InfStemOn\n  Shift + P - InfStem Off\n  Shift + Q - Quite","Notice!",MB_OK);
    while(true)
    {
               Screen();
               GetProcess();
               //Check For Local Key Presses
               if(kbhit()){ReturnKey = getch();}
               if(ReturnKey == 'Q'){return 0;}
               WarRockProcess = GetProcess();
               //Check Find Status
               if(Working == true)
               {
                     GetProcess();
                     Screen();
                    //Write Process Memory Start Below
                    if(InfStem){WriteProcessMemory(WarRockProcess,StemAddress,&StemWrite,4,NULL);}
                                        
                    //True\False KeyPress Start Below
                    if(kbhit()){
                    ReturnKey = getch();
                          switch(ReturnKey){             
                            case 'a':
                                   Temp = 1;
                                   ScopeOn = true;
                                   WriteProcessMemory(WarRockProcess,ScopeAddress,&Temp,4,NULL);
                                   //OnScope
                                   break;
                            case 'b':
                                 Temp = 0;
                                 ScopeOn = false;
                                 WriteProcessMemory(WarRockProcess,ScopeAddress,&Temp,4,NULL);
                                 //OffScope
                                 break;
                            case 'c':
                                 InfStem = false;
                                 break;
                            case 'd':
                                 InfStem = true;
                                 break;
                            }
                    }
               }//End If Working..
    }
}
Hmm, maybe use int instead of bool.

So if ( ScopeOn == 1 )
activatemyleathack();

Try that.
I have to say i never use cases.
I more like if and else so i cant tell u if the case would do anyting about it but i dont think so, it will be the same.
And a question, why do u do this :
Code:
     cout<<"_______________[Hacks Status]____________\n"<<endl;
Why u use "\n" for a new line and then use endl ?
Ok, its the same but ... why not "\n\n"

And the namespace, use printf instead of cout...
Dunno why, but cout looks so nooby xD
Case statments are much better then ifs if your doing multiple choice, you should learn to get into that habbit.


Because I learned to program in the language using cout<<, and the '<<endl;' has become a habit.
same problum is happening to me... im using


and its making NONE of my hacks work anymore


bool EditMem(const char * ProcessName, LPVOID MemAddress, int NewVal, int size)
{
HANDLE hProcessSnap;
HANDLE hProcess = NULL;
PROCESSENTRY32 pe32;
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
pe32.dwSize = sizeof( PROCESSENTRY32 );
Process32First(hProcessSnap, &pe32);
cout<<"1";
do
{
if(!strcmp(pe32.szExeFile, ProcessName))
{
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
cout<<"2";
break;
}
}
while(Process32Next(hProcessSnap, &pe32));
CloseHandle( hProcessSnap );
cout<<"3";
if(hProcess != NULL)
{
WriteProcessMemory(hProcess, MemAddress, &NewVal, size, NULL); // write the value
cout<<"4";
CloseHandle(hProcess);
return true;
}
else
{cout<<"process = null";}
return false;
}



(the text was so i could find the error...)
Put code tags around that. With the indentation of the code, and i'll fix it for you.
Other question then, why do u use cmd line ?
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?