A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Getting started with Cheat Engine, C++ and Halo [PC/CE]

Author Topic: Getting started with Cheat Engine, C++ and Halo [PC/CE] (13 messages, Page 1 of 1)
Moderators: Dennis

Sean Aero
Joined: Jun 7, 2009

HaloRank.com


Posted: Apr 4, 2012 06:27 AM    Msg. 1 of 13       
Hello and welcome to a small guide on how to get started with Cheat Engine, C++ and coding for Halo [PC/CE].
As you might have noticed, my name is Sean Aero and I'll be your guide for today, but before we get stared there are is one things you need to know about this tutorial and two things you need to know about my C++ programming level.
First, once you are done with this small guide, you'll have a very basic understanding on how to code a very tiny app for Halo [CE/PC].
So sorry to crush your hopes, but don't expect you'll learn how to create a super awesome, anti-legit, lame-bot, ClosedSauce, Stats Nuking application after you are done reading this.
This guide just helps you to "get started" nothing more.
Second, my C++ programming skill, it's basically non-existent. I'm probably the worst person to teach you how to do get started, but I'll try any way.
Third, I haven't touched C++ in over 2 year, sad but true.

So why am I, the guy with such bad C++ skills, writing a small starting guide with C++ and coding for Halo [PC/CE].
To be honest, no clue, but let's assume the better programmers have "better" things to do for now.
No worries, I'm sure we'll meet them a bit later on as this topic grows, I'm sure they have constructive comments on how bad this tutorial was and how you and I should do it properly.
A win/win situation for you and me both!

So why do I even bother?
Well let's just say that I'm able to count the amount of people that are currently programming apps for Halo [PC/CE] on one hand, and I'm missing my index finger... (>.<)
Okay maybe not, but still, I hope I can get some people interested in just playing around with Halo [PC/CE] and even learn the trade of programming in C++ as this can be quite usefull in life.
Enough sentimental bullcrap, let's get started.

The topics, I'll be handeling are the following and should be done in the order as they are listed.
(keep in mind, it's all just a starting guide and doesn't come close to awesomeness, but it sure is fun!)

1. Halo's Memory.
2. How to access and find a memory address in Halo with Cheat Engine?
3. How to access, READ and WRITE a memory address with C++?
4. How to program your first Halo C++ app!

And finally
5. My bankaccount number for donation, just kidding, a simple reply to this topic is cool enough.

Just one last thing before we get started.
For this tutorial I'll make use of the following programs, I recommand you install them before reading on.
These are:

Halo Custom Edition v1.09 [English]
http://hce.halomaps.org/index.cfm?fid=410
It's important for this small guide that you use the same version as well as the same language version of HaloCE as me.
The reason for this is that each version of Halo [PC/CE] as well as each language version of Halo [PC/CE] is a bit different.
These differences can cause certain information that was stored in location "A" in version 1 to be stored in location "B" in version 2.
This is not always the case, but it is something to keep in mind.

Microsoft Visual Studio 2010 or the free "Express" version:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
We'll use MSVS10 (short name) for the actual C++ programming and compiling of your Halo[CE/PC] app.

Cheat Engine
http://www.cheatengine.org/downloads.php
What is Cheat Engine?
Cheat Engine is an open source tool designed to help you with modifying single player games running under window so you can make them harder or easier depending on your preference(e.g: Find that 100hp is too easy, try playing a game with a max of 1 HP), but also contains other usefull tools to help debugging games and even normal applications.
We'll use this tool to play around with Halo's memory.


Alright now with everything installed, let's get started!

1. Halo's Memory.
For obvious reasons I assume that you have actually played Halo [PC/CE] and therefor you probably messed around with a few Halo [CE/PC] apps.
So you must probably have wondered, "ARRGG... How do they work?".
Well the answer for most of these Halo apps is quite simpel.
The apps READ and/or WRITE data into and/or from Halo's Memory.

