Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 02:59

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Hooking, Memory write tutorials

Discussion on Hooking, Memory write tutorials within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
Hooking, Memory write tutorials

Dear readers,

does anyone know any good online tutorials (in English please, since my german is not really superb) which introduce and teach you the art of Hooking and reading / writing from the memory?

I know C++ but never did anything with hooking or memory reading/writing so far i.e. game hacking but I really would like to learn it.

I hope someone knows some nice tutorials

P.S. could someone explain me the following:
I would like to get the text which I write in my game, to be available in my C++ program.

I downloaded cheat engine and wrote some text in game and then did a search for that text. I repeated this process and in the end I was left with 6 memory values.

- 1Aff26D8
- 1B100C4 (this one also shows what other people type and changes all the time)
- 298D0Db2
- 2A50C8Dc (this one does the same as the 2nd)
- 3E80A450
- 43ED5744 (same as 2nd and 4th)

Now for my question. How can I get the text I type, to show up in my C++ program?

Queue, vectors, list, how does this work, and what would you do?

Hopefully some tips from you guys

Thanks in forward <3


P.S. I did a re-scan and now everything has new memory values.
I will worry about that later, lets say I just know the values and will change them manually everytime in my C++ tool. I just want to know how to read from the memory and display it in my console application (I am using Qt Creator).

I posted a screenshot with info. Hopefully that helps a bit to, when explaining stuff to me


DarkTwilight is offline  
Old 01/14/2012, 16:53   #2
 
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
What kind of memoryhacking you want to use?
There are two ways I know:
DLL Injection or
using an edit memory with

reading can be done with
jacky919 is offline  
Old 01/14/2012, 17:22   #3
 
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
ohhhh, I dont know mate, never used any. I think what ever most people would suggest, would be the one I would like to learn first. In the end I want to learn them all, just for the sake of knowledge lol

Anyways, if it helps, I want to get what ever is in the chat window of a game called Final Fantasy XIV. If there is something new there, I want it to show in my C++ program to. In other words, just keep scanning the FFXIV memory and everytime a new line of chat comes, also display it in my C++ tool.

I see most people use write / read memory (online tutorials) so I think it would be best to start there instead of starting at DLL injection?

Thanks for your answer so far jacky919!

P.S. Most tutorials I see people talk about addresses like "0x100579C", but that is no where near what CheatEngine is showing me. Am I doing something wrong?

I just wrote this code (which seems good?) only thing is I have no clue how to get a 0x000000 address from anything lol :P

Code:
#include <iostream>
#include <iomanip>
#include <windows.h>

using namespace std;

int main()
{
    // set some variables
    DWORD address = 0x100579C;	// the address which we want to read from
    int value = 0;		// storage for our value
    DWORD pid;			// process id storage
    HWND hwnd;			// handle storage

    // get the window handle
    hwnd = FindWindow(NULL, L"FINAL FANTASY XIV");		    // put the handle name in variable hwnd
    if(!hwnd)						    // check if the screen is found, if not display an error
    {
	cout << "Window not found!";
	cin.get();
    }

    // get the process
    GetWindowThreadProcessId(hwnd, &pid);		    // get the window his handle and put it into pid variable
    HANDLE phandle = OpenProcess(PROCESS_VM_READ, 0, pid);  // check if it is found, if not display an error
    if(!phandle)
    {
	cout << "Handle not found!";
	cin.get();
    }

    while(true)
    {
	// read what is in the memory and put it in the variable value.
	// we also check how much we are reading by calling sizeof(value).
	// at last we can check the number of bytes but we dont do that atm
	ReadProcessMemory(phandle, (void*)address, &value, sizeof(value), NULL);

	cout << value << endl;
	Sleep(5000);
    }

    return 0;
}
DarkTwilight is offline  
Old 01/14/2012, 17:44   #4
 
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
you have to find the pointer to your address otherwise you won't be able to use your programm (hack) after restarting the game, except your address is a static one (colored green in CE)

The differnces between a DLL-injection and using the WinAPI functions named about are, if you are using a DLL-injection you compile a DLL and inject it in your process.
The DLL usually starts a new thread in which your hacking functions are called. You are able to direct access the process memory, let me explain:
Code:
int* address = reinterpret_cast<int*>(0xFAFAFA);
*address = 9999;
Like this you can eccess address 0xFAFAFA for example and change it's value to 9999.
The other way is writing an application which is accessing the memory with WinAPI functions.
Looked at that way an DLL-injection is easier to perform in C++

