Difference between revisions of "Help File:Value types"

From Cheat Engine
Jump to navigation Jump to search
m
 
Line 1: Line 1:
 
[[Category:Help]]
 
[[Category:Help]]
; Binary
+
Cheat Engine supports a variety of scan types for searching memory values in running processes. Each scan type is designed for specific data representations and use cases. Below is an overview of the available scan types and their typical applications.
: The binary scan is a slow but powerful scan.
 
It will scan between bytes for a value.
 
  
Also, if you want to search for a array of bits that possible too, it even allows wildcard(?,*) instead of the normal 1's and 0's. This allows you to do a search like 1101?001, which will give the results of all addresses+bit that have either 11010001 or 11011001. (More wildcards in a string are allowed)
+
== Binary ==
 +
The binary scan is a powerful but slower scan type that allows you to search for specific sequences of bits in memory. 
 +
You can use wildcards (<code>?</code> or <code>*</code>) to match any bit, making it possible to search for patterns like <code>1101?001</code>, which matches both <code>11010001</code> and <code>11011001</code>.
 +
This is useful for finding values stored in non-standard bit arrangements or when only part of the bit pattern is known.
  
The range of a bitscan can be as long as you like. (as long as it fits in the memory)
+
== Byte (8-bits) ==
 +
A byte can hold a value between 0 and 255 (unsigned) or -128 to 127 (signed).
 +
1-byte values are common in 8-bit emulators and older software. 
 +
Scanning for 1-byte values can yield many results, but increases the chance of finding the correct address when the value size is unknown.
  
If you're wondering if this is useful:
+
== 2 Bytes (16-bits / WORD) ==
 +
A 2-byte (WORD) value can hold numbers between 0 and 65535 (unsigned) or -32768 to 32767 (signed). 
 +
These are often used in older DOS games and 16-bit applications.
  
Lets say a program stores the following values as follow:
+
== 4 Bytes (32-bits / DWORD) ==
  100=1001100100110110
+
A 4-byte (DWORD) value can hold numbers between 0 and 4,294,967,295 (unsigned) or -2,147,483,648 to 2,147,483,647 (signed). 
  200=1011001000101001
+
This is the standard integer size for most Windows applications and is usually the best default scan type.
  300=1100101100110110
 
  
Also note that in normal binary notation the following values are:
+
== 8 Bytes (64-bits / QWORD) ==
  100=1100100
+
An 8-byte (QWORD) value can hold very large numbers, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. 
  200=11001000
+
These are less common, but are used in 64-bit applications and for storing large values.
  300=100101100
 
  
Now, if you look at the above example you'll notice that the binary value of 100 does apear in the binary that represents 100, but has a 1 as last bit, and the first few bits are random (read from right to left) , same for 200 and 300, with the binary scan you can scan for the binary representation of the values 100-200 or 300.
+
== Float/Single (32-bits, IEEE Standard) ==
 +
A single-precision floating point value (float) can represent numbers between approximately 1.5 × 10^-45 and 3.4 × 10^38. 
 +
Floats are stored in a special format (IEEE 754) and are commonly used for decimal values in games. 
 +
Cheat Engine rounds float values for scanning, so searching for <code>12</code> will find values between <code>11.5</code> and <code>12.4</code>.
  
 +
== Double (64-bits, IEEE Standard) ==
 +
A double-precision floating point value (double) can represent numbers between approximately 5.0 × 10^-324 and 1.7 × 10^308. 
 +
Doubles are more precise than floats and are used when higher accuracy is needed.
  
; Byte (8-bits)
+
== Text ==
: A byte is a value that can hold a number between 0 and 255 or -128 to 127. (The last one if it is a signed value)
+
The text scan type allows you to search for strings in memory.
: 1-byte values aren't used much except for 8-bit emulators, etc... Even though a 1-byte scan seems useless, it will normally find the value when you don't know for sure if the value is either 1-byte, 2-bytes, 4-bytes, or 8-bytes, that is because all those types are build from this base type.
+
Text can be stored as UTF-8 or UTF-16 (widechar).
 +
