Zum Inhalt springen
Anleitungen Englisch

Cheat Engine Werttypen erklärt: Bytes, Floats, Strings und AOB

Cheat-Engine.net Von Cheat-Engine.net 9 Min. Lesezeit 34 Aufrufe

Byte, 2/4/8 Bytes, Float, Double, String und Array of byte: was jeder Typ speichert, Signed vs. Unsigned, Little-Endian-Byte-Reihenfolge und wie du einen Typ auswählst, wenn du ihn nicht kennst.

Every scan in Cheat Engine asks two questions: what value are you looking for, and how is it stored? The second question is the Value Type dropdown, and choosing the wrong type is the most common reason a scan finds nothing. This guide explains each type, how numbers are laid out in memory, and how to pick a type when you have no idea what the game uses.

The examples assume you already know how to run a First Scan and Next Scan. If not, start with the Cheat Engine tutorial for beginners. As always, use these techniques in single-player and offline games only, and back up your saves before changing anything.

Why the type matters

Memory is just a long row of bytes. The number 1000 is not stored as the characters "1", "0", "0", "0"; it is stored as a binary pattern, and the same pattern means something different depending on how you read it. Four bytes that mean 1000 as a whole number mean an unreadably tiny number as a float. When you tell Cheat Engine the type, you tell it how many bytes to read at each address and how to interpret them. If the type is wrong, the value you typed never matches.

The types at a glance

TypeSizeRangeTypical use in games
Byte1 byte0 to 255 (signed: -128 to 127)Flags, small counters, levels, item quantities capped at 99
2 Bytes2 bytes0 to 65,535 (signed: -32,768 to 32,767)Older games, stat points, inventory stacks
4 Bytes4 bytes0 to 4,294,967,295 (signed: about plus or minus 2.1 billion)Money, ammo, experience, most whole numbers
8 Bytes8 bytes0 to about 1.8 x 10^19 (signed: about plus or minus 9.2 x 10^18)Very large currencies, timestamps, pointers in 64-bit games
Float4 bytesAbout 7 significant digitsHealth, stamina, positions, speed, timers
Double8 bytesAbout 15 to 16 significant digitsEngines and scripting runtimes that use double precision
StringVariableText, ASCII or UTF-16Character names, item names, dialogue
Array of byteVariableAny byte sequence, wildcards allowedCode signatures, raw structures

Whole number types: Byte, 2 Bytes, 4 Bytes, 8 Bytes

These are integers: no decimal point, just a count. The name tells you how many bytes each one uses. 4 Bytes is Cheat Engine's default because it is by far the most common type for counts in modern games. A number that can exceed about 4.29 billion, such as a late-game currency in an incremental game, needs 8 Bytes. Values that never go above 255 are sometimes packed into a single Byte to save space, particularly in older games and for on/off flags.

Signed and unsigned

The same bits can be read as signed (allowing negative numbers) or unsigned (zero and up). In 4 Bytes, the pattern FF FF FF FF is -1 when signed and 4,294,967,295 when unsigned. The scan itself compares the bit pattern, so this mostly matters for how values are displayed. You can switch an entry between signed and unsigned display from its right-click menu in the address list. If a value suddenly shows as a huge number after you lower it below zero, you are looking at a signed value displayed as unsigned, or the game has underflowed.

Byte order: little-endian with a worked example

Windows PCs use little-endian byte order: the least significant byte is stored first. This matters as soon as you look at memory in the hex view of the Memory Viewer, or write an Array of byte pattern by hand.

Take the number 1000 stored as 4 Bytes:

  1. 1000 in hexadecimal is 3E8.
  2. Padded to four bytes, that is 00 00 03 E8, written most significant byte first, the way people normally write numbers.
  3. Little-endian reverses the byte order, so in memory you see E8 03 00 00.

The same number as 2 Bytes is E8 03, and as 8 Bytes it is E8 03 00 00 00 00 00 00. Only the bytes are reversed, never the hex digits inside a byte: E8 stays E8.

