Difference between revisions of "Lua:writeBytes"
Jump to navigation
Jump to search
m |
|||
(13 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | '''function''' writeBytes(''Address'', ''Byte1'', ''Byte2 | + | [[Category:Lua]] |
+ | '''function''' writeBytes(''Address'', ''Byte1'', [''Byte2'', ...]) | ||
− | '''function''' writeBytes(''Address'', ''Table | + | '''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" | |
− | {|width="85%" cellpadding="10 | ||
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
Line 14: | Line 16: | ||
|- | |- | ||
|Address | |Address | ||
− | | | + | |[[CEAddressString]] or Integer |
− | |The address to write to | + | |The address in the target process to write to. |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |Byte2 | + | |Byte1, Byte2, ... |
|Integer | |Integer | ||
− | |The | + | |The bytes to write (as separate arguments). |
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | ||
− | + | '''writeBytes(address, table)''' | |
− | {|width="85%" cellpadding="10 | + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" |
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
Line 37: | Line 31: | ||
|- | |- | ||
|Address | |Address | ||
− | | | + | |[[CEAddressString]] or Integer |
− | |The address to write to | + | |The address in the target process to write to. |
|- | |- | ||
|Table | |Table | ||
|Table | |Table | ||
− | |A table | + | |A table containing the bytes to write. |
|} | |} | ||
+ | |||
+ | ===Examples=== | ||
+ | <pre> | ||
+ | -- 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) | ||
+ | </pre> | ||
+ | |||
+ | {{LuaSeeAlso}} | ||
+ | |||
+ | === Related Functions === | ||
+ | {{ReadWriteMemory}} |
Latest revision as of 15:58, 11 July 2025
function writeBytes(Address, Byte1, [Byte2, ...])
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]
-- 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)
See also[edit]
Related Functions[edit]
- readBytes
- readSmallInteger
- readInteger
- readQword
- readPointer
- readFloat
- readDouble
- readString
- writeBytes
- writeSmallInteger
- writeInteger
- writeQword
- writeFloat
- writeDouble
- writeString
- readBytesLocal
- readIntegerLocal
- readQwordLocal
- readPointerLocal
- readFloatLocal
- readDoubleLocal
- readStringLocal
- writeBytesLocal
- writeIntegerLocal
- writeQwordLocal
- writeFloatLocal
- writeDoubleLocal
- writeStringLocal
- wordToByteTable
- dwordToByteTable
- qwordToByteTable
- floatToByteTable
- doubleToByteTable
- stringToByteTable
- wideStringToByteTable
- byteTableToWord
- byteTableToDword
- byteTableToQword
- byteTableToFloat
- byteTableToDouble
- byteTableToString
- byteTableToWideString