This is useful for finding variables that are stored as readable text.
  
Of course, the number of initial addresses you'll find doing a 1 byte scan is very big, and it will take a while to find the address you're looking for, but at least the change of finding it is higher.
+
== Array of Byte (AoB) ==
 +
An array of byte scan lets you search for a specific sequence of bytes, with support for wildcards (<code>??</code> or <code>**</code>). 
 +
This is especially useful when you know a unique pattern of bytes near the value you want to find.
 +
Example patterns:
 +
<pre>
 +
xx xx xx xx ...
 +
xx ?? xx xx
 +
xx ** xx xx
 +
</pre>
  
 +
== All ==
 +
The "All" scan type combines byte, 2 bytes, 4 bytes, 8 bytes, single, and double types. 
 +
It is useful when you are unsure of the value's data type, but may return many results.
  
; 2 bytes (16-bits / WORD)
+
== Custom ==
: a "2 Byte" value can hold a number between 0 and 65536 or -32768 to 32767 (The last one if it is a signed value)
+
Custom scan types allow you to define how bytes should be interpreted using Lua or Auto Assembler scripts. 
: "2 byte" values are used in old dos games, and other 16-bit applications.
+
You can create, edit, or delete custom types by right-clicking the value type box in Cheat Engine.
  
 +
For more information and examples, see: [[Help_File:Custom type examples|Custom type examples]]
  
; 4 bytes (32-bits / DWORD)
+
----
: a "4 byte" value can hold a number between 0..4294967295 or -2147483648 and 2147483647 (The last one if it is a signed value)
 
: "4 byte" values are the standard way of storing information in a windows system. So doing a 4-byte scan will normally give the best results.
 
  
 
+
== Tips ==
; 8 bytes (64-bits / QWORD)
+
* Use binary and AoB scans for non-standard or unknown data layouts.
: a "8 byte" value can hold a number between 9223372036854775808 and 9223372036854775807 (no need for unsigned values anymore)
+
* Use the smallest scan type possible for faster results, but try larger types if you can't find your value.
: "8 bytes" aren't used often because they take up a lot of space, and require extra processing. (except for 64-bit processors)
+
* For text, remember to select the correct encoding (UTF-8 or UTF-16).
 
+
* Custom types are powerful for games with encrypted or non-standard value representations.
Some programs do use them though, and scanning for a "8-byte" value doesn't return many addresses, so finding the right one is easy then.
 
 
 
If the address you're looking for is smaller than 8 bytes, the chance that the scan has skipped that address is big.
 
 
 
 
 
; Float/Single (32-bits) (IEEE standard)
 
: a "Single" value can hold a number between 1.5 x 10^-45 and 3.4 x 10^38                            .
 
 
 
This is one of the 2 standard floating-point value allocations. (IEEE) The other one is DOUBLE
 
A Single consists of 4 bytes, which is build up in a special way, which is VERY different from normal variables! (so normal byte scanning wont work)
 
 
 
Cheat Engine rounds values up/down till the number of digits you specify in the scan value box.
 
e.g.:if you scan for 12 it will find all values between 11.5 and 12.4 and 12.0 results in values between 11.95 and 12.04
 
 
 
 
 
; Double (64-bits) (IEEE standard)
 
: Basically the same as Single, except the data-length is longer (more precise) but the range is between 5.0 x 10^-324 and 1.7 x 10^308 
 
 
 
 
 
; Text
 
: The "Text" scan value can be used to scan the memory of a game for text. E.g: if you know that 12 bytes after your name as a variable you need you can use that to recalculate the addresses each time a game restarts.
 
: Text scans are in UTF-8 or UTF-16
 
 
 
 
 
; Array of byte
 
: Same as text, but uses a array of byte instead of characters, and supports wildcards.
 
input:
 
  xx xx xx xx ...
 
  xx ?? xx xx
 
  xx ** xx xx
 
 
 
An array of byte (AoB) scan can be useful when you know that prior to the address you need is always a specific occurrence of bytes. (like: 66 66 66 10 10, and 4 bytes after that is your health which is stored as 1 byte. Scanning for 1 byte will take a lot longer than scanning for this string of bytes. Scanning for this string will probably only result 1 address, where as scanning for 1 byte will return thousands of addresses the first time)
 
 
 
 
 