Edit: Can characters not in ASCII table entered in the chat? e.g. ä/ö/ü or chinese/japanese words
jacky919 is offline  
Old 01/14/2012, 18:57   #5
 
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
Thanks for your reply jacky919.
You can use characters like "ëäöüï" in chat, you can even write japanese symbols (or chinese) in the chat. It accepts a lot. But you can also make macro's like:

type in: hell
press TAB-Key
It will give you various auto-complete suggestments like:

1. hello
2. hellfire
3. hellsguard

those things are some kind of macro function or w/e to call it. They come out as weard signs when I scan them with CE but thats least of my concerns haha. Im sure there is a way to fix that by replacing with some regdex code or something.

Anyways, using DLL injection looks nice, perhaps that will be the best method for me to use. On the downside, is it detectable? (the game does NOT use any anti-cheat software) cause if so, then I would go for the other option :P

If undetectable, then yes, DLL Injection would be best for me to start learning. Anyways, you have any suggestion on a tutorial on how to do that, or could you write me a simple one with nice comments in it so I can tear it apart and play around with it and so learn it?

Yet, I have no clue how to get the pointer to the address I need lol. The only information I can find about that "chat" is what CE gives me (CE = Cheat Engine lol).

Have a nice weekend, and thanks again for your fast anwers, really appreciate it

Yours sincerely


edit:
You know of any books that learn you this kind of coding in C++ ?
Dont know what is is called... hooking, memory reading / writing, (dis)assembly and so on?
I cant find any good books which can be ordered in the Europe ; ;
DarkTwilight is offline  
Old 01/14/2012, 19:26   #6
 
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
There are ways to detect a DLL-injection, but I don't think FinalFantasy is using those methods. I don't know any game detecting DLL-injections.

Code doesn't have any sense, the only thing could happen is your game will crash
I didn't compile it, but it should work
jacky919 is offline  
Old 01/14/2012, 22:17   #7
 
elite*gold: 0
Join Date: Sep 2006
Posts: 774
Received Thanks: 8,580
You should check out some CE tutorials on the official forum, they should be good for you.
phize is offline  
Thanks
1 User
Old 01/16/2012, 00:50   #8
 
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
awesome thanks for your answers guys

Where can I find those? all I see in C++ section on forum and nothing "official" there?

thanks for your answers guys!

Quote:
Originally Posted by Synsia View Post
You should check out some CE tutorials on the official forum, they should be good for you.
DarkTwilight is offline  
Old 01/16/2012, 09:53   #9
 
elite*gold: 0
Join Date: Sep 2006
Posts: 774
Received Thanks: 8,580
phize is offline  
Reply


Similar Threads Similar Threads
Memory Write
01/12/2012 - C/C++ - 8 Replies
Moin, ich mach grad ein c++ trainer tutorial durch, hab auch alles bis auf eine kleine sache verstanden ... Nur von der logik her: hier mit deklariere ich doch was der neue wert sein soll : BYTE AmmoValue = {0xA3,0x1C,0x0,0x0};
[VB]Write Memory bzw Read Memory
06/26/2010 - .NET Languages - 8 Replies
Hi Ich hab das TuT von *Guidman* benütz um einen hack zu machen. So aber nun hab ihc ein paar fragen könnte man memory teil kürzer machen und am besten wie kann man das selber machen weil ich will nihct immer C&P machen. Und zu Read Memory kann man das auch machen das ein Label immer die Bestimmte Ahnzahl angiebt von dem Pointer?.(Wenn das Read Memory ist ?) Bitte helf mir Danke
Injection vs. Memory Write
12/15/2009 - Aion - 11 Replies
Hallo, kann mir einer da mal den genauen Unterschied erklären bitte. Ich weiß nur das Injection hohe Banngefahr hat und Memory Write wohl nicht ? Danke Maxx.
C# Write process memory
08/16/2008 - CO2 Programming - 6 Replies
ok so i have a question about how do i use the api function writeprocessmemory in C#, i already have readprocessmemory but i can't seem to get writeprocessmemory... so if anyone could show me the call and an example (preferably a pinball example) it would be very helpful :) heres what i have so far: //================================================ ==============================================// // Function: MemoryOpen(int ProcessID])) // ...
Could TQ be using anti hooking and memory scanning
12/23/2006 - Conquer Online 2 - 18 Replies
Ok now before anyone panicks and goes all crazy this is just a discussion on possible techniques that TQ maybe trying to implement to prevent cheating. I have heard many folks on the conquer forums talking about conquer maybe using hooking and stealthing to thrawt cheaters. 2. I also have read where a mod mentioned that a new routine was introduced to passively scan most commonly used memory addresses and used by hackers, If this is so that might explain why some of the more popular...



All times are GMT +1. The time now is 02:59.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.