Floats follow the same rule. The float 100.0 has the bit pattern 42C80000, which sits in memory as 00 00 C8 42. The float 1.0 is 3F800000, stored as 00 00 80 3F. Working these out by hand gets tedious; the value converter shows any number as decimal, hex and little-endian bytes for each type side by side.

Floating point: Float and Double

Floats store numbers with a fractional part. Games use them for anything that changes smoothly or needs decimals: health that regenerates at 0.3 per tick, a character's X, Y and Z position, movement speed, a cooldown in seconds. A health bar with no number on it is very often a float, either holding the actual health (say 87.5) or a fraction from 0.0 to 1.0.

Double is the same idea with 8 bytes and much higher precision. Fewer games use it for gameplay values, but some engines and scripting runtimes store all numbers as doubles. If a Float scan for a value with decimals fails, try Double next.

Because floats are rarely exact, Cheat Engine does not demand a perfect match. When you choose Float or Double, the scan panel offers rounding options; the default rounded mode lets a search for 87 match 87.4 and similar values. When even that is unreliable, use the Value between scan type with a small range, or switch to Unknown initial value and use Increased and Decreased scans.

Text: String in ASCII and UTF-16

A String scan searches for text. Games store text in different encodings, and Cheat Engine lets you choose:

  • ASCII or single-byte text: one byte per character. "Hi" is 48 69.
  • UTF-16: two bytes per character, common in Windows programs and engines. "Hi" is 48 00 69 00. Tick the UTF-16 option when you scan.

There is also a case-sensitivity option. Searching for a character name is a quick way to find the data structure that belongs to that character, because stats are often stored nearby. Be careful when changing strings: writing text longer than the original overwrites whatever comes after it in memory.

Array of byte (AOB)

Array of byte searches for an exact sequence of bytes, written in hex and separated by spaces, such as E8 03 00 00. You can use ?? as a wildcard for any byte, so 89 83 ?? ?? 00 00 matches several variations. AOBs are rarely used to find gameplay values directly. Their main job is finding a specific piece of game code again after a restart, which is how Auto Assembler scripts locate the code they patch.

The "All" type

When you choose All, Cheat Engine scans for your value across several numeric types at once, and the results show which type each match was found as. Which types are included can be adjusted in Cheat Engine's settings. All is useful when you are stuck, but it produces many more results and runs slower, so treat it as a fallback rather than a habit.

How to pick a type when you don't know it

Work through these in order, starting a New Scan each time a type fails:

  1. A whole number shown on screen (gold, ammo, a score): start with 4 Bytes and Exact Value.
  2. Anything with decimals, a bar, or a position: try Float. Use Unknown initial value if no number is visible.
  3. Float found nothing: try Double.
  4. A small number that never goes above 255 or 65,535: try Byte or 2 Bytes.
  5. A very large number: try 8 Bytes.
  6. Still nothing: try All, then reconsider whether the displayed number is the stored one. Games sometimes store a value multiplied by 10 or 100, store the maximum and the amount used instead of the amount left, or keep it encoded. In those cases Unknown initial value with Increased and Decreased scans is the reliable route.

When you find a candidate, confirm it by changing it in the address list and watching the game, then note the type in the entry's description so you remember it later.

Custom and less common types

Cheat Engine also has a Binary type for individual bits, and supports custom types defined with a small script. Recent versions include some custom types out of the box, such as big-endian variants for the rare cases where a game stores numbers in the opposite byte order. You will not need these often, but it helps to know they exist when the standard types fail on an unusual game.

Summary

  • 4 Bytes for whole numbers, Float for decimals and bars, Double as the next guess, Byte and 2 Bytes for small values, 8 Bytes for very large ones.
  • Signed and unsigned are two readings of the same bits.
  • Memory is little-endian: 1000 as 4 Bytes is E8 03 00 00.
  • Strings come in ASCII and UTF-16; AOB patterns search for raw bytes with ?? wildcards.
  • Use the value converter to check byte layouts instead of calculating them by hand.

Kommentare

0
Antwort an

Wird nie öffentlich angezeigt.

Kommentare werden von einem Moderator geprüft, bevor sie erscheinen.

Noch keine Kommentare

Sei der Erste, der seine Meinung teilt.