Difference between revisions of "Lua:writeBytes"

From Cheat Engine
Jump to navigation Jump to search
(Replaced content with '<span style="font-size:25px;color:red">Sorry! Content not available.</span>')
m (Syntax Highlighting.)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span style="font-size:25px;color:red">Sorry! Content not available.</span>
+
[[Category:Lua]]
 +
{{CodeBox|'''function''' writeBytes(''Address'', ''Byte1'', [''Byte2'', ...])}}
 +
 
 +
{{CodeBox|'''function''' writeBytes(''Address'', ''Table'')}}
 +
 
 +
Writes bytes to the specified address in the currently opened (target) process.
 +
You can provide the bytes as separate arguments or as a table.
 +
 
 +
===Function Parameters===
 +
 
 +
'''writeBytes(address, byte1, [byte2, ...])'''
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Parameter
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|Address
 +
|[[CEAddressString]] or Integer
 +
|The address in the target process to write to.
 +
|-
 +
|Byte1, Byte2, ...
 +
|Integer
 +
|The bytes to write (as separate arguments).
 +
|}
 +
 
 +
'''writeBytes(address, table)'''
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Parameter
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|Address
 +
|[[CEAddressString]] or Integer
 +
|The address in the target process to write to.
 +
|-
 +
|Table
 +
|Table
 +
|A table containing the bytes to write.
 +
|}
 +
 
 +
===Examples===
 +
<syntaxhighlight lang="lua" line>
 +
-- Write 4 bytes to an address
 +
writeBytes(0x123456, 0x90, 0x90, 0x90, 0x90)
 +
 
 +
-- Write bytes from a table
 +
local bytes = {0xDE, 0xAD, 0xBE, 0xEF}
 +
writeBytes(0x654321, bytes)
 +
</syntaxhighlight>
 +
 
 +
{{LuaSeeAlso}}
 +
 
 +
{{ReadWriteMemory}}

Latest revision as of 15:41, 25 June 2026

<> Lua API Reference

function writeBytes(Address, Byte1, [Byte2, ...])

<> Lua API Reference

function writeBytes(Address, Table)

Writes bytes to the specified address in the currently opened (target) process. You can provide the bytes as separate arguments or as a table.

Function Parameters[edit]

writeBytes(address, byte1, [byte2, ...])

Parameter Type Description
Address CEAddressString or Integer The address in the target process to write to.
Byte1, Byte2, ... Integer The bytes to write (as separate arguments).

writeBytes(address, table)

Parameter Type Description
Address CEAddressString or Integer The address in the target process to write to.
Table Table A table containing the bytes to write.

Examples[edit]

1 -- Write 4 bytes to an address
2 writeBytes(0x123456, 0x90, 0x90, 0x90, 0x90)
3 
4 -- Write bytes from a table
5 local bytes = {0xDE, 0xAD, 0xBE, 0xEF}
6 writeBytes(0x654321, bytes)

Main Pages

Core Lua documentation entry points

Lua
Script Engine