So let me explain a bit more what I mean by Halo's Memory and why it's "so important" in this small guide.
Take a look at the definition found on the web of the word "memory" within computer science: "A unit of a computer that preserves data for retrieval."
Okay, so it's basically saying that, memory in general, is something where information is stored so we can access and retrieve it later.
This means that when I speak of "Halo's Memory", I'm basically speaking of a unit of memory that is dedicated to store all information related to the Halo [CE/PC] game, at least while it's running.
You probably figured out by now why Halo's memory must be important and quite interesting but just to be a bit more clear a small example.
If I told you to remember your current Halo score of 14 for now because I want you to add additional scores later then I'm quite sure you would either do 2 things.
You would write your score down on paper/notepad/whatever or just keep it in mind.
Both actions are a hands on example of storing certain values(scores) in memory.

I hope you realize by now that Halo's memory contains all values/information that are stored and related to the Halo [CE/PC] game.
This means, scores, positions, names, slots, ammo count, current weapons, devmode, etc., everything that Halo has to remember, is all stored in Halo's memory.
Sounds to me like a sweet vault that we want the access to!
Fortunate for us, there is a tool called Cheat Engine that allow us to do just that and I'll go into more details in the second part of this small guide.


2. How to access and find a memory address in Halo with Cheat Engine?
Of course you installed Cheat Engine, like I told you before. (-.-)
But before we start getting our hands dirty, I want to give you a few small suggestion as this will make the whole learning and doing process a bit more convinient.
Right click your HaloCE shortcut, click Properties and add the following parameters at the end of your "Target:" box -console -window.
On my 64-bit OS it looks like this: "C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\haloce.exe" -console -window
The -console parameter will allow us to open up the console screen in HaloCE and the -window parameter will allow us to start HaloCE in window-mode.
This is very convininient since we'll be switching between HaloCE and Cheat Engine quite a lot.

Second I suggest you don't have any custom maps present in your /maps folder, as we'll be restarting HaloCE quite a bit.
I'm not sure about you, but I'm not up for waiting a few hours for HaloCE to load while working on this small guide, unless you have a fast SSD drive like I do, it's only 10,000km away.

Third do read the "about" information on what Cheat Engine actually as previously mentioned as this will help you with your understanding why we are using Cheat Engine.

