Celua
Celua
note: addresses can be strings, they will get interpreted by ce's symbolhandler
resetLuaState(): This will create a new lua state that will be used. (Does not
destroy the old one, so memory leak)
createRef(...): integer - Returns an integer reference that you can use with
getRef. Useful for objects that can only store integers and need to reference
lua objects. (Component.Tag...)
getRef(integer): ... - Returns whatever the reference points out
destroyRef(integer) - Removes the reference
enumModules(processid OPTIONAL):
Returns a table containing information about each module in the current
process, or the specified processid
Each entry is a table with fields
Name : String containing the modulename
Address: Integer representing the address the module is loaded
Is64Bit: Boolean set to true if it's a 64-bit module
PathToFile: String to the location this module is loaded
md5memory(address, size): Returns a md5 sum calculated from the provided memory.
Página 3
celua
getFileList(Path:string, searchMask:string OPTIONAL, SearchSubDirs: boolean
OPTIONAL, DirAttrib: integer OPTIONAL): Returns an indexed table with filenames
getDirectoryList(Path:string, SearchSubDirs: boolean OPTIONAL): Returns an
indexed table with directory names
enableWindowsSymbols(): Will download the PDB files of Windows and load them
(Takes a long time the first time)
getAddress(string, local OPTIONAL): returns the address of a symbol. Can be a
modulename or an export. set Local to true if you wish to querry the symboltable
of the ce process
getAddressSafe(string, local OPTIONAL): returns the address of a symbol, or nil
if not found. Similar to getAddress when errorOnLookup is false, but returns nil
instead
getSymbolInfo(symbolname): Returns a table as defined by the SymbolList class
object (modulename, searchkey, address, size)
getModuleSize(modulename): Returns the size of a given module (Use getAddress to
get the base address)
reinitializeSymbolhandler(waittilldone: BOOLEAN OPTIONAL, default=TRUE):
reinitializes the symbolhandler. E.g when new modules have been loaded
reinitializeDotNetSymbolhandler(modulename OPTIONAL): Reinitializes only the
DotNet part of the symbol list. (E.g After an ILCode has been JITed) (6.4+)
reinitializeSelfSymbolhandler(waittilldone: BOOLEAN OPTIONAL, default=TRUE):
reinitializes the selfsymbolhandler. E.g when new modules have been loaded to CE
process
errorOnLookupFailure(state): If set to true (default) address lookups in
stringform will raise an error if it can not be looked up. This includes
symbolnames that are not defined and pointers that are bad. If set to false it
will return 0 in those cases
(Useful for pointers that don't work 100% of the time)
6.4+:Returns the original state
Note: This runs AFTER the table has been packaged already
unregisterEXETrainerFeature(id)
If the function returns nil, and as secondary parameter a string, this will
make the auto assembler fail with that error
unregisterAutoAssemblerCommand(command)
Note: slNotSymbol and slFailure are similar, but failure comes only if
there's no token after the current token that can be concatenated. Else
slNotSymbol will loop several times till all tokens make up the full string
Return an Integer with the corresponding address if you found it. Nil or 0 if
you didn't.
registerAddressLookupCallback(function(integer):string): ID
Registers a function to be called when the name of an address is requested
unregisterAddressLookupCallback(ID): Removes the callback
registerStructureAndElementListCallback(function StructureListCallback(),
function elementlistcallback(id1,id2) ) : Registers a function to be called when
a structure needs to be dissected
function StructureListCallback() will be a function that returns an array of
list of structures in table format
the entries are build up as:
name: string - name of the structure
id1: integer - id you can use for whatever(e.g moduleid). It will be passed
on to elementlistcallback when this structure is picked
id2: integer - id you can use for whatever(e.g structureid inside the
module). It will be passed on to elementlistcallback when this structure is
picked
Página 5
celua
tip: If you return an empty table the structure will not be created. You can
use this to create the structure layout yourself and register that instead
unregisterStructureAndElementListCallback(ID)
unregisterStructureDissectOverride(ID)
unregisterStructureNameLookup(ID)
registerAssembler(function(address, instruction):bytetable)
Registers a function to be called when the single line assembler is invoked to
convert an instruction to a list of bytes
Return a bytetable with the specific bytes, or nil if you wish to let another
function, or the original x86 assembler to assemble it
script is a Strings object which when changed has direct effect to the script
unregisterAutoAssemblerPrologue(ID)
registerAutoAssemblerTemplate(name, function(script: TStrings; sender:
TFrmAutoInject): id - Registers an template for the auto assembler. The script
parameter is a TStrings object that has a direct connection to the current
script. (All script parsing is up to you...). Returns an ID
unregisterAutoAssemblerTemplate(ID)
function onOpenProcess(processid):
If this function is defined it will be called whenever cheat engine opens a
process.
Note: The the same process might be opened multiple times in a row internally
Note 2: This function is called before attachment is fully done. You can call
reinitializeSymbolhandler() to force the open to complete, but it will slow down
process opens. Alternatively, you could launch a timer which will run when the
opening has finished
getTickCount() : Returns the current tickcount since windows was started. Each
tick is one millisecond
processMessages() : Lets the main eventhandler process the new messages (allows
for new button clicks)
inMainThread(): Returns true if the current code is running inside the main
thread (6.4+)
integerToUserData(int): Converts a given integer to a userdata variable
userDataToInteger(UserDataVar): Converts a given userdata variable to an
integer
synchronize(function(...), ...): Calls the given function from the main thread.
Returns the return value of the given function
queue(function(...),...): calls the given function from the main thread. Does
not wait for the result. Note: Be sure to synchronize and call
checkSynchronize() before freeing the calling thread
checkSynchronize(): Call this from an infinite loop in the main thread when
using threading and synchronize calls. This will execute any queued synchronize
calls
Returns the E/RAX value returned by the called function (if no timeout or
other interruption)
onAutoGuess(function) :
Registers an function to be called whenever autoguess is used to predict a
variable type
function override (address, ceguess): Return the variable type you want it to
be. If no change, just return ceguess
AOBScan(x,x,x,x,...):
scans the currently opened process and returns a StringList object containing
all the results. don't forget to free this list when done
Bytevalue of higher than 255 or anything not an integer will be seen as a
wildcard
AOBScan(aobstring): see above but here you just input one string
Página 9
celua
Página 10
celua
getInstructionSize(address): Returns the size of an instruction (basically it
disassembles the instruction and returns the number of bytes for you)
getPreviousOpcode(address): Returns the address of the previous opcode (this is
just an estimated guess)
undefined property functions. Not all properties of all classes have been
explicitly exposed to lua, but if you know the name of a property of a specific
class you can still access them (assuming they are declared as published in the
pascal class declaration)
getPropertyList(class) : Returns a stringlist object containing all the
published properties of the specified class (free the list when done) (Note, not
all classed with properties have 'published' properties. E.g: stringlist)
setProperty(class, propertyname, propertyvalue) : Sets the value of a published
property of a class (Won't work for method properties)
getProperty(class, propertyname) : Gets the value of a published property of a
class (Won't work for method properties)
setMethodProperty(class, propertyname, function): Sets the method property to
the specific function
getMethodProperty(Class, propertyname): Returns a function you can use to call
the original function
alignmenttype is an integer:
0=No alignment check
1=Address must be dividable by alignmentparam
2=Address must end with alignmentparam
alignmentparam is a string which either holds the value the addresses must be
dividable by or what the last digits of the address must be
-debugging
debug variables
EFLAGS
32/64-bit: EAX, EBX, ECX, EDX, EDI, ESI, EBP, ESP, EIP
64-bit only: RAX, RBX, RCX, RDX, RDI, RSI, RBP, RSP, RIP, R8, R9, R10, R11, R12,
R13, R14, R15 : The value of the register
The following routines describe last branch recording. These functions only work
when kernelmode debugging is used and using windows XP (vista and later work
less effective or not at all because the operating system interferes. Might
also be intel specific. A dbvm upgrade in the future might make this work for
windows vista and later)
debug_setLastBranchRecording(boolean): When set the Kernel debugger will try to
record the last branch(es) taken before a breakpoint happens
debug_getMaxLastBranchRecord() : Returns the maximum branch record your cpu can
store (-1 if none)
debug_getLastBranchRecord(index): Returns the value of the Last Branch Record at
the given index (when handling a breakpoint)
Changing registers:
When the debugger is waiting to continue you can change the register variables.
When you continue those register values will be set in the thread's context
detachIfPossible() : Detaches the debugger from the target process (if it was
attached)
Class definitions
Object class: (Inheritance: )
Properties:
ClassName: String - The name of class (Read only)
Methods:
getClassName(): Returns the classname
fieldAddress(fieldname: string): Returns the address of the specific field
methodAddress(methodname: string)
methodName(address: integer)
destroy(): Destroys the object
methods:
getLeft()
setLeft(integer)
getTop()
setTop(integer)
getWidth()
setWidth(integer)
getHeight()
setHeight()
setCaption(caption) : sets the text on a control. All the GUI objects fall in
this category
getCaption() : Returns the text of the control
setPosition(x,y): sets the x and y position of the object base don the top
left position (relative to the client array of the owner object)
getPosition(): returns the x and y position of the object (relative to the
client array of the owner object)
setSize(width,height) : Sets the width and height of the control
getSize() : Gets the size of the control
setAlign(alignmentoption): sets the alignment of the control
getAlign(alignmentoption): gets the alignment of the control
getEnabled() : gets the enabled state of the control
setEnabled(boolean) : Sets the enabled state of the control
getVisible() : gets the visible state of the control
setVisible(boolean) : sets the visible state of the control
getColor() : gets the color
setColor(rgb) : Sets the color
getParent() : Returns nil or an object that inherits from the Wincontrol class
setParent(wincontrol) : Sets the parent for this control
getPopupMenu()
setPopupMenu()
getFont(): Returns the Font object of this object
setFont(): Assigns a new font object. (Not recommended to use. Change the
font object that's already there if you wish to change fonts)
repaint(): Invalidates the graphical area of the control and forces and update
update() : Only updates the invalidated areas
setOnClick(functionnameorstring) : Sets the onclick routine
getOnClick(): Gets the onclick function
doClick(): Executes the current function under onClick
bringToFront(): Changes the z-order of the control so it'd at the top
Página 16
celua
sendToBack(): Changes the z-order of the control so it'd at the back
screenToClient(): Converts screen x,y coordinates to x,y coordinates on the
control
clientToScreen(): Converts control x,y coordinates to screen coordinates
GraphicsObject : (GraphicsObject->Object)
methods
getControlCount() Returns the number of Controls attached to this class
getControl(index) : Returns a WinControl class object
getControlAtPos(x,y): Gets the control at the given x,y position relative to
the wincontrol's position
canFocus(): returns true if the object can be focused
focused(): returns boolean true when focused
setFocus(): tries to set keyboard focus the object
setShape(Region): Sets the region object as the new shape for this wincontrol
setShape(Bitmap):
setOnEnter(function) : Sets an onEnter event. (Triggered on focus enter)
getOnEnter()
setOnExit(function) : Sets an onExit event. (Triggered on lost focus)
getOnExit()
setLayeredAttributes(Key, Alpha, Flags) : Sets the layered state for the
control if possible (Only Forms are supported in in windows 7 and earlier)
flags can be a combination of LWA_ALPHA and/or LWA_COLORKEY
See msdn SetLayeredWindowAttributes for more information
methods
getCaption() : Gets the caption of the menu item
setCaption(caption) : Sets the caption of the menu item
getShortcut(): Returns the shortcut for this menu item
setShortcut(shortcut): Sets the shortcut for this menuitem. A shortcut is a
string in the form of ("ctrl+x")
getCount()
getItem(index) : Returns the menuitem object at the given index
add(menuitem) : Adds a menuItem as a submenu item
insert(index, menuitem): Adds a menuItem as a submenu item at the given index
delete(index)
setOnClick(function) : Sets an onClick event
getOnClick()
doClick(): Executes the onClick method if one is assigned
methods
centerScreen(); : Places the form at the center of the screen
hide() : Hide the form
show() : show the form
close(): Closes the form. Without an onClose this will be the same as hide
bringToFront(): Brings the form to the foreground
showModal() : show the form and wait for it to close and get the close result
isForegroundWindow(): returns true if the specified form has focus
setOnClose(function) : function (sender) : Return a CloseAction to determine
how to close the window
getOnClose() : Returns the function
getMenu() : Returns the mainmenu object of this form
setMenu(mainmenu)
Página 19
celua
properties
Alignment: alignment
BevelInner: panelBevel
BevelOuter: panelBevel
BevelWidth: Integer
FullRepaint: boolean
methods
getAlignment() : gets the alignment property
setAlignment(alignment) : sets the alignment property
getBevelInner()
setBevelInner(PanelBevel)
getBevelOuter()
setBevelOuter(PanelBevel)
getBevelWidth()
setBevelWidth(BevelWidth)
getFullRepaint()
setFullRepaint(boolean)
Página 20
celua
Image Class: (Inheritance: GraphicControl->Control->Component->Object)
createImage(owner): Creates an Image class object which belongs to the given
owner. Owner can be any object inherited from WinControl
properties
Canvas: Canvas - The canvas object to access the picture of the image
Transparent: boolean - Determines if some parts of the picture are see through
(usually based on the bottomleft corner)
Stretch: boolean - Determines if the picture gets stretched when rendered in
the image component
Picture: Picture - The picture to render
methods
loadImageFromFile(filename)
getStretch()
setStretch(boolean)
getTransparent()
setTransparent(boolean)
getCanvas()
setPicture(picture)
getPicture() : Returns the Picture object of this image
properties
Text: string - The current contents of the editfield
SelText: string - The current selected contents of the edit field (readonly)
SelStart: number - The starting index of the current selection (zero-indexed,
readonly)
SelLength: number - The length of the current selection. (readonly)
OnChange: function - The function to call when the editfield is changed
OnKeyPress: function - The function to call for the KeyPress event.
OnKeyUp: function - The function to call for the KeyUp event.
OnKeyDown: function - The function to call for the KeyDown event.
methods
clear()
copyToClipboard()
cutToClipboard()
pasteFromClipboard()
selectAll()
select(start, length OPTIONAL)
selectText(start, length OPTIONAL) : Set the control's current selection. If
no length is specified, selects everything after start.
clearSelection()
getSelText()
getSelStart()
getSelLength()
getOnChange()
setOnChange(function)
getOnKeyPress()
setOnKeyPress(function)
getOnKeyUp()
setOnKeyUp(function)
getOnKeyDown()
setOnKeyDown(function)
methods
append(string)
getLines() : returns a Strings class
getWordWrap()
setWordWrap(boolean)
getWantTabs()
setWantTabs(boolean)
getWantReturns()
setWantReturns(boolean)
getScrollbars()
setScrollbars(scrollbarenumtype) :
Sets the scrollbars. Horizontal only takes affect when wordwrap is disabled
valid enum types:
ssNone : No scrollbars
ssHorizontal: Has a horizontal scrollbar
ssVertical: Has a vertical scrollbar
ssBoth: Has both scrollbars
ssAutoHorizontal: Same as above but only shows when there actually is
something to scroll for
ssAutoVertical: " " " " ...
ssAutoBoth: " " " " ...
properties
ModalResult: ModalResult - The result this button will give the modalform when
clicked
methods
getModalResult(button)
setModalResult(button, mr)
CheckBox Class: (Inheritance:
ButtonControl->WinControl->Control->Component->Object)
createCheckBox(owner): Creates a CheckBox class object which belongs to the
given owner. Owner can be any object inherited from WinControl
properties
Checked: boolean - True if checked
AllowGrayed: boolean - True if it can have 3 states. True/False/None
State: checkboxstate - The state. (cbUnchecked=0, cbChecked=1, cbGrayed=2)
OnChange: function - Function to call when the state it changed
methods
getAllowGrayed()
setAllowGrayed(boolean)
getState(): Returns a state for the checkbox. (cbUnchecked, cbChecked,
cbGrayed)
setState(boolean): Sets the state of the checkbox
Página 22
celua
onChange(function)
ToggleBox Class: (Inheritance:
CheckBox->ButtonControl->WinControl->Control->Component->Object)
createToggleBox(owner): Creates a ToggleBox class object which belongs to the
given owner. Owner can be any object inherited from WinControl
properties
MultiSelect: boolean - When set to true you can select multiple items
Items: Strings - Strings derived object containings all the items in the list
Selected[] - Returns true if the given line is selected. Use Items.Count-1 to
find out the max index
ItemIndex: integer - Get selected index. -1 is nothing selected
Canvas: Canvas - The canvas object used to render on the object
methods
clear()
clearSelection() : Deselects all items in the list
selectAll(): Selects all items in the list
getItems(): Returns a strings object
setItems(Strings): sets a strings object to the listbox
getItemIndex()
setItemIndex(integer)
getCanvas()
properties
Items: Strings - Strings derived object containings all the items in the list
ItemIndex: integer - Get selected index. -1 is nothing selected
Canvas: Canvas - The canvas object used to render on the object
methods
clear()
getItems()
setItems()
getItemIndex()
setItemIndex(integer)
getCanvas()
getExtraWidth() : Returns the number of pixels not part of the text of the
combobox (think about borders, thumb button, etc...)
methods
stepIt() - Increase position with "Step" size
stepBy(integer) - increase the position by the given integer value
getMax() - returns the Max property
setMax(integer) - sets the max property
getMin() - returns the min property
setMin(integer)- sets the min property
getPosition() - returns the current position
setPosition(integer) - sets the current position
setPosition2(integer) - sets the current position; without slow progress
animation on Win7 and later
properties
Min: integer - Minimal value for the trackbar
Max: integer - Maximum value for the trackbar
Position: integer - The current position
OnChange: function - Function to call when
methods
getMax()
setMax(integer)
getMin(trackbar)
setMin(trackbar, integer)
getPosition(progressbar)
setPosition(progressbar, integer)
getOnChange()
Página 24
celua
setOnChange(function)
methods
clear(collection)
getCount(collection)
delete(collection, index)
methods
add(): Returns a new ListColumn object
getColumn(index): Returns a ListColum object;
setColumn(index, listcolumns): Sets a ListColum object (not recommended, use
add instead)
ListItem Class : (Inheritance: TObject)
properties
Caption: boolean - The text of this listitem
Página 25
celua
Checked: boolean - Determines if the checkbox is checked (if it has a
checkbox)
SubItems: Strings - The Strings object that hold the subitems
Selected: boolean - Returns true if selected
Index: integer - The index in the Items object of the owner of this listitem
(readonly)
Owner: ListItems - The ListItems object that owns this ListItem (readonly)
methods
delete()
getCaption() : Returns the first columns string of the listitem
setCaption(string) : Sets the first column string of the listitem
getChecked() : Returns true if the listitem is checked
setChecked(boolean): Sets the checkbox of the listbox to the given state
getSubItems(): Returns a Strings object
makeVisible(partial): Scrolls the listview so this item becomes visible (Cheat
Engine 6.4 and later)
properties
Columns: ListColumns - The Listcolumns object of the listview (Readonly)
Items: ListItems - The ListItems objects of the listview
ItemIndex: integer - The currently selected index in the Items object (-1 if
nothing is selected)
Selected: ListItem - The currently selected listitem (nil if nothing is
selected)
Canvas: Canvas - The canvas object used to render the listview (Readonly)
AutoWidthLastColumn: Boolean - When set to true the last column will resize
when the control resizes
HideSelection: Boolean - When set to true the selection will not hide when the
focus leaves the control
RowSelect: Boolean - When set to true the whole row will be selected instead
of just the first column
OwnerData: Boolean - When set to true the listview will call the onData
function for every line being displayed. Use Items.Count to set the number of
virtual lines
methods
clear()
getColumns() : ListColumns - Returns a ListColumns object
getItems(): ListItems - Returns a ListItems object
getItemIndex(): integer - Returns the currently selected index in the Items
object
setItemIndex(index: integer)- Sets the current itemindex
getCanvas() : Canvas - Returns the canvas object used to render the listview
beginUpdate() - Tells the listview to stop updating while you're busy
endUpdate() - Applies all updates between beginUpdate and endUpdate
Página 27
celua
properties
Interval: integer - The number of milliseconds (1000=1 second) between
executions
Enabled: boolean
OnTimer: function(timer) - The function to call when the timer triggers
methods
getInterval()
setInterval(interval) : Sets the speed on how often the timer should trigger.
In milliseconds (1000=1 second)
getOnTimer()
setOnTimer(function(timer))
getEnabled()
setEnabled(boolean)
methods
getBrush(): Returns the brush object of this canvas
getPen(): Returns the pen object of this canvas
getFont(): Returns the font object of this canvas
getWidth()
getHeight()
Página 28
celua
getPenPosition()
setPenPosition(x,y)
clear() - Clears the canvas
line(sourcex, sourcey, destinationx, destinationy)
lineTo(destinationx, destinationy)
rect(x1,y1,x2,y2)
fillRect(x1,y1,x2,y2)
textOut(x,y, text)
getTextWidth(text)
getTextHeight(text)
getPixel(x,y)
setPixel(x,y,color)
floodFill(x,y, color OPTIONAL default=brush.Color, filltype OPTIONAL
default=fsSurface): Fills the picture till/with a color.
filltype can be
fsSurface: fill till the color (it fills all except this color)
fsBorder: fill this color (it fills only connected pixels of this color)
ellipse(x1,y1,x2,y2)
gradientFill(x1,y1,x2,y2, startcolor, stopcolor, direction) : Gradient fills a
rectangle. Direction can be 0 or 1. 0=Vertical 1=Horizontal
copyRect(dest_x1,dest_y1,dest_x2,dest_y2, sourceCanvas,
source_x1,source_y1,source_x2,source_y2) : Draws an image from one source to
another. Useful in cases of doublebuffering
draw(x,y, graphic) : Draw the image of a specific Graphic class
getClipRect() : Returns a table containing the fields Left, Top, Right and
Bottom, which define the invalidated region of the graphical object. Use this to
only render what needs to be rendered in the onPaint event of objects
properties
Name: string
Size: integer
Height: integer
Orientation: integer
Pitch: string - 'fpDefault', 'fpVariable', 'fpFixed'
Color: integer
CharSet: integer
Quality: string - 'fqDefault', 'fqDraft', 'fqProof', 'fqNonAntialiased',
'fqAntialiased', 'fqCleartype', 'fqCleartypeNatural'
Style: string set - ['fsBold', 'fsItalic', 'fsStrikeOut', 'fsUnderline']
methods
getName(): Gets the fontname of the font
setName(string): Sets the fontname of the font
Página 29
celua
getSize(): Gets the size of the font
setSize(integer): Sets the size of the font
getColor(): Gets the color of the font
setColor(integer): Sets the color of the font
assign(font): Copies the contents of the font given as parameter to this font
methods
getCanvas(): Returns the Canvas object for this image
getPixelFormat(): Returns the current pixelformat
getPixelFormat(pixelformat): Sets the pixelformat for this image. Will clear
the current image if it had one. Supported pixelformats: pf1bit, pf4bit, pf8bit,
pf15bit, pf16bit, pf24bit, pf32bit (recommended)
setTransparentColor(integer): Sets the color that will be rendered as
transparent when drawn
getTransparentColor(): Returns the color set to be transparent
methods
loadFromFile(filename)
saveToFile(filename)
loadFromStream(stream, originalextension OPTIONAL) : Loads a picture from a
Página 30
celua
stream. Note that the stream position must be set to the start of the picture
assign(sourcepicture)
CommonDialog class:
properties
OnShow: function(sender)
OnClose: function(sender)
Title: string - The caption at top of the dialog
methods
Execute() : Shows the dialog and return true/false depending on the dialog
FindDialog Class: (Inheritance: CommonDialog->Component->Object)
properties
FindText: String - The text the user wishes to find
Options: Enum - Find Options
{ frDown, frFindNext, frHideMatchCase, frHideWholeWord,
frHideUpDown, frMatchCase, frDisableMatchCase,
frDisableUpDown,
frDisableWholeWord, frReplace, frReplaceAll, frWholeWord,
frShowHelp,
frEntireScope, frHideEntireScope, frPromptOnReplace,
frHidePromptOnReplace }
OnFind: function (sender) - Called when the find button has been clicked
OnHelp: function (sender) - Called when the help button is visible (see
Options) and clicked
methods
methods
-
Stream Class
properties
Size: integer
Position: integer
methods
copyFrom(stream, count) - Copies count bytes from the given stream to this
stream
read(count): bytetable - Returns a bytetable containing the bytes of the
stream. This increases the position
write(bytetable, count OPTIONAL)- Writes the given bytetable to the stream
readByte(): integer
writeByte(integer)
readWord(): integer
writeWord(integer)
readDword(): integer
writeDword(integer)
readQword(): integer
writeQword(integer)
Página 32
celua
properties
Memory: Integer - The address in Cheat Engine's memory this stream is loaded
(READONLY, tends to change)
methods
loadFromFile(filename) : Replaces the contents in the memory stream with the
contents of a file on disk
saveToFile(filename) : Writes the contents of the memory stream to the
specified file
properties
Name: string
Stream: MemoryStream
methods
delete() : Deletes this file from your table.
saveToFile(filename)
getData() : Gets a MemoryStream object
xmplayer class
The xmplayer class has already been defined as xmplayer, no need to create it
manually
properties
IsPlaying : boolean - Indicator that the xmplayer is currently playing a xm
file
Initialized: boolean - Indicator that the xmplayer is actually actively loaded
in memory
methods
setVolume(int)
playXM(filename, OPTIONAL noloop)
playXM(tablefile, OPTIONAL noloop)
playXM(Stream, OPTIONAL noloop)
pause()
resume()
stop()
methods
doHotkey: Executes the hotkey as if it got triggered by the keyboard
MemoryRecord Class:
The memoryrecord objects are the entries you see in the addresslist
properties
ID: Integer - Unique ID
Index: Integer - The index ID for this record. 0 is top. (ReadOnly)
Description: string- The description of the memory record
Address: string - Get/set the interpretable address string. Useful for simple
address settings.
AddressString: string - Get the address string shown in CE (ReadOnly)
OffsetCount: integer - The number of offsets. Set to 0 for a normal address
Página 34
celua
Offset[] : integer - Array to access each offset
OffsetText[] : string - Array to access each offset using the interpretable
text style
CustomTypeName: String - If the type is vtCustom this will contain the name of
the CustomType
Script: String - If the type is vtAutoAssembler this will contain the auto
assembler script
Value: string - The value in stringform.
Selected: boolean - Set to true if selected (ReadOnly)
Active: boolean - Set to true to activate/freeze, false to deactivate/unfreeze
Color: integer
ShowAsHex: boolean - Self explanatory
ShowAsSigned: boolean - Self explanatory
AllowIncrease: boolean - Allow value increasing, unfreeze will reset it to
false
AllowDecrease: boolean - Allow value decreasing, unfreeze will reset it to
false
Collapsed: boolean - Set to true to collapse this record or false to expand
it. Use expand/collapse methods for recursive operations.
IsGroupHeader: boolean - Set to true if the record was created as a Group
Header with no address or value info. (ReadOnly)
IsReadable: boolean - Set to false if record contains an unreadable address.
NOTE: This property will not be set until the value property is accessed at
least once. (ReadOnly)
Options: String set - a string enclosed by square brackets filled with the
options seperated by a comma. Valid options are: moHideChildren,
moActivateChildrenAsWell, moDeactivateChildrenAsWell, moRecursiveSetValue,
moAllowManualCollapseAndExpand, moManualExpandCollapse
reinterpret()
createHotkey({keys}, action, value OPTIONAL): Returns a hotkey object
disableWithoutExecute(): Sets the entry to disabled without executing the
disable section
global events
function onMemRecPreExecute(memoryrecord, newstate BOOLEAN):
If above function is defined it will be called before action* has been
performed.
Active property is about to change to newState.
Página 36
celua
*action can be: running auto assembler script (ENABLE or DISABLE section),
freezing and unfreezing.
methods
getCount()
getMemoryRecord(index)
getMemoryRecordByDescription(description): returns a MemoryRecord object
getMemoryRecordByID(ID)
createMemoryRecord() : creates an generic cheat table entry and add it to the
list
getSelectedRecords(): Returns a table containing all the selected records
methods
roundingtype: Defined the way scans for exact value floating points are
handled
rtRounded : Normal rounded scans. If exact value = "3" then it includes
3.0 to 3.49999999. If exact value is "3.0" it includes 3.00 to 3.0499999999
rtTruncated: Truncated algorithm. If exact value = "3" then it includes
3.0 to 3.99999999. If exact value is "3.0" it includes 3.00 to 3.099999999
rtExtremerounded: Rounded Extreme. If exact value = "3" then it includes
2.0000001 to 3.99999999. If exact value is "3.0" it includes 2.900000001 to
3.099999999
input1: If required by the scanoption this is a string of the given variable
type
input2: If requires by the scanoption this is the secondary input
startAddress : The start address to scan from. You want to set this to 0
stopAddress : The address the scan should stop at. (You want to set this to
0xffffffffffffffff)
protectionflags : See aobscan about protectionflags
alignmenttype : Scan alignment type. Valid options are:
fsmNotAligned : No alignment check
Página 38
celua
fsmAligned : The address must be dividable by the value in
alignmentparam
fsmLastDigits : The last digits of the address must end with the digits
provided by alignmentparam
alignmentparam : String that holds the alignment parameter.
FoundList Class
The foundlist is an object that opens the current memscan's result file and
provides an interface for reading out the addresses
createFoundList(memscan)
properties
Count: integer - Number of results found
Address[index] : string - Returns the address as a string at the given index
Value[index]: string - Returns the value as a string at the given index
[index]: string - Same as Address
methods
initialize() : Call this when a memscan has finished scanning. This will open
the results for reading
deinitialize() : Release the results
getCount()
getAddress(index) : Returns the address as a string
getValue(index) : Returs the value as a string
methods
-
Disassemblerview class: (Inheritance:
Panel->CustomControl->WinControl->Control->Component->Object)
The visual disassembler used on the memory view window
properties
SelectedAddress: integer - The currently selected address in the
disassemblerview
SelectedAddress2: integer - The secondary selected address in the
disassemblerview
TopAddress: Integer - The first address to show
ShowJumplines: boolean - Determines if the jumplines should be shown
HideFocusRect: boolean - If set to true the focus rectangle won't be shown
SpaceAboveLines: integer
Página 40
celua
SpaceBelowLines: integer
OnSelectionChange: function(sender, address, address2) - Function to call when
the selection has changed
OnExtraLineRender: function(sender, Address, AboveInstruction, Selected):
RasterImage OPTIONAL, x OPTIONAL, y OPTIONAL
Function to call when you wish to provide the disassembler view with an
extra image containing data you wish to show.
This function is called once to get an image to show above the instruction,
and once to get an image to show under the instruction and optional comments.
The image for both calls must be different objects as rendering will only be
done when both calls have been completed
Sender is a DisassemblerviewLine object
If no coordinates are given the image will be centered above/below the
instruction
Osb: Bitmap : Background picture of the disasemblerview
methods
-
methods
-
createThreadSuspended(function(Thread,...), ...) :
Same as createNativeThread but it won't run until resume is called on it
properties
name: string - This name will be shown when the thread terminated abnormally
Finished: boolean - Returns true if the thread has reached the end. Do not
rely on this if the thread is freeOnTerminate(true) (which is the default)
Terminated: boolean - Returns true if the Terminate method has been called
methods
freeOnTerminate(state) :
When set to true the thread object will free itself when the function ends
(default=true)
Página 41
celua
Note: Use this only from inside the thread function as the thread might have
already terminated and freed itself when called
synchronize(function(thread, ...), ...) :
Called from inside the thread. This wil cause the tread to get the main
thread to execute the given function and wait for it to finish.
Usually for GUI access
Returns the return value of the given function
waitfor() :
Waits for the given thread to finish (Not recommended to call this from
inside the thread itself)
suspend() :
Suspend the thread's execution
resume() :
Resume the thread;s executionmm
terminate() :
Tells the thread it should terminate. The Terminated property will become
true
properties
-
methods
enter()
leave()
tryEnter(): Returns true if entered, false if not
properties
-
methods
resetEvent()
setEvent()
waitFor(timeout): Waits for the event to be set. Returns wrSignaled(0),
wrTimeout(1), wrAbandoned(2) or wrError(3);
methods
acquire()
release()
StructureFrm class:
createStructureForm(address, groupname OPTIONAL, structurename OPTIONAL)
enumStructureForms() : returns a table of StructureFrm objects (can be useful
for finding a structure window with the wanted structure)
properties:
MainStruct: structure - The currently selected structure
ColumnCount: integer - the number of columns (columns=address)
Column[index]: structColumn - Fetches a structColumn object from the structure
form
GroupCount: integer - The number of groups
Group[index]: structGroup - Fetches a structGroup object from the structure form
methods:
structChange() : Forces a refresh
addColumn(): Adds a new column in the currently focuses group and returns it's
structColumn object
addGroup(): Adds a new group and returns the structGroup object
structColumn class:
properties:
Address: integer - The current address
AddressText: string - Gets/sets the visual address
Focused: boolean - Gets/sets the focused state
methods:
focus(): focuses the current column
structGroup class:
properties:
name: string - gets the current name
box: Groupbox - Gets the groupbox object
columnCount: integer- Gets the number of columns in the group
columns[index]: structColumn - Returns the specific structColumn object
methods:
addColumns(): Adds a new columns to the specific group and returns it's
structColumn objecy
Methods:
getOwnerStructure(): Returns the structure this element belongs to
getOffset(): Returns the offset of this element
setOffset(offset): Sets the offset of this element
getName(): Returns the name of this element
setName(name): Sets the name of this element (tip: Leave blank if you only
want to set the name of the variable)
getVartype(): Returns the variable type of this element (check Variable types
in defines.lua)
setVartype(vartype)
getValue(address) : Gets the memory from the specified address and interprets
it according to the element type
setValue(address,value): Sets the memory at the specified address to the
interpreted value according to the element type
getValueFromBase(baseaddress): same as getValue but uses the offset to
calculate the final address
setValueFromBase(baseaddress,value): same as setValue but uses the offset to
calculate the final address
getChildStruct()
setChildStruct(structure)
getChildStructStart()
setChildStructStart(offset)
getBytesize(): Gets the bytesize of the element. Usually returns the size of
the type, except for string and aob
setBytesize(size): sets the bytesize for types that are affected (string, aob)
Página 44
celua
Extraparameters: Type=String : are url request parameters you can add to the
default parameters (e.g trainername=mytrainer for tracking purposes)
PercentageShown: You can change the default of 75% to a smaller value like 50%
functionid:
0: OpenProcess
Known compatible address defines:
windows_OpenProcess
dbk_OpenProcess
1: ReadProcessMemory
Known compatible address defines:
windows_ReadProcessMemory
dbk_ReadProcessMemory
dbk_ReadPhysicalMemory
dbvm_ReadPhysicalMemory
2: WriteProcessMemory
Known compatible address defines:
windows_WriteProcessMemory
dbk_WriteProcessMemory
dbk_WritePhysicalMemory
dbvm_WritePhysicalMemory
Página 47
celua
3: VirtualQueryEx
Known compatible address defines:
windows_VirtualQueryEx
dbk_VirtualQueryEx
VirtualQueryExPhysical
The dbvm_ addresses should only be used with auto assembler scripts injected
into Cheat Engine
dbvm_block_interrupts : Address of function dbvm_block_interrupts : DWORD;
stdcall;
dbvm_raise_privilege : Address of function dbvm_raise_privilege : DWORD;
stdcall;
dbvm_restore_interrupts: Address of function dbvm_restore_interrupts : DWORD;
stdcall;
dbvm_changeselectors : Address of function
dbvm_changeselectors(cs,ss,ds,es,fs,gs: dword): DWORD; stdcall;
D3DHOOK class:
The d3dhook functions provide a method to render graphics and text inside the
game, as long as it is running in directx9, 10 or 11
hookmessages defines if you want to hook the windows message handler for the
direct3d window. The d3dhook_onClick function makes use of that
properties
Width: Integer : The width of the screen (readonly)
Height: integer: The height of the screen (readonly)
DisabledZBuffer: boolean : Set this to true if you don't want previously
rendered walls to overlap a newly rendered object (e.g map is rendered first,
then the players are rendered)
WireframeMode: boolean : Set this to true if you don't want the faces of 3d
objects to be filled
MouseClip: boolean : Set this if to true if you have one of those games where
your mouse can go outside of the gamewindow and you don't want that.
OnClick: function(d3dhook_sprite, x, y)
A function to be called when clicked on an sprite (excluding the mouse)
x and y are coordinates in the sprite object. If sprites overlap the highest
zorder sprite will be given. It does NOT care if a transparent part is clicked
or not
Note: If you set this it can cause a slowdown in the game if there are a lot
of sprites and you press the left button a lot
methods
Página 48
celua
beginUpdate() : Use this function when you intent to update multiple
sprites,textcontainers or textures. Otherwise artifacts may occur (sprite 1
might be drawn at the new location while sprite 2 might still be at the old
location when a frame is rendered)
endUpdate() : When done updating, call this function to apply the changes
enableConsole(virtualkey): Adds a (lua)console to the specific game. The given
key will bring it up (0xc0=tilde(`~))
createTexture(filename) : Returns a d3dhook_texture object
createTexture(picture, transparentColor OPTIONAL): Returns a d3dhook_texture
object
if the picture is not a transparent image the transparentcolor parameter can
be used to make one of it's colors transparent
createFontmap(font) : Returns a d3dhook_fontmap object created from the given
font
createSprite(d3dhook_texture): returns a d3dhook_sprite object that uses the
given texture for rendering
createTextContainer(d3dhook_fontmap, x, y, text): Returns a
d3dhook_textContainer object
properties
Height: integer (ReadOnly)
Width: integer (ReadOnly)
methods
loadTextureByPicture(picture)
properties
-
methods
changeFont(font): Changes the fontmap to the selected font
getTextWidth(string): Returns the width of the given string in pixels
properties
Width: Integer - The width of the sprite in pixels. Default is the initial
texture width
Height: Integer - The height of the sprite in pixels. Default is the initial
texture height
Texture: d3dhook_texture - The texture to show on the screen
methods
-
Methods
disassemble(address): Disassembles the given instruction and returns the
opcode. It also fills in a LastDisassembleData record
decodeLastParametersToString() : Returns the unedited "Comments" information.
Does not display userdefined comments
getLastDisassembleData() : Returns the LastDisassembleData table.
The table is build-up as follow:
Página 50
celua
address: integer - The address that was disassembled
opcode: string - The opcode without parameters
parameters: string - The parameters
description: string - The description of this opcode
commentsoverride: string - If set, this will be the
comments/LastParamatersToString result
bytes: table - A table containing the bytes this instruction consists of
(1.. )
modrmValueType: DisAssemblerValueType - Defines the type of the
modrmValue field (dvtNone=0, dvtAddress=1, dvtValue=2)
modrmValue: Integer - The value that the modrm specified. modrmValueType
defines what kind of value
parameterValueType: DisAssemblerValueType
parameterValue: Integer - The value that the parameter part specified
isJump: boolean - Set to true if the disassembled instruction can change
the EIP/RIP (not ret)
isCall: boolean - Set to true if it's a Call
isRet: boolean - Set to true if it's a Ret
isConditionalJump: boolean - Set to true if it's a conditional jump
properties:
methods:
clear() : Clears all data
dissect(modulename) : Dissects the memory of a module
dissect(base,size) : Dissect the specified memory region
addReference(fromAddress, ToAddress, type, OPTIONAL isstring):
Adds a reference. Type can be jtCall, jtUnconditional, jtConditional,
jtMemory
In case of jtMemory setting isstring to true will add it to the referenced
strings list
deleteReference(fromAddress, ToAddress)
Página 51
celua
properties
Connected: boolean: True if the pipe is connected
methods
lock() : Acquire a lick on this pipe till unlock is called. If lock can not be
acquired, wait. Recursive calls are allowed
unlock()
writeBytes(ByteTable, size OPTIONAL): Writes the provided byte table to the
pipe. if size is not provided, the whole table is sent. Returns the number of
bytes sent, or nil on failure
readBytes(size: integer): returns a byte table from the pipe, or nil on
failure
readDouble(): Read a double from the pipe, nil on failure
readFloat(): Read a float from the pipe, nil on failure
readQword(): Read an 8 byte value from the pipe, nil on failure
readDword(): Read a 4 byte value from the pipe, nil on failure
readWord(): Read a 2 byte value from the pipe, nil on failure
readByte(): Read a byte from the pipe, nil on failure
readString(size: integer): Reads a string from the pipe, nil on failure. (Can
support 0-byte chars)
readWideString(size: integer): Reads a widestring from the pipe, nil on
failure
methods
acceptConnection() - Waits for a client to connect to this pipe (Warning:
Freezes the thread this is executed in)
openLuaServer(Name):
Opens a pipe with the given name. The LuaClient dll needs this name to connect
to ce
the return value of this function is the return value of the lua function
(integer)
Settings class
This class can be used to read out and set settings of cheat engine and of
plugins, and store your own data
global functions
reloadSettingsFromRegistry(): This will cause cheat engine to reload the
settings from the registry and apply them
properties
Path: string - Gets/Sets the current subkey (nil if main)
Página 53
celua
Value[]: A table access into the settings. e.g: Value["Count"]=12
methods
SymbolList class
This class can be used to look up an address to a symbolname, and a symbolname
to an address
It can also be registered with the internal symbol handler of cheat engine
This class makes use of a special "Symbol" table construction that contains
size and optionally other data
Symbol Table:
modulename: string
searchkey: string
address: integer
symbolsize: integer
Global functions
createSymbolList() : Creates an empty symbollist
Properties
Methods
clear()
getSymbolFromAddress(address) : Searches the list for the given address. The
address does not have to match the exact address. As long as it falls withing
the range
getSymbolFromString(searchkey)
addModule(modulename, modulepath, address, size, is64bit)
deleteModule(modulename)
deleteModule(address)
addSymbol(modulename, searchkey, address, symbolsize,
skipAddressToSymbolLookup OPTIONAL, extradata OPTIONAL)
Adds a symbol to the symbollist
extradata is a table which can be used to fill in a return type and
parameters for function calls. It has the following fields:
returntype: string
parameters: string
deleteSymbol(searchkey)
deleteSymbol(address)
register() : Registers the current symbol list with the symbol handler
unregister(): Unregisters the current symbol list from the symbol handler
global functions
createPageControl(owner)
properties
ShowTabs: boolean - Shows the tabs
TabIndex: integer - Gets and sets the current tab
ActivePage: TabSheet - Returns the current tabsheet.
PageCount: integer - Gets the number of pages
Page[]: TabSheet - Get a specific page (TabSheet)
methods
addTab() : TabSheet - Creates a new TabSheet
global functions
registerCustomTypeLua(typename, bytecount, bytestovaluefunction,
valuetobytesfunction, isFloat)
Registers a Custom type based on lua functions
The bytes to value function should be defined as "function bytestovalue
(b1,b2,b3,b4)" and return an integer as result
The value to bytes function should be defined as "function valuetobytes
(integer)" and return the bytes it should write
registerCustomTypeAutoAssembler(script)
Registers a custom type based on an auto assembler script. The script must
allocate an "ConvertRoutine" and "ConvertBackRoutine"
returns the Custom Type object
properties
name: string
functiontypename: string
CustomTypeType: TCustomTypeType - The type of the script
script: string - The custom type script
scriptUsesFloat: boolean - True if this script interprets it's user side
values as float
methods
byteTableToValue({bytetable},Address Optional)
valueToByteTable(value, Address Optional)
----SQL Classes----
CustomConnection class (Inheritance: Component->Object)
properties
Connected: Boolean - Gets the current connection state, and lets you connect
as well
LoginPrompt: Boolean
AfterConnect: function(sender)
AfterDisconnect: function(sender)
BeforeConnect: function(sender)
BeforeDisconnect: function(sender)
methods
close(forceClose:Boolean Optional)
open()
Página 55
celua
SQLite3Connection class(Inheritance:
SQLConnection->Database->CustomConnection->Component->Object)
createSQLite3Connection(owner) - creates an SQLite3Connection object
setSQLiteLibraryName(pathwithdllname)- Lets you set the path to the sqlite3.dll
in case it's not .\win*\sqlite3.dll
properties
methods
createDB()
dropDB()
getInsertID(): integer
ODBCConnection class(Inheritance:
SQLConnection->Database->CustomConnection->Component->Object)
createODBCConnection(owner) - creates an ODBCConnection object
properties
Driver: string
FileDSN: string
methods
methods
Página 56
celua
commit()
commitRetaining()
rollback()
rollbackRetaining()
startTransaction()
endTransaction()
methods
methods
AddParam(Param)
methods
append()
appendRecord({values})
cancel()
checkBrowseMode()
clearFields()
close();
controlsDisabled(): boolean
cursorPosChanged;
delete;
disableControls;
edit;
enableControls;
fieldByName(fieldname): Field
findField(fieldname): Field
findFirst() boolean
findLast()
findNext()
findPrior()
first()
insert()
isEmpty()
last()
locate(KeyFields, KeyValues, options:"[loCaseInsensitive, loPartialKey]"):
boolean
lookup(keyfields, KeyValues, ResultFields): something
moveBy(distance)
next()
open()
post()
prior()
refresh()
updateCursorPos()
updateRecord()
methods
-
Página 58
celua
CustomBufDataset class (Inheritance: DBDataset->Dataset->Component->Object)
properties
FileName: string
PacketRecords: integer
UniDirectional: boolean
IndexName: string
MaxIndexesCount: integer
ChangeCount: integer
ReadOnly: boolean
methods
applyUpdates(MaxErrors Optional)
cancelUpdates()
loadFromStream(stream)
saveToStream(stream)
loadFromFile(filename)
saveToFile(filename)
createDataset()
methods
prepare()
unprepare()
execSQL()
rowsAffected()
paramByName(paramname): Param
SQL: string
InsertSQL: stringlist
UpdateSQL: stringlist
DeleteSQL: stringlist
RefreshSQL: stringlist
Options: string - set of [sqoKeepOpenOnCommit, sqoAutoApplyUpdates,
sqoAutoCommit,
Página 59
celua
sqoCancelUpdatesOnRefresh, sqoRefreshUsingSelect]
methods
-
HotkeyHandlerThread(Inheritence: Thread)
getHotkeyHandlerThread() : Returns the hotkey handler thread used internally by
CE
properties
state: 0 ('htsActive')=Active , 1('htsMemrecOnly')=Memory records only,
2('htsNoMemrec')=Everything except memoryrecords, 3('htsDisabled')=disabled
methods
-
RemoteThread(Inheritance: -)
createRemoteThread(address, parameter)
properties
Result : The 32-bit value returned by the thread
methods
waitForThread(timeout OPTIONAL) : Waits for the thread to finish. Timeout is
time in milliseconds. If nil, the timeout it infinite. If 0, it returns without
wait
ModuleLoader(Inheritance: -)
loadModule(pathtodll, executeEntryPoint OPTIONAL default=true)
properties:
loaded: boolean - true if successfuly mapped
exports: Table containing all exports
entryPoint: integer - address of the entrypoint
WriteLog(Inheritence: -)
properties
status: boolean
logsize: integer
methods
getLog(): table - Returns an indexed table with the write logs. each entry has
a table with the fields: address, original and new
Página 60