Acessing specific adress

This is a discussion on Acessing specific adress within the C++ Programming forums, part of the General Programming Boards category; k I was just wondering, u know a memmory location of an item could be a value from a diffirent ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    57

    Acessing specific adress

    k I was just wondering, u know a memmory location of an item could be a value from a diffirent program like a game or something is it possible to acces that value and change the value. Thanks that be awsome and is there a way u can hook onto windows programs thanks .

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    903
    Windows won't let you touch other app's virtual memory. If you want to hack a game, use a pre-made hack or open the executable file into an hex editor. I'm not suggesting you to do so because a) it sucks to cheat and b) it's illegal if I recall.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    i dun think it is illigal for first well as long as it is not an online game, and i know people make it somehow, u can find some trainers for anygame and i wanted to know how to make it but for start i would like to know how to acces some memmory location and play with it.

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    34
    Under windows, you use WriteProcessMemory() and ReadProcessMemory() to modify or read a applications memory. Here's a snippet of some code from an old trainer I made for Battlefield 1942:

    Code:
    HWND hGameWin;
    DWORD pid;
    HANDLE hProcess;
    
    hGameWin = FindWindow( NULL, "BF1942 (Ver:62733/10/14/2003, 11:14)" );
    if (!hGameWin) return FALSE;
    if (!GetWindowThreadProcessId( hGameWin, &pid )) return FALSE;
    hProcess = OpenProcess( PROCESS_ALL_ACCESS, 0, pid);
    if (!hProcess) return FALSE;
    
    WriteProcessMemory( hProcess, (LPVOID)0x42AFE9, &maphack1, sizeof(maphack1), NULL );
    WriteProcessMemory( hProcess, (LPVOID)0x42AA60, &maphack2, sizeof(maphack2), NULL );
    WriteProcessMemory( hProcess, (LPVOID)0x42B1CA, &maphack3, sizeof(maphack3), NULL );
    
    CloseHandle( hProcess );
    Earlier in the code, the maphack arrays are defined like this:

    Code:
    UCHAR maphack1[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
    UCHAR maphack2[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
    UCHAR maphack3[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
    So basically, I'm overwriting the original code with a bunch of NOP (0x90) instructions to the addresses 0x42AFE9, 0x42AA60, and 0x42B1CA. To figure out these addresses, I used a program called TSearch.

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    what library u need to include lol and i used a software called cheat engine and for example it has debugging options and u can set flags ro like eax and staff any good tuts on that?

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    34
    Just #include <windows.h> and it should work (assuming you create a complete window or console app first though). I've never used any program called cheat engine, so I can't help you with that. I know there's quite a few tutorials on using TSearch though if you ever decided to try that out.

  7. #7
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    yah i know tsearch and staff but in the cheat engine u go into debuggin option and u get to adress and then u can set flags and the flags include eax then u can tick zf and staff like that wich i think is assembly but it ok i use google for that.

  8. #8
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Using something like cheat engine has nothing to do with c++ programming.

  9. #9
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    I know i know but that option is related to asembly and wanted to know what it does but i said google will do thanks guys all question answered

  10. #10
    Registered User
    Join Date
    May 2006
    Posts
    34
    Yea, this whole thread is off-topic, so hopefuly an admin moves it (maybe to the windows programming board).

    Try these forums if you want help with the things you're asking though:

    http://www.unknowncheats.com/forum/
    http://www.mpcforum.com/

  11. #11
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    Thanks man And yes it kinda went off topic well like i said thanks a lot this thought me a lot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer (adress) question.
    By omnificient in forum C Programming
    Replies: 22
    Last Post: 02-27-2008, 07:49 AM
  2. platform specific API or C standard API
    By George2 in forum C Programming
    Replies: 1
    Last Post: 11-12-2007, 12:32 AM
  3. Adress of a pointer.
    By ozumsafa in forum C Programming
    Replies: 2
    Last Post: 09-21-2007, 02:59 AM
  4. pointing to a adress
    By kennny2004 in forum C++ Programming
    Replies: 3
    Last Post: 05-03-2006, 12:44 AM
  5. Accessing a Specific Text Line Inside CEditView :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 04-14-2002, 08:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21