Essence of CE Assembly Language

## A Note from Freddy:

This tutorial is made so that even people with limited hacking experiences can understand. Each section is divided into Purpose, Definitions, Explanations, and Pro Tips. I am not an expert in this thing, but I am good enough to make you an intermediate-level hacker. There’s a Level 2 to this tutorial.

## Keywords to Learn

1. alloc
2. label
3. registersymbol
4. aobscan

**Why are we learning these first?**

Those four keywords appear in every single game-hacking script.

## #1 alloc

**It has the general format:**

* alloc(VariableName,Size,AllocateNearThisAddress)
* Purpose: to allocate a certain amount of memory near an address

**Definitions:**

* VariableName: a variable that you will write a code OR allocate some memory for (original is: newmem)

* Size: the size in bytes (original is $1000)

* AllocateNearThisAddress: although it’s optional to include this, make sure to write it if possible, so for hacking games, always include this (default is the address in Memory Viewer that you decided to Auto Assemble on).

**Explanations:**

* VariableName: The default data type is String, so no data type declarations are needed.

* Size: The default data type is Integer, so no data type declarations needed. The biggest integer you’ll ever find in your life is stored in 8 Bytes. So 8 Bytes in enough for any game hacking. We often keep the original size for the variable “newmem” as “$1000”.

* AllocateNearThisAddress: The default data type is String.

**Examples:**

alloc(newmem,$1000,7FFC226A47E0)           //what we often see as pre-existing codes

alloc(enemy\_health,8,7FFC226A47E0)           //what we often also need; just an example

**Pro tips:**

Recall what we learnt in the Introduction: for now, do not add spaces in between each word. Also, your VariableName is case-sensitive (so, if you allocate it as enemy\_health, NEVER write as Enemy\_health).

## #2 label

**It has the general format:**

* label(Name)
* Purpose: to let “Name” be used as an ‘abstract address’ OR as a variable in your code

**Definition + Explanations:**

* Name: A label (abstract address) is similar to objects (e.g. Java: private int enemyHealth and private int playerHealth) that are often stored inside registerSymbols (e.g. Java: public class SaveHealth). It’s best to label your “Name” to make your codes clear to the readers although CE does not care whether you label the “Name.” The default data type is String.

**Examples**

label(xposition)

label(save)

label(load)

save:  //common usage: stores information about xpostion

load:  //common usage: loads the saved player xposition

**Pro tips:**

Again, do not include spaces between brackets or words, and your “Name” is case-sensitive. There’re a few modifications of the class-object relationships when using Auto Assemble. This will be included in the next tutorial.

## #3 registersymbol

**It has the general format:**

* registersymbol(symbolName)
* Purpose: to add an user-defined symbol so that your Script and the Memory Viewer can use this symbolName instead of an address.

**Pro tips:**

CE recognizes this as a valid address. Confused? For example, when you manually add an address, you can use the symbolName. Of course, it has to store some information in it or else it’s empty (empty addresses store “??”).

**Definition + Explanations**

* The symbolName you registered (declared) can store information that multiple addresses have. Why bother? Well, consider you want to teleport. Now you have xpos, ypos, and zpos. You can label them separately. You can certainly allocate them together in one (e.g. store\_coordinates) BUT you can’t access them since CE doesn’t recognize it as a valid address. That’s what “registersymbol” is for.

**Why not just register every label instead? (Intermediate Level)**

Firstly, you confuse yourself and readers. Secondly, it takes more time to code and the compiler to run since you need to unregister each symbol and the CE compiler needs to see them all as valid. This will be covered in the next tutorial.

## #4 aobscan

**It has the general format:**

* aobscan(Name,?? ?? ?? ?? ??)
* Purpose: to locate the AoB in memory and assign its value to “Name”

**Definitions + Explanations**

* AoB stands for Array of Bytes and it’s a collection of bytes. Bytes store information, e.g. a single byte can store a single letter a/B/k, etc. Integers are often stored as 4 Bytes. An AoB is usually capable of storing lots of integers or strings(e.g. names) at once. If you see “??” or “?” within an AoB, it means that it’s constantly changing.

**Common Examples:**

aobscan(SomeSymbol, 00 ?? 8D 64 24 E0)

aobscan(SomeSymbol, 00 53 48 8D 64 24 E0)

\*\*\*Be sure to check out How to Make Your AoB Hacks page!

## References

https://wiki.cheatengine.org/index.php?title=Auto\_Assembler:alloc

https://wiki.cheatengine.org/index.php?title=Auto\_Assembler:label

https://wiki.cheatengine.org/index.php?title=Auto\_Assembler:registerSymbol

https://wiki.cheatengine.org/index.php?title=Auto\_Assembler:aobScan