C++ Trainer Skeleton

Posts 1–15 of 41 · Page 1 of 3
C++ Trainer Skeleton
Probably one of the simplest skeletons I've got:

Code:
#include <windows.h>
#include <stdio.h>

int main(){

  HANDLE hProcess = 0;

  HWND hWindow;
  DWORD pid = 0;

  hWindow = FindWindow(NULL, "Window Name");
  if (hWindow){
     GetWindowThreadProcessId(hWindow, &pid);
  }

  hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);

  if(hProcess != NULL)
     printf("Process Found!");
  else {
     printf("Process Not Found!");
     return 0;
  }
 
  //Writes byte values to 0x00567...
  BYTE valueToWrite[] ={0x90, 0x90};
  WriteProcessMemory(hProcess, (void*)0x00567A8F, (void*)&valueToWrite, sizeof(valueToWrite), NULL);

  return 0;
}
Its really handy if you want to make your own trainer. You of course need to know how to use it
this isn't c++ is just "C"
ROFLCOPTER DOWN. dontcha mean? :P
Quote Originally Posted by Firey
this isn't c++ is just "C"
It is C++.
c++ = cout << "";
c = printf ""
If, I remember correctly, with my limited knowledege of C++, printf is useable in C++ and C#.

Dave kept trying to make me use printf instead of std::cout << ""
well, you can code C in V C++ but its just like javascript, HTML and Javascript can be coded together.

Any c++ tutorial uses cout <<
any c tutuorial uses printf
Yeah, but the headers use the C++ format.

Maybe its a hybrid C#+!
I hate to break it to you, that is typical C. But not because of the reason he provided, because you can use printf() in both C and C++.

But there is nothing C++ specific in there; no references, classes, object orientation, or instantiation. In other words, it is C, because you can plug this code into an ANSI C compiler and it would still run.

And C# has nothing to do with this; in fact that is incorrect C# syntax.

EDIT: And by the way, both C and C++ use the same header include system.
This is a telltale sign of C:

#include <stdio.h>

This is a telltale sign of C++:

#include <iostream> //note there is no .h
using namespace ...; //C does not use namespaces
I added that... "printf();" bit. It was originally a large chunk of code stripped down. C, works with C++ because they are esentially the same thing. One is just a little more complicated.

Anyways, the bit about the header files isn't completely correct. Unless its a "compiler included header" it can't be used without the .h at the end. Anyways its good programming to include a .h at the end of every header
Actually, according to the latest C++ standard, you are supposed to leave out .h on STD libraries. The reason is because those with .h are being deprecated.

If you doubt me, go into Code::Blocks and type in a simple application with <iostream.h> and it will give you a deprecation warning.

ie...

#include <iostream>
using namespace std;
int main() {
cout<<"hi!\n";
return 0;
} //no deprecation warning

#include <iostream.h>
int main() {
cout<<"hi!\n";
return 0;
} //deprecation warning
I'm using VS 2003 and I never get deprecation warnings for that.
Thanks 4 replying.
i'm software eng., i'm a student.
so i would like to know more about programming, i mean to build a system. my projet last year is on xml, and file maker pro. ca u help me out???
It's heating up in here, I am a C++ dropout!
Posts 1–15 of 41 · Page 1 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?