View Full Version: Your basic functions

CheatSync.net Forums > Cheat Device Development > Your basic functions


Title: Your basic functions


Durka Durka Mahn - October 13, 2007 06:44 PM (GMT)
This guide will teach you exactly WHAT the functions do and how to use them in certain situations.

You have multiple data types, and here are the basic ones:
Int
Float
Char
Short
Hex

This is how they look in the hex editor:
Hex:
00
Char:
00
Short:
00 00
Float and Int:
00 00 00 00

The difference between the types:
Hex can hold values between 0 and 255 (00 and FF). It is usually used as a Boolean (True/False) or for colors. (If you have ever used an image editing program, you will know that the colors have hexes between 0 and 255). You can not use decimals with this memory type!

Char is an abbreviation for Character. A Character is basically the same thing on the computer, anything that you can type with the keyboard, being the letters of the alphabet, numbers, and symbols.

Short is a value type that contains 2 bits. It is usually used in storing IDs, like in pcar+0x56 (the address showing what kind of car the player is in).

Int is much like Hex, you can't use decimals, however you can use negative numbers, and you can go much higher with ints. You can store any number that isn't a decimal between -2147483648 and 2147483647! (Fuck yea!)

Float is probably the most commonly used data type in the Cheat Device, simply because it deals with player location, rotation, etc. Floats can be negative and have a decimal, and can store extremely high value numbers.

To use these datatypes in the cheat device, you do it like this:

sethex(address, value);
setchar(address, value);
setint(address, value);
setfloat(address, value);
setshort(address, value);

Hope this helps!

dom_mc_cfc1 - October 13, 2007 07:02 PM (GMT)
nice! i'm gona use it :crazy:

Durka Durka Mahn - October 13, 2007 07:16 PM (GMT)
No problem!

BTW, you don't need to quote if you're posting right under what you're talking about ;)

deanoyabbadabba - November 14, 2007 02:44 AM (GMT)
i dont't get how you tell wether they are a Int, Float, Char, Short or a Hex

vettefan88 - November 14, 2007 04:58 PM (GMT)
QUOTE (deanoyabbadabba @ Nov 14 2007, 02:44 AM)
i dont't get how you tell wether they are a Int, Float, Char, Short or a Hex

like, how to tell what the value is in the game?
I don't think there is a definitive way to do so, but anything that is a # that woudl be displayed in the game is usually an integer, but they're commonly changed as chars because the numbers are small enough. sometimes the whole 4 bytes isnt' used.

everything that runs in the background and just controls the aspects of the game is usually a float. basically the values that control the game itself, and what happens in the game, if that makes any sense...

most of the time what your looking for will be a float, almost always, unless your looking for a specific # then it's probably an integer. (unless the # has a decimal, or could contain a decimal, then it's a float)
oh, and pointers are always integers, they will always have a 08 or 09 as the last byte when viewing the hex.

really, once you get into it you can just "feel" what it's supposed to be, there are patterns in floats for most of the common values, and you'll notice them, and you can figure out what the value is stored as. As you get more experience you'll start to notice things run and be able to determine what it is just by glancing at the hex.



strings can be set as char's or shorts depending on the string. names and static strings that don't change are usually 2 bytes, and set as shorts. strings that may only pop up once, or change during the game are 1 byte chars.


the only time a single byte change, using a char or hex will be required is with colors. RGBA values are always single bytes. sure there is always an integer or float value that could be used to get the same color, but it's completely impractical to write the color as them. unless you just wanted to make it black and transparent, in which case writing an int or 0 would suffice. but still impractical.




I'm sure that would just end up confusing people more, but I really can't describe how to determine what your looking at. you just have to keep trying and get experience within hex and eventually you'll start to get an understanding for everything you're looking at.

Waterbottle - November 14, 2007 05:05 PM (GMT)
QUOTE (vettefan88 @ Nov 14 2007, 06:58 PM)
the only time a single byte change, using a char or hex will be required is with colors. RGBA values are always single bytes. sure there is always an integer or float value that could be used to get the same color, but it's completely impractical to write the color as them. unless you just wanted to make it black and transparent, in which case writing an int or 0 would suffice. but still impractical.

setint( something, 0xAABBGGRR );
isn't any more impractical than
setchar( something, R, G, B, A );
In my opinion

vettefan88 - November 14, 2007 05:33 PM (GMT)
QUOTE (Waterbottle @ Nov 14 2007, 05:05 PM)
QUOTE (vettefan88 @ Nov 14 2007, 06:58 PM)
the only time a single byte change, using a char or hex will be required is with colors. RGBA values are always single bytes. sure there is always an integer or float value that could be used to get the same color, but it's completely impractical to write the color as them. unless you just wanted to make it black and transparent, in which case writing an int or 0 would suffice. but still impractical.

setint( something, 0xAABBGGRR );
isn't any more impractical than
setchar( something, R, G, B, A );
In my opinion

oh, I was refering to setting numbers with the setint and setchar. and hex with sethex.
setting the RGB with hex in setint works, but it's easier to breakdown each color if they're #'s. especially if there isn't a hex calculator available to convert something like 0xD1 to the #. Getting the #'s that make up your color, and then converting them to hex to be placed into the cheat is impractical imo.
and even if going the hex route, separating each color makes it easier to go back and edit.




Hosted for free by InvisionFree