Okay so we basically have all the tools we need to access Halo's memory and instead of explaining all kinds of theoretical stuff before we get start, I think it's better to point out things as we encounter them.
So go ahead start-up HaloCE (make sure it's in window mode)
Once you see the main menu just let it be, press the Alt+Tab key to unfocus from Halo and open up Cheat Engine.
Just incase Cheat Engine asks you to do a tutorial, just say "No" for now.
You should be seeing an screen which looks like this:

As you can see there is a glowing box around the top left PC icon.
On mouseover it says "Select a process to open", we'll be clicking this icon in a second but before we click it I want to make things clear why we want to select a "process".
Here is a definition on the word "process" in computer science:
"A running software program or other computing operation."
In this case HaloCE is a running software program so it can be called a process.
Thus we want to select the "HaloCE process" in order to get access to it's memory.
Okay go ahead, click the computer icon.
Another smaller screen should pop-up called Process List.

Find the HaloCE process, it will have a combination of 8 digits consisting of letter and numbers, this combination makes up the "process ID" of the program.
As shown on my PC (Your number and digits could be different, nothing to worry)

This is how your Operating System refere to a process, by it's ID, not by it's full name.
With HaloCE selected click the "Open" Tab.
(If you don't see HaloCE in this list, please make sure HaloCE is actually running and you Alt+Tab, not Alt-F4 out of the game.)


Now the top center of Cheat Engine should display the process we have just selected.
This is a good sign and I should congratulate you, we just opened the vault! \o/ (read part 1 for reference)
We now have access to Halo's memory and can start doing some fun things. However there is a slight problem.
To stick a bit longer with the vault example, just like a real vault, it usually contains "numbered deposite boxes", but it's not like we know before hand which "numbered deposite box" contains the treasure we are looking for.
Going back to an actual memory example, a numbered deposite box is called a "memory address", by definition, it's the location where a certain memory is stored.
So as you can imagine while you are playing HaloCE online, all your scores, name, kills, deaths, x-position, y-position, etc. as well as all the data from other players and the data from the actual games are all stored at different memory addresses.
This means that before hand we have no clue which "memory address" we are suppose to target.
Fortunate for us, this is where Cheat Engine can help us.
Cheat Engine allows us to search the contant of each single box and it will return us the memory address of all memory addresses that contain the value we are looking for.
You are probably thinking well that's great, problem solved, well not exactly...

I'll show you why by an actual hands-on example:
Alt-Tab back into HaloCE (I assume you are still at the main menu)
Click Multiplayer -> Lan -> Bloodgulch -> Classic Rockets -> Start Game
Hold F1 and have a look at your score, you probably seeing the same things as me.

So assume we would like to figure out, at what memory address our "Death score" is stored.
Not the most interesting of scores, but it's easy to do, when you are alone in a server.
In this case we would search for a value of 0 since our death score is 0.
Hopefully your mind gave you a flag with the following problem indentification: "But my score, kills, assists are also all 0, this will give problem, right?."
Good job, young grasshoper! You just realised that there is actually a good chance that while searching for a certain value, more than 1 memory addresses could pop-up.
To stick with this example we are going to give it a try anyway.

Go ahead alt-tab back to Cheat Engine, type in a value of 0 in the "Value" box, leave the Scan Type setting to "Exact Value".
Now comes the difficult part, "Value Type" selection, the best practice for this comes with experience.
Usually before hand we have no clue how many bytes are "reserved" for certain scores or values.
There for selecting the wrong type can give you wrong results, but no fears I recommand to stick to either a Byte or 2-Bytes for an initial guess.
(Any one more experienced with better suggestion, feel free to comment)

For this example we'll stick to a "Value Type" of 2-Bytes, once selected hit the "First Scan" button.
(Note: Just incase if you don't see this button, because you were too eager to press buttons,hit the "New Search" button first and the "First Scan" button will automatically follow.)
Depending on your computer speed, Cheat Engine should search Halo's Memory quite fast and return all results in the column on the left.
Now read how many matches have been "Found:" on the top-left. On my screen it's 97,374,201.

Yeah exactly, it's over 90 Milion! (don't worry if your number is a bit off)
So which memory address is the one we are looking for? To be honest, I have no clue, we'd be better off playing the lottery.

But wait there is hope!
Now that we did our "First Scan", we have actually narrowed down all the memory addresses to those that only contain a value of 0 on the exact moment that we pressed the "First Scan" button.
On these narrowed down memory addresses, we can make another search! That's great news!
This means that if we can actually change our death score in-game, by "getting killed or accidently suiciding" to a death score of 1.
We can attempt a new search.
So yeah, go ahead, grab that rocket launcher and commit suicide... in-game ofcourse.
(please stick to suicides for now, as this will help you in this small guide)

Once your death score has changed from 0 to 1, alt-tab to Cheat Engine, type in a value 1 and press the "Next Scan" search button.
The "Next Scan" search button allows you to do a new search on the narrowed down memory addresses.
After the search my Cheat Engine narrowed the memory addresses down to 5,877 results.
So we are on the right track, we just went from over 90M down to 5,8k.
We'll keep repeating this same process for 2 more rounds.

It should narrow down from 5,8k, down to approx 40 ~ 50, down to eventually 6 results.
So at this stage we have 6 results left on the left column!

AWESOME!
As you may have noticed all 6 values seem to change according with every suicide we make.
So which one is the correct one?
Good question!
Before we move on, I want you to select all 6 memory addresses in the left column of Cheat Engine by pressing and dragging, once they are all selected, hit the small red arrow pointing South-East.
(Double clicking each memory address is also a possibility)
All memory addresses should now be in the middle bottom column which is called the "Address List".
The Address List is used to keep the addresses in a list for later use, so no matter what you search or how the left column changes, these addresses will always be present in the Address List.
At this stage, you could do 2 things, either just try changing them manually and see what happens in-game or try to deduct them even a bit further!
We'll go with option number 2 and try to deduct a bit further. You might ask, "Why do it the hard way?", well that's because we want to know and understand what the other values are.
So think about the repetitive method we have been using to get to this stage:
1. Cheat Engine search
2. Suicide ingame
3. Cheat Engine search
4. suicide ingame
5. Cheat Engine search
and so on.

What comes to mind?
Exactly, all our deaths have been caused by suicides, which could mean that Halo also keeps track of suicides(!).
In order to confirm this we'll have to think of a different method to die ingame other than suicide.
Try to think of all the ways a player can die in Halo. As a hint there are 2 possibilities, answer listed right in the next sentence.
There are basically 2 in this case still, asuming you are alone in the server, "Get Killed by a vehicle" or "Fall to your death".
I'll leave it to you to figure out how to do either one on bloodgulch.
So now we increased our death score once more, but we didn't commit suicide.
Do another search in Cheat Engine with your new Death score.
As you can see the number of addresses in the list went down to just 2!

These are:
- 0064BAF2
- 402AB07A

Now check the "Address List" (bottom middle column) what do you see?
The other values are unchanged, meaning that they are probably in some way related to suicides.
Good thing we stored them, so we can look into it a bit later if needed.
(not going to, but if you are interested to do it yourself feel free)

Back to the two remaining addresses, we are going to try to manually change them one by one and see what happens.
First let's try changing 0064BAF2, to let's say a value of 12 and see what happens.
Go to the Address List, double click the "Death score" number in the "Value column" of the row with address 0064BAF2.
Cheat Engine will pop-up a screen asking you: "what value to change this to?"
Type in 12, press ok.
What happened?
The moment you pressed Ok, the value changed for an instant to 12 and then changed back to your old score.
When you look in-game, nothing has changed.

So it seems this is not the address we are interested in.
Try changing the other address 402AB07A to a value of 12.
What happened?
It seems that both 0064BAF2 and 402AB07A changed to a value of 12.
Now check in-game, it seems we have 12 deaths now!

Congratulations you just cheated Death, boy he'll be pissed.
So starting with an initialy search which gave over 90 milion memory addresses, we deducted, with pure logics, all the way down to a single address.
Which allows us to cheat Death, pretty epic!

You succesfully, learned how to access Halo's memory and actually find a memory address with the use of Cheat Engine.
Just one more tip, at all times keep in mind under what condition you did the search.
For this small guide we did all our searches under LAN settings in a rocket type game-settings which we hosted, it could very well be that for online play different addresses are used.(*wink, wink*)
For now I recommand you play with Cheat Engine around quite a bit, until you are able to find the following addresses:
Suicides
Kills
Scores
and if you want to test yourself try finding:
Betrayels.

Feel free to comment in this topic with your findings and how you achieved them.
Other memory addresses are also welcome of course!

I would also recommand you get used to the Cheat Engine interface and make good use of the "Address List" and memory browsing(not explained in this small guide).
Try to make a nice Description with every memory address you find and save your "Address List" before closing as this will only help you as you find more and more memory addresses.

Other than just score related, I would like to give one more example on finding a memory address.
We are going to determine where the memory address of DevMode is located!
Sick, right? Not really.
But it's a bit of a different approach, because in this case we really have no clue on what the value of DevMode contains.
The best we could do is assume that it's either TRUE (1) or FALSE (0) but this would still just be a wishfull thinking and it could be totally wrong.

So instead we are going to assume we know nothing, there is only a single thing we can control and that is, turn devmode on or off at the start of the game by setting the -devmode parameter.
I'll give you the plan, it's up to you to try it out for yourself.
We'll use this devmode memory address later on to create our first Halo C++ app! So make sure you get it right!
(The actual answer address is given in chapter 4)

Here is the approach you should take to find devmode:

I assume you have both Cheat Engine and HaloCE closed for now.

1. Start HaloCE without devmode
2. Start Cheat Engine
3. Select HaloCE process with Cheat Engine
4. As a "Scan Type" select "Unknown Initial Value" (because we have no clue what the initial of devmode is)
5. Press First Scan
6. Close HaloCE
7. Open HaloCE with devmode
8. Select HaloCE process with Cheat Engine again, as the "process ID" has changed for HaloCE when we close and restarted HaloCE.
9. As a "Scan Type" select "Changed Value" as the value for devmode, should have been changed since our last scan.
10. Press Next Scan
11. Close HaloCE
12. Open HaloCE with or without devmode
13. Select HaloCE process with Cheat Engine again
14. As a "Scan Type" select either "Changed Value" or "Unchanged Value" depending on your last scan and how you start HaloCE.
15. Keep repeating this process until you notice no more changes in the number of "Found" addresses.
16. Manually try to change values according to what you observed, from running HaloCE with and without Devmode
17. Make me proud and make a small post if you managed to find it or if you have troubles or questions.

The answer for the actual address is given in Chapter 4.
If you can do this on your own, you're pretty much good to go!

3. How to access, READ and WRITE a memory address with C++?
Wow, it seems you are still reading after that long story on Cheat Engine, keep it up soldier because the next step ain't that easy!
C++, Ooh boy, here we go.
Let me put it this way, I'm not going to teach you the basics of C++, nor am I going to teach you how to code C++ well.
There are an enormous amount of resources available on the web to help to get you started.
The only thing I'll be doing is teach you how to access, READ and WRITE memory address with C++.
It's up to you to polish your code and skill to a level where you are actually able to fully understand what's going on and how to use it properly.
Again just a reminder, if you missed the introduction "my C++ programming skill, it's basically non-existent. I'm probably the worst person to teach you how to do get started, but I'll try any way.
and I haven't touched C++ in over 2 year, sad but true."
With that being said I wish you luck!

Of course you installed Microsoft Visual Studio 2010 (MSVS10), like I told you before. (-.-)
If not, you'd better get to it as you'll be needing this magical piece of software to follow along.
(ARGG I have to find my way in MSVS10 a bit, be back later with part-DUEX (II)

4. How to program your first Halo C++ app!
Coming a bit later.


Sean Aero
Joined: Jun 7, 2009

HaloRank.com


Posted: Apr 4, 2012 06:56 AM    Msg. 2 of 13       
Quote: --- Original message by: ELEVERX
Thanks for this exelent tutorial but can you use this to change stuff in multiplayer cause you said cheat engine was for single player games


Good question, in this case you'll have to keep in mind that there is a client and server side.
Both the client and server have their own roles, at all times, the server is the one in charge and sends all scores and positions of each player to the clients.
If the server tells you to die, you die, regardless of what the client tells you.

So the answer to this question, it's certainly possible to do the same thing in multiplayer you just have to make sure you are either Host or have a dedicated server running on your PC which you can access with Cheat Engine.
In case you are running a halodedicated server, you would select the halodedicated process in Cheat Engine instead of the actual HaloCE process to change the scores.

Hope I answered your question.


The Cereal Killer
Joined: Mar 18, 2011

Scripts, AI, cutscenes, ui_widgets, animation.


Posted: Apr 4, 2012 03:20 PM    Msg. 3 of 13       
I don't personally use cheat engine; however, this is a great and extremely thorough tutorial, and it would be extremely unfair for you to only have two replies.


Sprinkle
Joined: Jan 3, 2010


Posted: Apr 4, 2012 05:36 PM    Msg. 4 of 13       
I hope you aren't using C++ CLI


OpsY
Joined: Feb 19, 2007

Frobisher Bay


Posted: Apr 4, 2012 07:06 PM    Msg. 5 of 13       
Very nice of you to post this tutorial. Well done and very clear. Could you upload it to the database once it's finished?


Sean Aero
Joined: Jun 7, 2009

HaloRank.com


Posted: Apr 4, 2012 09:22 PM    Msg. 6 of 13       
Quote: --- Original message by: The Cereal Killer
I don't personally use cheat engine; however, this is a great and extremely thorough tutorial, and it would be extremely unfair for you to only have two replies.

Thanks, appreciate it. Out of curiosity, what do you use?

Quote: --- Original message by: Sprinkle
I hope you aren't using C++ CLI

I'm afraid I am/was in the beginning.
I'll see if I can stick to C++ for this tutorial, might dig into Qt.
Suggestion and sources are welcome.

Quote: --- Original message by: OpsY
Very nice of you to post this tutorial. Well done and very clear. Could you upload it to the database once it's finished?

Will do! Will get rid of a few grammar problems before uploading.


Limited
Joined: Feb 2, 2008


Posted: Apr 4, 2012 10:38 PM    Msg. 7 of 13       
Nice tutorial.

I just wanted to point out a few tips to people reading this tutorial.

As you are trying to narrow down an address, you want to basically make it as easy for yourself to find it, within the quickest time.

If its possible, you want to try and make whatever your looking for as unique as possible. For example if I was trying to find my death count, I would first give myself 5 deaths and then start searching from there. The reason being there are millions of addresses beginning with 0, and you will have to search for every instance, thats going to be both slow and return a lot of results. There will be rather a lot returned with 5, but it will generally be faster and return less unwanted results.

That said the reason Sean used 0 in the tutorial, was to show that you will sometimes end up with tons of addresses and you need to whittle them down.

Soon I'm going to make my own video tutorial/accompaning PDF file as a final note for Halo :)


Sprinkle
Joined: Jan 3, 2010


Posted: Apr 4, 2012 10:52 PM    Msg. 8 of 13       
Qt is pretty cool and easily customizble with the style sheet, although I would imagine most beginners would have trouble setting it up. I would stick with C# as it has everything without the conflict of managed and unmanaged code, CLI tries to turn C++ into something it's not. I just stay away from it completely, it doesn't offer anything that isn't available through normal C/C++ libraries.


Limited
Joined: Feb 2, 2008


Posted: Apr 4, 2012 11:06 PM    Msg. 9 of 13       
I use DevC++ when I code in C++, I like it raw :D


sehe
Joined: Apr 5, 2012

ayy lmao


Posted: Apr 5, 2012 06:12 AM    Msg. 10 of 13       
Hy all!

Here is my "tutorial" to how to make this devmode switch, like a boss: with an injected dll and GetAsyncKeyState :P
C++ knowledge is advantage, but np if ur new, u can just copypaste it :D

btw. I recommend u to get at least a Pro version of VS2010, its better for newbies. Its free for students, or you can download one from "those" sites ;)

OK, so first open VS, File->New->Project.
Choose Visual C++ -> Win32 Project. Name it to "Halo CE 1.09 dev" or whatever you want. Make sure that "Create directory for solution" is ticked. Click OK.

In the following window, click Next, then as Application type, choose DLL. Don't forget to make "Empty project" ticked. At last click Finish.

In the solution explorer, right click to Your project->Source File, Add->NewItem... Choose cpp file, name it to main.cpp, click Add...

Now copypaste this code:

#include <windows.h>

bool *DevModeSwitch = (bool*)0x006BD17E;

DWORD WINAPI MainLoop(LPVOID)
{
while (true) //infi loop
{
if(GetAsyncKeyState(VK_NEXT)&1) // PageDown, once
{
*DevModeSwitch = 0; // disable devmode
}
else if(GetAsyncKeyState(VK_PRIOR)&1) // PageUp, once
{
*DevModeSwitch = 1; // enable devmode
}

Sleep(1000); // 1 sec
}
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ulReason, LPVOID lpReserved)
{
if(ulReason == DLL_PROCESS_ATTACH)
{
CreateThread(0, 0, MainLoop, 0, 0, 0); // create a new thread for the app so injection won't fail etc.
}
return TRUE;
}


At the top, change "Debug" to "Release".
Finally, Project-> Properties, and change "TargetName" to "HaloCE109dev".

OK, Save.

If now I linked a dll injector, ppl would have QQ'd that it contains viruses etc., so i rather copy here a small but great code, so u can c that there is nothing bad in it...

Now again in the Solution Explorer, right click on the "Solution 'Halo CE 1.09 dev' ...", Add->New Project, "Win32 Console Application", name it as "Halo CE 1.09 dev injector" or sth like that, click OK.
Click Next, then tick "Empty project", then click finish.
At this new project, right click to "Source Files", Add->New Item, and choose cpp file and name it as main.cpp again. OK.

Now copypaste in that file this 'huge' code (general method of injecting a dll):


#include <Windows.h>
#include <iostream>

using namespace std;

#define MAXWAIT 10000

int main(void)
{
DWORD processID = NULL;
HWND windowHandle = NULL;
if(windowHandle = FindWindow(L"Halo", L"Halo")) // Get the process ID of Halo from the window title
GetWindowThreadProcessId(windowHandle, &processID);

if(processID == NULL)
{
cout << "Halo is not running!" << endl;
return -1;
}

//Find the address of the LoadLibrary api, luckily for us, it is loaded in the same address for every process
HMODULE hLocKernel32 = GetModuleHandle(L"Kernel32");
FARPROC hLocLoadLibrary = GetProcAddress(hLocKernel32, "LoadLibraryA");

//Open the process with all access
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);

//Allocate memory to hold the path to the Dll File in the process's memory
LPVOID hRemoteMem = VirtualAllocEx(hProc, NULL, 17, MEM_COMMIT, PAGE_READWRITE);

//Write the path to the Dll File in the location just created
WriteProcessMemory(hProc, hRemoteMem, "HaloCE109dev.dll", 17, NULL);

//Create a remote thread that starts begins at the LoadLibrary function and is passed are memory pointer
HANDLE hRemoteThread = CreateRemoteThread(hProc, NULL, 0, (LPTHREAD_START_ROUTINE)hLocLoadLibrary, hRemoteMem, 0, NULL);

//Wait for the thread to finish
bool res = false;
if (hRemoteThread)
res = WaitForSingleObject(hRemoteThread, MAXWAIT) == WAIT_TIMEOUT;

//Free the memory created on the other process
VirtualFreeEx(hProc, hRemoteMem, 17, MEM_RELEASE);

//Release the handle to the other process
CloseHandle(hProc);

if(!res)
cout << "Successfully attached the dll!" << endl;
else
cout << "Failed to attach the dll!" << endl;

return res;
}


Save.

Build->Build Solution.

If you did everything good, your files will be in the "C:\Users\<username>\Documents\Visual Studio 2010\Projects\Halo CE 1.09 dev\Release folder.
Don't forget that you have to copy the "HaloCE109dev.dll" into your Halo CE folder.

You can also make a small batch file here, to check the messages:
Make a new txt file, then rename it to "injector.bat".
Right click on it and choose Edit.
copypaste this and then save:


@echo off
cls
"Halo CE 1.09 dev injector.exe"
pause


You are done!

Start Halo, inject the dll with the dll injector.
You can turn devmode on with PageUp, and turn it off with PageDown buttons.

Now you've got everything u need, the others are up to your fantasy :P
Have Fun! =)

