Hey everyone. So I'm writing this tutorial because I strongly agree with @Departure when he said what he said in his post here. To rephrase him, most "coders" here are just looking for respect by releasing things that aren't really theirs and not really explaining it. They either release source from other people/bases/releases and release either some parts or give no detail on it. They may not even give info on how to get the other parts. Minimal contribution from themselves is given, and they just tend to flame people when they are asking for help.
That's besides the point. I'm going to show you today how to use ReClass to simply reverse a class. As an example I'll be using the cScreenInfo class that I released yesterday since it is a small class, and not too complex. I myself, and new to this but one of my teachers said, "When you teach something to someone, its like learning it twice", which basically means you get better at it.
So the things you'll be needing are the following:
ReClass 2011 By Drunken Cheetah
Experience In C++
Understanding How Memory Works
Combat Arms Installed
An Injector
Before I start I would like to point out a few things that you all should pay attention to.
Open Classes:
Class Base Info:
Class Data Member Info:
So now that you keep those things in mind about ReClass, we can actually begin!
General Info:
Before we continue, lets recap and remember what it is that we are exactly trying to do here. What we want to do is reverse all the data members in this class so that we can use them and access them. Its easier to do this.
Lets Begin:
So first what we need to do is attach ReClass to Engine.exe. To do this, We need to open up our injector and open up a MessageBox. After the message box has opened, attach ReClass to Engine.exe and then, press Okay on the message box.
Getting Setup:
Now to get setup, we need to have our pointer ( class pointer ) for the class that we wish to reverse. I will not be going over this step, as the method I used is inaccurate and will not always work. There are a few ways to find the pointer. In this case, I will provide the pointer. Our pointer is 0x37823840. In some cases, the class will only be initialized when in game. But for this purpose, all you will need to do is log in to the game.
Setting Up ReClass:
We've made it so far! Now what we need to do is create a new class to reverse. We can simply do this by pressing the "New" button in the application.
After we create a new class you will see that there is a default base address and class name already set for you. This will be in the Class Base Info section I mentioned at the beginning of this thread.
Now what we want to do is set our information for our class. You can simply double click the default address and replace it with ours. You can also replace the name of the class the same way, by double clicking the text. The [64] in orange displays the current size of the class.
Knowing What We Have:
Next what we want to try and do is identify the things that we have in here. At the moment ReClass should look like this for you.
Some of you may be thinking this is just a whole bunch of garbage. Well, you are wrong! Before we continue lets identify everything we have in this image.
As you can see on the left hand side, written in red is how much further we have gone into the class by. How much we have gone into from our base class address. In green right next to it, is the actual address in memory. Right next to that in the blue will be any strings that are referenced. ReClass will show items per 4 bytes. Strings will be broken up into parts of 4. Next to the strings you can see the actual, original bytes of the point in memory. In Orange next to it will show you the float value ( 0.000 ) and the integer value ( 0 ). To watch all these things is a key part.
Assigning Data Types:
Now what we are ready to do is actually reverse this class and assign data types to each entry in the class. Well we are finding the screen resolution. If you go into the your settings in Combat Arms, You should see what you have set it to as the first entry. Mine is set to 1366 x 768. So the value of the first entry for me, is 1366. I know what that is now what holds the length in the resolution information. So we know what it will be a type of unsigned long.
⇓⇓
To assign a data type, click the item you wish to add one for and go over to the "modify" tab in ReClass and simply just press the type you wish to add. To rename the variable you just found, simply double click its default text and rename it.
Underneath this we see our height value. So now we know that that, holds the height of the resolution.
Now underneath we can see a 32 in the integer value. If we look in Combat Arms under resolution settings, there is an option for color quality of 16-Bit or 32-Bit. So we know this now holds that information.
Now when we encounter some information which may not be important, or we don't have enough information on, we can simply "pad" this (these) members. Simply declare them as text (char) and specify it to the amount of members you wish to pad.
⇓⇓
Underneath this we can see some more text which says "Default". We don't know what this is for exactly, but we can pad it and name it differently this time.
Finally underneath it we see that there is a pointer. ReClass will identify pointers to other classes as *->0xADDRESS
We can either reverse the class further or just store it as a variable, which we will do in this example.
To declare it as a pointer, which you might need to in other cases, you can just press the "Pointer" button from the modify tab. In this case, we will just declare it as a DWORD (unsigned long).
Wrapping It Up:
Are we done yet? Not quite! All that's left to do is check over our work and ensure that it is accurate. Once we have done that, we can hit up the "Generate" button on the main tab and it will give us our created class in C++ syntax.
As you can see, ReClass automatically provides information about the class and each data member. Its always good to double check and edit the generated class in a C++ Compiler.
For this case, to initialize our class we will call it as written above.
This is because we have an address which is a pointer to the class.
We're Done:
Well that's all I am able to teach you. I hope the information I have provided in this tutorial will help some people out on how to use ReClass and get a better understanding on things. I decided to use simpler terminology. Now I am still new to this, so I hope information isn't wrong, but I am sure I may have missed some things. This can also be applied to many other games. It depends on what you do with it.
Thanks.
Credits:
Flengo
Drunken Cheetah
Necrosyz
Great explaining tutorial! I will use this for sure.
You should explain how to reverse virtuAls, not how to reverse such an easy class xD
Good for noobs and beginners, but nothing helpfull for me
Originally Posted by Ch40zz-C0d3r
You should explain how to reverse virtuAls, not how to reverse such an easy class xD
Good for noobs and beginners, but nothing helpfull for me
I need to learn how to reverse virtuals first you know
When I do I may or may not post another tutorial.
Originally Posted by Flengo
I need to learn how to reverse virtuals first you know
When I do I may or may not post another tutorial.
J and Saltine are amazing are reversing. If you need help PM Saltine since J is either drunk or stoned on pills.
Originally Posted by ******
J and Saltine are amazing are reversing. If you need help PM Saltine since J is either drunk or stoned on pills.
I have Saltine on MSN, I guess I'll hit him up sometime. Thanks
Originally Posted by Flengo
I have Saltine on MSN, I guess I'll hit him up sometime. Thanks
If he doesn't respond tell him ****** is going to come after him and rape him.
Originally Posted by ******
If he doesn't respond tell him ****** is going to come after him and rape him.
Great job man! Glad to see someone who is not only actually learning, but then using that obtained knowledge to contribute to the shared knowledge pool of the community. Keep it up!
I agree Saltine,
For the new coders reading this tutorial it is vital you know your data types, for example Dword is 4 bytes an as said in the tutorial is the default for ReClass to use, a 32bit Integer is also a Dword which ofcause is 4 bytes, but there are variables that a just a word which is 2 bytes, and char is 1 byte(ascii) and 2 bytes for unicode, hence the reason they use an array of char for the padding of the unknown... the pointers are most times a pointer to either another class or a pointer to function. 1 thing flengo forgot to mention which is a little important is the size of the class, which is just an offset from the original address, he has 64 bytes in the picture but can be expanded for larger classes, to know the size of the class is just a matter of calculating all the data types in that class.
great job Flengo, I am sure it has helped new coders that want to understand a little more about classes, And this is what a coding category is about... teaching others and at the same time you are mastering what you have already learnt...
But im sure the class doesnt start at this address, I think it has been found with cheat engine.
Originally Posted by Ch40zz-C0d3r
But im sure the class doesnt start at this address, I think it has been found with cheat engine.
I went further back, and there was nothing there. Unless you can prove me wrong, that'd help me.