This page still needs significant improvements.
Please help by expanding or correcting this article where possible.
Cheat Engine exposes an extensive Lua API for cheat tables, trainers, and standalone scripts. This page is a task-oriented index: choose the area you are working in, then follow a function link for its detailed reference.
Contents
1 Variables
2 Functions
2.1 Quick navigation
2.2 Function naming guide
2.3 Cheat Table
2.4 Trainers
2.5 Protection
2.6 Scanning
2.7 Process
2.8 Threads
2.9 Handles
2.10 Addresses
2.11 Memory
2.12 Conversions
2.13 Input Devices
2.14 Screen
2.15 Sounds
2.16 Text-to-Speech
2.17 Fonts
2.18 Forms and Windows
2.19 Cheat Engine
2.20 Lua
2.21 Types
2.22 Object-oriented
2.23 Assembly
2.24 Auto Assembler
2.25 Debugger
2.26 DBK (Driver-Based Kernel)
2.27 DBVM
2.28 Translation
2.29 Files
2.30 Structures
2.31 Miscellaneous
2.32 Extended API reference (CE 7.5)
2.32.1 Core runtime, memory, and conversion helpers
2.32.2 Files, symbol loading, and native compilation
2.32.3 Auto Assembler authoring and callbacks
2.32.4 Process control, code execution, and prompts
2.32.5 Target inspection, allocation, and task progress
2.32.6 Registered symbols
2.32.7 Debugging extensions
2.32.8 Forms, controls, graphics, dialogs, and streams
2.32.9 Threads, synchronization, and structures
2.32.10 Low-level memory: DBK and DBVM
2.32.11 Direct3D, disassembly, and pipes
2.32.12 SQL and data access
2.32.13 Modules, .NET, and diagrams
2.32.14 Remote execution, XML, and virtual trees
2.32.15 CEServer and Lua string extensions
3 Classes
Variables
Globals
Name
Type
Description
TrainerOrigin
string
Path of the trainer that launched Cheat Engine. Only set when Cheat Engine was launched as a trainer.
process
string
Main module name of the currently opened process (e.g. mygame.exe or module name).
MainForm
object
The main Cheat Engine GUI form object.
AddressList
object
The address list object of the main Cheat Engine GUI (cheat table address list).
CPU / Debug Variables (Registers)
Register / Variable
Architecture
Description
EFLAGS
32/64-bit
CPU flags register value available in the debug context.
EAX, EBX, ECX, EDX, EDI, ESI, EBP, ESP, EIP
32/64-bit
Standard 32-bit register values (present when debugging 32-bit contexts or in compatible views).
RAX, RBX, RCX, RDX, RDI, RSI, RBP, RSP, RIP, R8, R9, R10, R11, R12, R13, R14, R15
64-bit only
64-bit register values available in 64-bit debug contexts.
Functions
Function names follow consistent patterns: create... creates an object or window, get... retrieves data, set... changes a setting, read.../write... transfer data, and register.../unregister... manage callbacks. Related functions are kept together where possible.
Quick navigation
What do you want to do?
Recommended sections
Manage a table or build a trainer
Cheat Table , Trainers , Protection
Find, read, write, or convert memory
Scanning , Memory , Conversions , Addresses
Work with a process, threads, windows, or handles
Process , Threads , Handles , Input Devices
Automate Cheat Engine or generate code
Lua , Assembly , Auto Assembler , Cheat Engine
Build forms, controls, or visual tools
Forms and Windows , Screen , Sounds , Classes
Debug, use the driver, or access DBVM
Debugger , DBK , DBVM
Find less common CE 7.5 APIs
Extended API reference — pipes, SQL, .NET, XML, CEServer, and additional factories
Function naming guide
Prefix / pattern
Meaning
create...
Creates an object, control, stream, worker, or other resource. Check the returned class before using it.
get..., enum...
Retrieves one value/object or enumerates a collection, usually without changing state.
set..., enable...
Changes a setting, protection, or runtime state.
read..., write...
Transfers data. Unless the name ends in Local, memory functions normally operate on the opened target process.
register..., unregister...
Adds or removes a callback, handler, hook, or extension. Keep the returned ID when an unregister function requires it.
Cheat Table
These functions help manage the cheat table and its files.
Trainers
Functions related to the trainer (.exe) generator.
Protection
Functions for protecting Cheat Engine or encoding code.
Function
Description
activateProtection
Prevents basic memory scanners from opening or inspecting the Cheat Engine process.
enableDRM
Enables kernel-mode protections or DRM measures to prevent normal memory scanners from reading the Cheat Engine process.
encodeFunction
Encodes a given Lua function to a string that can be stored/transferred; can be decoded later with decodeFunction .
decodeFunction
Decodes an encoded function string back into a callable Lua function.
Scanning
Functions that control and query memory scans.
Function
Description
AOBScan
Scans the currently opened process for an array-of-bytes (AOB) pattern and returns a StringList of all matches.
AOBScanModuleUnique
Scans the process memory for a byte pattern and returns the address if exactly one unique match is found; returns nil otherwise.
AOBScanUnique
Scans the entire process for a pattern and returns the address if exactly one unique match exists; returns nil otherwise.
getCurrentMemscan
Returns the currently active scan session as a MemScan object.
Process
Functions for creating/opening processes and querying system/process state.
Function
Description
createProcess
Creates (and optionally debugs) a new process.
openProcess
Opens a process given a process name or PID; attaches Cheat Engine to it for memory access.
onOpenProcess
Callback invoked by Cheat Engine when it opens a process (user-defined handler).
getForegroundProcess
Returns the process ID (PID) of the currently foreground (top) window process.
getOpenedProcessID
Returns the PID of the currently opened/attached process.
getProcessIDFromProcessName
Returns the PID for a given process name (if running).
openFileAsProcess
Opens a file and treats it like a process (gives memory access similar to opening a process).
saveOpenedFile
Saves changes made to the opened file.
setPointerSize
Sets the pointer size (in bytes) Cheat Engine will use (e.g. 4 or 8); useful if a 64-bit process requires 32-bit pointer handling.
setAssemblerMode
Sets assembler bit mode: 0 = 32-bit, 1 = 64-bit.
getProcesslist
Returns a system process list object.
getWindowlist
Returns a list of top-level windows.
pause
Pauses the currently opened process.
unpause
Resumes the currently opened process.
targetIs64Bit
Returns true if the target process is 64-bit, otherwise false.
enumModules
Returns a table with information about each module in the current process (or a specified PID).
enumMemoryRegions
Returns a table containing the memory layout with information about each memory region.
closeRemoteHandle
Closes a remote handle to a process.
Threads
Function
Description
getCPUCount
Returns the number of CPU cores available on the system.
getThreadlist
Fills a List object with the thread list of the currently opened process (returns thread IDs and basic info).
inMainThread
Returns true if the current Lua code is running in the main thread (available in CE 6.4+); otherwise false.
synchronize
Executes the provided function in the main thread and returns that function's return value. Useful for GUI updates or operations that must run on the main thread.
queue
Schedules the provided function to run in the main thread but does not wait for the result (fire-and-forget).
checkSynchronize
Intended to be called from the main thread's loop to process pending synchronized calls when using threads and synchronize/queue.
Handles
Function
Description
getHandleList
Returns a table (or list object) containing system handles (open handles) for the system or the current process, depending on context.
Addresses
These functions help convert between memory addresses and symbol/CE address string representations.
Function
Description
getAddress
Returns the numeric address of a symbol (module+export, label, or CE symbol). Raises an error if the symbol cannot be resolved.
getAddressSafe
Same as getAddress but returns nil if the symbol cannot be found (does not throw).
getNameFromAddress
Returns the address formatted as a string, preferring symbol/module+offset notation when available.
registerSymbol
Assigns the specified symbol name to an address (adds a user-defined symbol).
unregisterSymbol
Removes a previously registered symbol mapping for an address.
getSymbolInfo
Returns a table/object with symbol information (module name, search key, address, size), matching the SymbolList structure.
reinitializeSymbolhandler
Reinitializes the symbol handler (useful after loading new modules).
inModule
Returns true if the specified address lies inside a loaded module.
inSystemModule
Returns true if the address is inside a system module (OS module), e.g., kernel or system DLLs.
getModuleSize
Returns the size (in bytes) of the specified module. Use getAddress to retrieve the module base address first if needed.
errorOnLookupFailure
Sets whether address/symbol lookups will throw errors on failure or return 0/nil depending on configuration.
registerSymbolLookupCallback
Registers a callback function invoked when a symbol is parsed/loaded.
unregisterSymbolLookupCallback
Unregisters a previously registered symbol lookup callback.
registerAddressLookupCallback
Registers a callback called when an address-to-name conversion is requested.
unregisterAddressLookupCallback
Unregisters the address lookup callback.
reinitializeDotNetSymbolhandler
Reinitializes only the .NET portion of the symbol handler (useful when .NET modules change).
Memory
Function
Description
allocateMemory
Allocates executable/non-executable memory in the target process and returns the allocated address.
deAlloc
Frees memory previously allocated in the target process.
allocateSharedMemory
Creates or opens a named shared memory object of the given size for interprocess communication.
createSection
Creates a memory section object (OS-specific) for sharing or mapping memory.
mapViewOfSection
Maps a created section into the process address space, returning the mapped base address.
unMapViewOfSection
Unmaps a previously mapped section view from the process address space.
copyMemory
Copies memory from a source address to a destination address (can be used within target process or between processes depending on API).
compareMemory
Compares two memory regions (can be used within target process or between processes depending on API).
allocateKernelMemory
Allocates a block of nonpaged kernel memory (requires driver or appropriate privileges) and returns its address.
freeKernelMemory
Frees kernel-mode memory previously allocated.
mapMemory
Maps memory from one process context into another usermode context (maps a specified address from PID A into PID B's address space).
unmapMemory
Unmaps memory previously mapped with mapMemory.
createMemoryStream
Creates a memory stream object that can be used to read/write memory data conveniently from Lua.
Reading from Target Process
Function
Description
readBytes
Reads raw bytes at the given address. If ReturnAsTable is true, returns a table; otherwise returns multiple byte values.
readSmallInteger
Reads a 16-bit (word) integer from the specified address. Optional second parameter: if true, reads as signed integer.
readInteger
Reads a 32-bit (dword) integer from the specified address. Optional second parameter: if true, reads as signed integer.
readQword
Reads a 64-bit (qword) integer from the specified address.
readPointer
Reads a pointer-sized value: readQword on 64-bit targets, readInteger on 32-bit targets.
readFloat
Reads a single-precision (32-bit) floating-point value from the specified address.
readDouble
Reads a double-precision (64-bit) floating-point value from the specified address.
readString
Reads a null-terminated string from memory up to maxlength bytes (prevents infinite loops on corrupted memory).
readRegionFromFile
Reads a region from a file and writes it to a specific address in the target process.
Reading from Cheat Engine Memory
Function
Description
readBytesLocal
Same as readBytes, but reads from Cheat Engine's own memory.
readSmallIntegerLocal
Reads a 16-bit integer from CE's memory. Optional: use signed if second parameter is true.
readIntegerLocal
Reads a 32-bit integer from CE's memory. Optional: use signed if second parameter is true.
readQwordLocal
Reads a 64-bit integer from CE's memory.
readPointerLocal
Reads a pointer-sized value from CE's memory (64-bit or 32-bit depending on CE build).
readFloatLocal
Reads a single-precision float from CE's memory.
readDoubleLocal
Reads a double-precision float from CE's memory.
readStringLocal
Reads a null-terminated string from CE's memory.
Writing to Target Process
Function
Description
writeBytes
Writes the given bytes (from a table) to the specified address in the target process.
writeSmallInteger
Writes a 16-bit integer to the specified address. Returns true on success.
writeInteger
Writes a 32-bit integer to the specified address. Returns true on success.
writeQword
Writes a 64-bit integer to the specified address. Returns true on success.
writeFloat
Writes a single-precision float to the specified address. Returns true on success.
writeDouble
Writes a double-precision float to the specified address. Returns true on success.
writeString
Writes a string to the specified address (typically null-terminated). Returns true on success.
writeRegionToFile
Writes a memory region to a file. Returns the number of bytes written.
Writing to Cheat Engine Memory
Function
Description
writeSmallIntegerLocal
Writes a 16-bit integer to CE's memory. Returns true on success.
writeIntegerLocal
Writes a 32-bit integer to CE's memory. Returns true on success.
writeQwordLocal
Writes a 64-bit integer to CE's memory. Returns true on success.
writeFloatLocal
Writes a single-precision float to CE's memory. Returns true on success.
writeDoubleLocal
Writes a double-precision float to CE's memory. Returns true on success.
writeStringLocal
Writes a string to CE's memory. Returns true on success.
writeBytesLocal
Writes the given bytes (from a table) to CE's memory.
Conversions
Encoding/Decoding
Function
Description
ansiToUtf8
Converts a string from ANSI encoding to UTF-8 encoding.
utf8ToAnsi
Converts a string from UTF-8 encoding to ANSI encoding.
stringToMD5String
Computes and returns the MD5 hash of a string as a hexadecimal string.
integerToUserData
Converts a given integer to a userdata variable.
userDataToInteger
Converts a given userdata variable back to an integer.
To Byte Table
Convert data types into byte tables (tables of individual byte values).
From Byte Table
Convert byte tables back into data types.
Binary Operations
Bitwise operations on integers.
Function
Description
bOr
Bitwise OR operation.
bXor
Bitwise XOR (exclusive OR) operation.
bAnd
Bitwise AND operation.
bShl
Bitwise shift left operation.
bShr
Bitwise shift right operation.
bNot
Bitwise NOT (complement) operation.
Input Devices
Keyboard & Mouse
Function
Description
getMousePos
Returns the current mouse cursor position as X and Y coordinates.
setMousePos
Sets the mouse cursor position to the specified X and Y coordinates.
isKeyPressed
Returns true if the specified key is currently held down.
keyDown
Simulates pressing a key (puts the key into down state).
keyUp
Simulates releasing a key (puts the key into up state).
doKeyPress
Simulates a complete key press (down and up).
mouse_event
Calls the Windows API mouse_event directly for advanced mouse control. See MSDN documentation .
setGlobalKeyPollInterval
Sets the global key poll interval (frequency of keyboard state updates).
setGlobalDelayBetweenHotkeyActivation
Sets the minimum delay (in milliseconds) between consecutive activations of the same hotkey.
Game Controller
XBox/game controller input.
Clipboard
Function
Description
writeToClipboard
Writes the given text to the system clipboard.
Screen
Function
Description
getScreenHeight
Returns the height of the screen in pixels.
getScreenWidth
Returns the width of the screen in pixels.
getScreenDPI
Returns the screen DPI (dots per inch) for determining screen scaling/density.
getWorkAreaHeight
Returns the height of the usable work area (excludes taskbars).
getWorkAreaWidth
Returns the width of the usable work area (excludes taskbars).
getScreenCanvas
Returns a Canvas object for drawing directly to the screen. Limited usefulness in practice due to performance constraints.
getPixel
Returns the RGB color value of a pixel at the specified screen coordinates.
Sounds
General Audio
Function
Description
playSound
Plays an audio file (supports various formats like .wav, .mp3, etc.).
beep
Plays a system beep/ping sound.
Text-to-Speech
Function
Description
speak
Speaks the given text using the system's text-to-speech engine and optional flags. See MSDN SpeakFlags .
speakEnglish
Speaks the given text using an English voice by wrapping it in an XML voice specification.
XM Player
Plays tracked music (XM format) using the built-in XM player.
Fonts
Function
Description
loadFontFromStream
Loads a font from a memory stream and returns a handle/ID for later use with unloadLoadedFont.
unloadLoadedFont
Unloads a previously loaded font by its handle/ID, freeing resources.
Forms and Windows
Function
Description
findWindow
Finds a window by class name and/or window title/caption.
getWindow
Gets a window handle based on a relative command (e.g. parent, child, next). See MSDN GetWindow .
getWindowCaption
Returns the caption/title text of the specified window.
getWindowClassName
Returns the class name of the specified window.
getWindowProcessID
Returns the process ID (PID) of the process that owns the specified window.
getForegroundWindow
Returns the handle of the topmost (foreground) window currently active.
sendMessage
Sends a Windows message to the specified window.
hookWndProc
Hooks a window's window procedure (WndProc) to intercept and handle messages.
unhookWndProc
Uninstalls a WndProc hook previously installed via hookWndProc.
Cheat Engine
Functions for managing and controlling Cheat Engine itself.
Version and Information
Function
Description
getCEVersion
Returns the Cheat Engine version as a floating-point number (e.g. 7.5).
getCheatEngineFileVersion
Returns full version information: a raw integer and a table containing major, minor, release, and build numbers.
cheatEngineIs64Bit
Returns true if Cheat Engine is running as 64-bit; false if 32-bit.
getCheatEngineProcessID
Returns the process ID of the Cheat Engine process itself.
getCheatEngineDir
Returns the folder path where Cheat Engine (or the current trainer) is located.
Management
Comments and Headers
Function
Description
getComment
Gets the user-defined comment attached to the specified address.
setComment
Sets a user-defined comment at the specified address.
getHeader
Gets the user-defined header text at the specified address.
setHeader
Sets a user-defined header text at the specified address.
Advertising and Support
Function
Description
supportCheatEngine
Displays an advertising/support window to help fund Cheat Engine development.
fuckCheatEngine
Hides/closes the advertising window if it was showing (crude but functional name).
Forms and UI
Function
Description
getFormCount
Returns the total number of forms currently attached to the main CE application.
getForm
Returns the form object at the specified index (0-based).
getMemoryViewForm
Returns the first MemoryView form object (the hex editor window).
getMainForm
Returns the main Cheat Engine window form object.
getSettingsForm
Returns the settings/options dialog form object.
getLuaEngine
Returns the Lua engine/console form object (creates it if needed).
unhideMainCEwindow
Shows the main Cheat Engine window (opposite of hideAllCEWindows).
hideAllCEWindows
Hides all normal Cheat Engine windows (e.g. the trainer table UI).
registerFormAddNotification
Registers a callback function invoked when a form is added to CE's form list.
unregisterFormAddNotification
Unregisters a previously registered form add notification callback.
Messages
Function
Description
showMessage
Shows a simple message box with the given text to the user.
messageDialog
Pops up a message dialog box (similar to showMessage, with more control over buttons/options).
outputDebugString
Outputs a message using the Windows OutputDebugString API (visible in debuggers).
processMessages
Processes pending window messages in the event queue, allowing button clicks and UI updates to be handled.
Input
Function
Description
inputQuery
Shows a dialog prompting the user to input a string. Returns the entered string, or nil if cancelled (CE 6.4+).
Shortcuts
Function
Description
shortCutToText
Converts a shortcut integer value to its textual representation (e.g. "Ctrl+Alt+A"). (CE 6.4+)
textToShortCut
Converts a text representation (e.g. "Ctrl+Alt+A") to a shortcut integer value. (CE 6.4+)
convertKeyComboToString
Converts a key combination to its string representation, matching the hotkey handler's format.
Speed Hack
Function
Description
speedhack_setSpeed
Enables the speed hack (if not already active) and sets the game/process speed multiplier (e.g. 2.0 for 2x speed).
speedhack_getSpeed
Returns the current speed hack multiplier value that was last set.
Lua
Functions for managing the Lua engine and state.
Function
Description
resetLuaState
Creates a fresh Lua state, resetting the environment and clearing all previously defined variables/functions.
sleep
Pauses execution for the specified number of milliseconds.
createRef
Creates and returns an integer reference handle that can store and retrieve Lua objects persistently.
getRef
Retrieves the Lua value/object referenced by the given reference handle.
destroyRef
Destroys and frees a reference handle, removing the reference and allowing garbage collection.
Types
Functions for registering and managing custom data types.
Function
Description
onAutoGuess
Registers a callback function invoked by Cheat Engine's auto-guess feature to predict and suggest variable types.
registerCustomTypeLua
Registers a custom data type defined using Lua functions for reading/writing/display logic.
registerCustomTypeAutoAssembler
Registers a custom data type defined using an Auto Assembler script.
Object-oriented
Functions for determining class inheritance and type relationships.
Function
Description
inheritsFromObject
Returns true if the given object is a valid Cheat Engine class instance (inherits from Object).
inheritsFromComponent
Returns true if the given object inherits from the Component class.
inheritsFromControl
Returns true if the given object inherits from the Control class (UI controls).
inheritsFromWinControl
Returns true if the given object inherits from the WinControl class (windowed controls).
Assembly
Functions for working with x86/x64 machine code and assembly instructions.
Function
Description
autoAssemble
Executes an Auto Assembler script (given as text) for code injection, patching, or other assembly operations.
autoAssembleCheck
Validates an Auto Assembler script for syntax errors. Returns true on success; false with error message on failure.
disassemble
Disassembles the instruction at the given address and returns a formatted string: "address - bytes - opcode extra".
splitDisassembledString
Parses a disassembled instruction string and returns 4 separate strings: address, bytes, opcode, and extra field.
getInstructionSize
Returns the size (in bytes) of the instruction at the given address.
getPreviousOpcode
Attempts to find and return the address of the previous instruction (heuristic guess).
registerAssembler
Registers a custom callback function for the single-line assembler to convert instruction mnemonics to bytes.
unregisterAssembler
Unregisters a previously registered custom assembler callback.
Auto Assembler
Commands & Hooks
Scripts & Templates
Debugger
Functions for managing the debugger. See Lua Debugging for detailed information.
Status and Information
Breakpoint Management
Callbacks
Function
Description
debugger_onBreakpoint
User-defined callback invoked by CE when a breakpoint is hit (define your own implementation).
debugger_onModuleLoad
User-defined callback invoked by the Windows debugger when a module is loaded.
Register and Context Management
Function
Description
debug_getContext
Force-updates the Lua variables representing CPU registers from the current thread context. (CE 6.5+)
debug_setContext
Force-updates the CPU registers from the Lua variables representing them. (CE 6.5+)
debug_updateGUI
Refreshes the UI to reflect the current debug context if the debugger is broken.
debug_getXMMPointer
Returns the memory address of the specified XMM register for the currently broken thread.
Advanced Debugging
DBK (Driver-Based Kernel)
Functions for kernel-mode operations via the DBK driver.
Initialization and Setup
Process and Thread Information
Function
Description
dbk_getPEProcess
Returns the kernel pointer to the EPROCESS structure of the selected process ID.
dbk_getPEThread
Returns the kernel pointer to the ETHREAD structure of a given thread ID.
CPU Register Access
Function
Description
dbk_readMSR
Reads a Model-Specific Register (MSR) using the DBK driver.
dbk_writeMSR
Writes a Model-Specific Register (MSR) using the DBK driver.
dbk_getCR0
Returns the value of Control Register 0 (CR0).
dbk_getCR3
Returns the value of Control Register 3 (CR3) for the currently opened process.
dbk_getCR4
Returns the value of Control Register 4 (CR4).
Memory and Execution
DBVM
Functions for hypervisor-based operations and advanced memory monitoring via DBVM.
Initialization
Function
Description
dbvm_initialize
Initializes the DBVM hypervisor functions for use.
Memory Operations
MSR and Control Register Access
Function
Description
dbvm_readMSR
Reads a Model-Specific Register (MSR) using DBVM (bypasses driver).
dbvm_writeMSR
Writes a Model-Specific Register (MSR) using DBVM (bypasses driver).
dbvm_getCR4
Returns the real (unhooked) value of Control Register 4 (CR4).
Memory Monitoring
Memory Cloaking
Breakpoints and Debugging
Function
Description
dbvm_changeregonbp
Cloaks a page, sets a breakpoint at the given address, and modifies registers when the breakpoint is hit.
dbvm_removechangeregonbp
Removes a "change registers on breakpoint" breakpoint.
CR3 (Process Context) Logging
Performance and Anti-Detection
Function
Description
dbvm_speedhack_setSpeed
Sets system-wide speed hack via DBVM (affects all processes).
dbvm_setTSCAdjust
Configures TSC (Time Stamp Counter) adjustment to bypass VM detection (RDTSC hooks).
Translation
Function
Description
getTranslationFolder
Returns the path to the current translation files. Returns an empty string if no translation is active.
loadPOFile
Loads a ".PO" translation file into Cheat Engine's translation system.
translate
Returns the translated text for a given source string. If no translation is found, returns the original string.
translateID
Returns the translation for a specific string ID (lookup by numerical or symbolic ID).
Files
Function
Description
getFileVersion
Returns a 64-bit file version and a table splitting the version into major, minor, release, and build.
getFileList
Returns an indexed table (array) of filenames in the specified directory.
getDirectoryList
Returns an indexed table (array) of subdirectory names in the specified directory.
Structures
Miscellaneous
Function
Description
injectDll
Injects a DLL into the currently opened process.
shellExecute
Executes a given command or opens a file/URL using the system shell.
executeCode
Executes a stdcall function at a given address in the target process with one parameter and waits for it to return.
executeCodeEx
Extended version of executeCode (supports more parameters/options).
executeCodeLocal
Executes a stdcall function at a given address in Cheat Engine's own process (local execution).
executeCodeLocalEx
Extended version of executeCodeLocal with additional options.
onAPIPointerChange
Registers a callback invoked when an API pointer is changed (allows reacting to API remapping).
setAPIPointer
Sets the pointer/address used for a specified API function.
md5memory
Computes and returns the MD5 checksum (hex string) of the bytes at the provided memory address/size.
md5file
Computes and returns the MD5 checksum (hex string) of a file's contents.
getSystemMetrics
Retrieves the specified system metric or configuration setting. See: MSDN documentation .
getTickCount
Returns the tick count in milliseconds since the system started.
getUserRegistryEnvironmentVariable
Reads an environment variable stored in the current user's registry environment.
setUserRegistryEnvironmentVariable
Writes an environment variable to the current user's registry environment.
broadcastEnvironmentUpdate
Broadcasts a notification that environment variables were changed (call after setting registry variables).
getApplication
Returns the application object (main application/titlebar context).
getInternet
Returns an Internet client class object. The provided string specifies the client name/type.
signTable
Signs a .CT-File given a valid and installed Cheat Engine Signature.
Extended API reference (CE 7.5)
This section covers additional global and factory APIs exposed by celua-75.lua. It is grouped by the task they support rather than by their implementation order. Class instance methods remain documented with their respective classes.
Core runtime, memory, and conversion helpers
Use these for runtime detection, memory-protection changes, byte/value conversion, and sharing simple values between Lua states.
Function
Description
getOperatingSystem
Returns 0 if CE is running in Windows, 1 for Mac
darkMode
Returns true if CE is running in windows Dark Mode. Has no effect on mac
setMemoryProtection
Sets the given protection on the address range. Note, some systems do not support X and W to be true at the same time
readByte
Alias for readShortInteger; reads an 8-bit integer from target-process memory.
readShortInteger
Reads an 8-bit integer from target-process memory.
writeByte
Alias for writeShortInteger; writes an 8-bit integer to target-process memory.
writeShortInteger
Writes an 8-bit integer to target-process memory.
writePointer
Writes a pointer-sized integer to target-process memory.
writePointerLocal
Writes a pointer-sized integer to Cheat Engine memory.
signExtend
Sign-extends a value using the specified most-significant bit.
extendedToByteTable
Converts an Extended value to a byte table.
byteTableToExtended
Converts a byte table to an Extended value (returned as a double).
getGlobalVariable
Returns the given variable from the main lua state. Only basic types are supported. (Handy for new lua state threads)
setGlobalVariable
Sets the global variable names string in the main lua state. Only basic types are supported
encodeFunctionEx
Encodes a Lua script, optionally using the specified Lua DLL.
Files, symbol loading, and native compilation
These APIs operate on paths, augment symbol information, or compile and assemble native and .NET code.
Function
Description
extractFileName
returns the filename of the path
extractFileExt
returns the file extension of the path
extractFileNameWithoutExt
Returns the filename of the path, without the extension
extractFilePath
removes the filename from the path
getTempFolder
Returns the path to the temp folder
fileExists
Returns true if a file exists at that path
deleteFile
Returns true if a file existed at that path, and now not anymore
enableWindowsSymbols
Will download the PDB files of Windows and load them (Takes a long time the first time)
enableKernelSymbols
Will check the option for kernelmode symbols in memory view (Gets only the exports unless enableWindowsSymbols() is used)
getRTTIClassName
Returns the classname of a given structure based on RTTI information (assuming it can be found, returns nil if not or unknown)
reinitializeSelfSymbolhandler
Reinitializes Cheat Engine's own symbol handler.
waitForSections
Waits till the sections have been enumerated
waitForExports
Waits till all DLL Exports are loaded
waitForDotNet
Waits till all .NET symbols are loaded (this includes DLL Exports)
waitForPDB
Waits till all PDB symbols are loaded (this includes DLL Exports, and .NET)
searchPDBWhileLoading
Will interrupt symbol enum to query the debughelp symbol handler about a specific symbol. This can take a while. Default is false
releaseDebugFiles
Stops the symbolloader from processing any debug files and releases what it had open
waitforsymbols
If set to true looking up a symbol will wait for the symbol to be loaded(default true)
assemble
Assembles one instruction and returns its bytes.
compile
Compiles C code and returns a table with the addresses of the symbols on success, or nil with a secondary result containing the errormessage
compileFiles
Compiles an indexed list of C source files.
compileTCCLib
Compiles the TCC library functions some C code may need to function internally
addCIncludePath
Adds an extra default include path for the compile() function
removeCIncludePath
Removes a specific path previously added with addCIncludePath
compileCS
Compiles c# code and returns the autogenerated filename. references is a list of c# assemblies this code may reference.
dotNetExecuteClassMethod
Calls a static .NET class method from Cheat Engine.
Auto Assembler authoring and callbacks
Use callback registrations to extend Auto Assembler parsing and structure dissection; keep any returned registration ID for cleanup.
Process control, code execution, and prompts
This group covers process handles, code invocation, clipboard access, GC control, and small user-facing dialogs.
Function
Description
showSelectionList
Shows a selection list and returns the selected index and text.
duplicateHandle
Duplicates the provided CE based handle into the target process (You still need tell the target about this handle, like an injected dll data block)
onTableLoad
If defined this function will be called twice when a table gets loaded. Once before the loading, and once after.
getOpenedProcessHandle
Returns the handle of the currently opened process
getOpenedFileSize
Returns the size of the currently opened target executable.
getPointerSize
Gets the current pointersize
cpuid
Returns CPUID register values for the supplied EAX and ECX inputs.
gc_setPassive
Enables or disables the passive Lua garbage collector.
gc_setActive
Configures the active Lua garbage collector.
invertColor
Returns the inverted color
runCommand
Executes the given command and returns the output of the command as a string and the exitcode as an integer (Should not open a console window) If pathtoexecutein is not provided the path...
readFromClipboard
Reads the text from the clipboard
injectLibrary
Alias for injectDLL; injects a DLL or dylib into the target process.
injectDotNetDLL
Injects a .NET assembly and invokes its specified method.
executeMethod
Executes a method.
Target inspection, allocation, and task progress
These helpers inspect the target architecture, allocate memory in Cheat Engine, disassemble bytes, or update Windows taskbar progress.
Function
Description
allocateSharedMemoryLocal
Allocates named shared memory in the Cheat Engine process.
targetIsX86
Returns true if the target process is x86 based
targetIsArm
Returns true if the target process is arm based
targetIsAndroid
Returns true if the target process is running on the Android OS
getAutorunPath
Returns the autorun path
disassembleBytes
Disassembles the given bytes and returns the result.
printf
Same as print(string.format(...))
setProgressState
Sets the state of the cheatengine task in the taskbar (windows only) values: tbpsNone, tbpsIndeterminate, tbpsNormal, tbpsError, tbpsPaused
setProgressValue
Sets the state of the cheatengine task progress status
Registered symbols
Use these only for symbols registered through Lua or Auto Assembler; they do not enumerate every symbol known to the symbol handler.
Function
Description
enumRegisteredSymbols
Returns a table with elements containing {symbolname, address, OPTIONAL {allocsize, processid, donotsave}}
deleteAllRegisteredSymbols
Deletes all symbols registered with registerSymbols, both in AA and Lua scripts (Does not remove registered symbolLists)
Debugging extensions
These functions add debugger state checks and per-thread breakpoint control beyond the main debugger section.
Function
Description
debug_isStepping
Returns true if the debugger was single stepping an instruction earlier
debug_breakThread
Breaks the thread with the specific threadID (Note: The thread may not break instantly and may have to be awakened first)
debug_setBreakpointForThread
sets a breakpoint of a specific size at the given address for the specified thread. if trigger is bptExecute then size is ignored.
Forms, controls, graphics, dialogs, and streams
All create... entries here return a CE class object. Assign an owner where the function accepts one so the object's lifetime is managed correctly.
Function
Description
createRegion
Created an empty region
createMenuItem
Creates a menu item that gets added to the owner menu
createMainMenu
Creates a MainMenu object.
createPopupMenu
Creates a PopupMenu object.
createImageList
creates an imagelist object
createStringlist
Creates a stringlist class object (for whatever reason, lua strings are probably easier to use)
createForm
creates a CEForm class object(window) and returns the pointer for it. Visible is default true but can be changed
createFormFromFile
Returns the generated CEform
createFormFromStream
Returns the generated CEform
createLuaEngine
Creates a new lua engine form object. If there is no main luaengine window, this will become it.
createAutoAssemblerForm
TFrmAutoInject - Spawns an autoassembler window with the optionally provided script
createPaintBox
Creates a Paintbox class object
createLabel
Creates a Label class object which belongs to the given owner. Owner can be any object inherited from WinControl
createSplitter
Creates a Splitter class object which belongs to the given owner. Owner can be any object inherited from WinControl
createPanel
Creates a Panel class object which belongs to the given owner. Owner can be any object inherited from WinControl
createImage
Creates an Image class object which belongs to the given owner. Owner can be any object inherited from WinControl
createEdit
Creates an Edit class object which belongs to the given owner. Owner can be any object inherited from WinControl
createMemo
Creates a Memo class object which belongs to the given owner. Owner can be any object inherited from WinControl
createSynEdit
Creates a synedit object. mode: 0=Lua highlighting, 1=Auto Assembler highlighting
createButton
Creates a Button class object which belongs to the given owner. Owner can be any object inherited from WinControl
createCheckBox
Creates a CheckBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
createToggleBox
Creates a ToggleBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
createGroupBox
Creates a GroupBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
createRadioGroup
Creates a RadioGroup class object which belongs to the given owner. Owner can be any object inherited from WinControl
createListBox
Creates a ListBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
createCalendar
Creates a Calendar class object which belongs to the given owner. Owner can be any object inherited from WinControl. Valid date is between "September 14, 1752" and "December 31, 9999"
createComboBox
Creates a ComboBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
createProgressBar
Creates a ProgressBar class object which belongs to the given owner. Owner can be any object inherited from WinControl
createTrackBar
Creates a TrackBar class object which belongs to the given owner. Owner can be any object inherited from WinControl
createListView
Creates a ListView class object which belongs to the given owner. Owner can be any object inherited from WinControl
createTreeView
Creates a TreeView object.
createTimer
Creates a Timer object.
createFont
Returns a font object (default initialized based on the main ce window)
createBitmap
Returns a Bitmap object
createPNG
Returns a PortableNetworkGraphic object
createJpeg
Returns a Jpeg object
createIcon
Returns an Icon object
createPicture
Returns a empty picture object
createHotkey
returns an initialized GenericHotkey class object. Maximum of 5 keys
createColorDialog
Creates a new colordialog
createColorBox
Creates a new colorbox
createFindDialog
Creates a find dialog object.
createOpenDialog
Creates an opendialog object
createSaveDialog
Creates a save dialog object.
createSelectDirectoryDialog
Creates a directory-selection dialog object.
createFileStream
Creates a file-backed stream with the requested mode.
createStringStream
Creates a stream backed by a string buffer.
createMemScan
Returns a new MemScan class object
createFoundList
Creates a FoundList for the provided MemScan object.
createMemoryView
Creates a new memoryview window. This window will not receive debug events. Use getMemoryViewForm() function to get the main memoryview window
Threads, synchronization, and structures
Use synchronization objects when worker threads share state. Structure helpers create or retrieve layout definitions used by the structure dissector.
Low-level memory: DBK and DBVM
Advanced / platform-specific. These APIs require the DBK driver and/or DBVM and can affect the whole system, not only the opened process.
Function
Description
dbk_usePhysicalMemoryAccess
Changes all memory access to physical memory
dbk_setSaferPhysicalMemoryScanning
When set to true CE's memory scanner will skip hardware device owned memory. Default state is true
dbk_readPhysicalMemory
Reads physical memory through the DBK driver and returns a byte table.
dbk_writePhysicalMemory
Writes physical memory through the DBK driver.
dbvm_setKeys
Sets the keys to operate DBVM. Key1 and Key3 are pointersize, key2 is 32-bit. Note that if key1 or key3 are 64-bit wide, 32-bit CE can not use DBVM.
dbvm_getMemory
Returns the total memory free for DBVM, and the total number of full pages as secondary result
dbvm_watch_executes
Creates a DBVM watch that records instruction execution.
dbvm_traceonbp
Sets a int3 breakpoint at the given address after cloaking that page and when hit does a trace.
dbvm_traceonbp_getstatus
Returns DBVM trace status, current entry count, and maximum count.
dbvm_traceonbp_stoptrace
Requests the active DBVM trace to stop.
dbvm_traceonbp_remove
Disables the current trace and removes all results
dbvm_traceonbp_retrievelog
Returns an array of traceentries. (Context of the system at the time of the event, like registers)
dbvm_bp_getBrokenThreadListSize
Returns the number of breakpoint slots currently available
dbvm_bp_getBrokenThreadEventShort
Returns summary information for a DBVM breakpoint event.
dbvm_bp_getBrokenThreadEventFull
Returns full register, FPU, and stack information for a DBVM breakpoint event.
dbvm_bp_setBrokenThreadEventFull
Sets the state of the frozen thread
dbvm_bp_resumeBrokenThread
Resumes the specific thread. continueMethod can be 0=run, 1=step into
dbvm_bp_getProcessAndThreadIDFromEvent
Returns the process and thread IDs for a DBVM breakpoint event.
getPhysicalAddressCR3
Looks up the physical address for the given virtual address in the given pagetable base. Returns nil if not paged
readProcessMemoryCR3
Reads the virtual memory of the given process's CR3 value. Returns a bytetable on success, nil if fail to read (paged out)
writeProcessMemoryCR3
Writes virtual memory using the supplied process CR3 value.
Direct3D, disassembly, and pipes
Use this group for overlays, custom disassembly output, named-pipe communication, and related analysis tools.
Function
Description
createD3DHook
Creates a Direct3D hook object.
createDisassembler
Creates a disassembler object that can be used to disassemble an instruction and at the same time get more data
getDefaultDisassembler
Returns the default disassembler object used by a lot of ce's disassembler routines (Only use this from the main thread)
getVisibleDisassembler
Returns the legacy shared visible-disassembler override object.
registerGlobalDisassembleOverride
Same as Disassembler.OnDisassembleOverride, but does it for all disassemblers, including newly created ones. Tip: Check the sender to see if you should use syntax highlighting codes or not
unregisterGlobalDisassembleOverride
Unregisters a global disassembler override callback.
getDissectCode
Creates or returns the current code DissectCode object
createRipRelativeScanner
Creates a RipRelativeScanner object.
connectToPipe
Returns a LuaPipeClient connected to the given pipename. Nil if the connection fails. Timeout is number of milliseconds before it disconnects on read/write operations. 0 or nil means never
createPipe
Creates a LuaPipeServer which can be connected to by a pipe client. InputSize and Outputsize define buffers how much data can be in the specific buffer before the writer halts.
openLuaServer
Starts a Lua server with the supplied name.
getUltimap2
Returns the Ultimap2 form, or nil when it is not open.
getCodeFilter
Returns the Code Filter form.
SQL and data access
These factory functions create database connections, transactions, and queries. Configure the appropriate connection before executing a query.
Modules, .NET, and diagrams
The .NET functions query data collected from the target; they require an active .NET data collector and may return empty data when the runtime is unavailable.
Remote execution, XML, and virtual trees
These APIs create reusable helpers for remote calls, XML documents, custom CE controls, and virtual trees.
CEServer and Lua string extensions
CEServer functions apply only after connecting to a server. The string functions are called as methods (for example text:startsWith('CE')).
Function
Description
isConnectedToCEServer
Returns whether Cheat Engine is connected to CEServer.
getCEServerPath
Returns the CEServer path on the target.
split
Splits a string at the specified separator.
endsWith
Returns whether a string ends with the specified text.
startsWith
Returns whether a string starts with the specified text.
Classes
A compact list of notable classes implemented by Cheat Engine.
SQL Classes
Class Helper Functions
Undefined Class Property Functions
Not all class properties are explicitly exposed; these helpers allow dynamic access to published properties and method/event bindings.
Function
Description
getPropertyList
Returns a StringList of published property names for the specified class.
setProperty
Sets the value of a published property on an object instance (not usable for method properties).
getProperty
Gets the value of a published property on an object instance (not usable for method properties).
setMethodProperty
Assigns a Lua function to a method/event property on an object.
getMethodProperty
Retrieves a callable wrapper to invoke the original method/property on the object.