seh鰰


The Cereal Killer
Joined: Mar 18, 2011

Scripts, AI, cutscenes, ui_widgets, animation.


Posted: Apr 5, 2012 01:45 PM    Msg. 11 of 13       
Quote: --- Original message by: Sean Aero
Out of curiosity, what do you use?
Oh I didn't mean to imply that I had an alternative for it. I just haven't gotten much involved in this type of thing.


Sean Aero
Joined: Jun 7, 2009

HaloRank.com


Posted: Apr 6, 2012 12:41 PM    Msg. 12 of 13       
Quote: --- Original message by: goldkilla88
Quote: --- Original message by: seheC++
seh鰰


This is useful and very cool, but don't just randomly thread jack. Could have asked Sean first.

Anyway, thanks alot Sean, its always nice to have more tutorials floating around.


No problem, hope it gets some people interested.
Will continue to build on this, hopefully with some other people pitching in at times we should be able to produce a decent document which helps people get started or teach a new trick or two.
Youtube is also a great medium, so will do some stuff there as well, for those people that are not fond on reading a wall of text.

I'm personally looking forward to some tip and tricks from Limited, hope you'll really do it this time. As for sehe "tutorial" I ask him to share a bit of his knowledge as my "old Halo C++ files" are on my desktop, which is 10,000km away from where I'm currently at. :/


sehe
Joined: Apr 5, 2012

ayy lmao


Posted: Apr 6, 2012 01:51 PM    Msg. 13 of 13       
Quote: This is useful and very cool, but don't just randomly thread jack. Could have asked Sean first.

Ty. and I did asked Sean, thats y I wrote it lmao ^^'

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 9:34 AM 171 ms.
A Halo Maps Website