; All
 
: A combination of byte, 2 bytes, 4 bytes, 8 bytes, single and double data-types (basically the numeric ones).
 
 
 
 
 
; Custom
 
: Lets you assign an lua or auto assembler script where you can fill in how certain bytes should be interpreted as a decimal value and the other way arround.
 
 
 
To create a custom scan script, right-click on the value type box and select the option from the menu.
 
 
 
To delete or edit a custom scanscript, select it and press right-click. Then choose Edit or Delete from the menu.  
 
 
 
[[Help_File:Custom type examples|Custom type examples]]
 
 
 
  
 
== Links ==
 
== Links ==

Latest revision as of 20:48, 11 July 2025

Cheat Engine supports a variety of scan types for searching memory values in running processes. Each scan type is designed for specific data representations and use cases. Below is an overview of the available scan types and their typical applications.

Binary[edit]

The binary scan is a powerful but slower scan type that allows you to search for specific sequences of bits in memory. You can use wildcards (? or *) to match any bit, making it possible to search for patterns like 1101?001, which matches both 11010001 and 11011001. This is useful for finding values stored in non-standard bit arrangements or when only part of the bit pattern is known.

Byte (8-bits)[edit]

A byte can hold a value between 0 and 255 (unsigned) or -128 to 127 (signed). 1-byte values are common in 8-bit emulators and older software. Scanning for 1-byte values can yield many results, but increases the chance of finding the correct address when the value size is unknown.

2 Bytes (16-bits / WORD)[edit]

A 2-byte (WORD) value can hold numbers between 0 and 65535 (unsigned) or -32768 to 32767 (signed). These are often used in older DOS games and 16-bit applications.

4 Bytes (32-bits / DWORD)[edit]

A 4-byte (DWORD) value can hold numbers between 0 and 4,294,967,295 (unsigned) or -2,147,483,648 to 2,147,483,647 (signed). This is the standard integer size for most Windows applications and is usually the best default scan type.

8 Bytes (64-bits / QWORD)[edit]

An 8-byte (QWORD) value can hold very large numbers, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. These are less common, but are used in 64-bit applications and for storing large values.

Float/Single (32-bits, IEEE Standard)[edit]

A single-precision floating point value (float) can represent numbers between approximately 1.5 × 10^-45 and 3.4 × 10^38. Floats are stored in a special format (IEEE 754) and are commonly used for decimal values in games. Cheat Engine rounds float values for scanning, so searching for 12 will find values between 11.5 and 12.4.

Double (64-bits, IEEE Standard)[edit]

A double-precision floating point value (double) can represent numbers between approximately 5.0 × 10^-324 and 1.7 × 10^308. Doubles are more precise than floats and are used when higher accuracy is needed.

Text[edit]

The text scan type allows you to search for strings in memory. Text can be stored as UTF-8 or UTF-16 (widechar). This is useful for finding variables that are stored as readable text.

Array of Byte (AoB)[edit]

An array of byte scan lets you search for a specific sequence of bytes, with support for wildcards (?? or **). This is especially useful when you know a unique pattern of bytes near the value you want to find. Example patterns:

xx xx xx xx ...
xx ?? xx xx
xx ** xx xx

All[edit]

The "All" scan type combines byte, 2 bytes, 4 bytes, 8 bytes, single, and double types. It is useful when you are unsure of the value's data type, but may return many results.

Custom[edit]

Custom scan types allow you to define how bytes should be interpreted using Lua or Auto Assembler scripts. You can create, edit, or delete custom types by right-clicking the value type box in Cheat Engine.

For more information and examples, see: Custom type examples


Tips[edit]

  • Use binary and AoB scans for non-standard or unknown data layouts.
  • Use the smallest scan type possible for faster results, but try larger types if you can't find your value.
  • For text, remember to select the correct encoding (UTF-8 or UTF-16).
  • Custom types are powerful for games with encrypted or non-standard value representations.

Links[edit]