I will teach you how to reverse a class, be patient as I am a novice @ reversing classes and ~Fallen~ and Giniyat202 helped me.
What you need:
A calculator (Google and Bing can do the calculator functions we need right in their search engine

)
Something to write in
STEP 1) Get the offsets/strings that you need.
so...
OHK:0x7F8
weight:0xACC
STEP 2) Arrange in increasing (IE: 1,2,3,4,5 not 5,4,3,2,1) order. It is a good idea to convert to decimal.
so...
Code:
OHK:0x7F8 -> 2040
weight:0xACC -> 2764
STEP 3) Find the useless bytes that you want to skip in your class/struct.
so...
let's start with one hit kill because it is the smallest:
OHK->0x7F8: everything before 0x7F8 is useless, why?
0x7F8 is useful, it is where we want to be. The last byte that is useless is 0x7F7, so 0x7F8-1 byte=0x7F7. Range 0~0x7F7 is useless.
Basically, you start at 0 and you want to jump to 0x7F8 because the rest is useless!
Do you think that is the end of OHK? Well, it is not. If you remember, the value of OHK is float, which is 4 bytes. We must reserve 4 bytes for this purpose
0x7F8+4 bytes = 0x7FC. 0x7FC is the last byte for our "OHK" range, everything after that is of no use for this feature!
Let's start building our struct: We are using a struct because we want the members to be public and a struct defaults to that (my personal preference)
Code:
struct _weaponclass (the name of our struct)
{
};
We need to skip all those bytes we talked about which would be 0 through 0x7F7 (you may convert to decimal if you like)
Code:
struct _weaponclass
{
char skipbytes01[0x7F8-0]; //we skipped our bytes to land on the one hit kill range (0x7F8~0x7FC)
float OHK;//0x7F8
};
We have successfully added one hit kill to our class. It is good practice to add the offset in a comment for your or other people's reference, but classes eliminate the use of offsets!
0let's move on to the next one that is bigger, which is Weapon weight
weight->0xACC: everything between One hit kill and weapon weight are useless, why?
0xACC is where we want to be. We just landed on one hit kill range which ends at 0x7FC because it is a 4 byte range. Now, we want to skip bytes and land on the weaight range. This is essentially 0x7FC~0xACC.
Again, this is not a 1 byte range rather, it is a 4 byte range. So, like we did with OHK, add 4 bytes to make it four byte range for Weapon Weight.
After our byte jump, we land on 0xACC, so 0xACC+4 bytes = 0xAD0. The four byte range is 0xACC~0xAD0. The latter is not needed because we are not continuing the tutorial onto other offsets. By now, you should have a basic understand on how to reverse the rest of a class!

Let's continue our struct, and infact, finish it for now!
Right now, it should look like this:
Code:
struct _weaponclass
{
char skipbytes01[0x7F8-0]; //we skipped our bytes to land on the one hit kill range (0x7F8~0x7FC)
float OHK;//0x7F8
};
We will add our next byte skip and a new member to the class:
Bytes 0x7FC~0xACC are usless, so we will make that the range of bytes to skip and then we will add our weight as our next member:
Code:
struct _weaponclass
{
char skipbytes01[0x7F8-0]; //we skipped our bytes to land on the one hit kill range (0x7F8~0x7FC)
float OHK; //0x7F8
char skipbytes02[0xACC-0x7FC];//we skipped our bytes to land on the weight range (0xACC~0xAD0)
float WeaponWeight; //0xACC
};
STEP 4) PAT YOURSELF ON THE BACK!
This must have taken you a while to read and comprehend, but hopefully by now you can move out of using measily offsets and can start using classes in your hacks.
Classes:
save time;
are easy to use;
make your code more readable;
make your code more efficient
Using a class is as simple as giving it a pointer and doing this:
class->member=value;
It's that easy
If you need more help, you can visit Brimir's tutorial on how to use classes in your hack base!
http://www.mpgh.net/forum/242-crossf...e-classes.html
I'd like to thank a few people;
@
~FALLEN~
@
giniyat202
Thanks for reading.