Difference between revisions of "Lua:writeString"
								
								Jump to navigation
				Jump to search
				
				
		
 					
								
							
		m  | 
				|||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | '''function''' writeString(''Address'', ''Text'')  | + | [[Category:Lua]]  | 
| + | '''function''' writeString(''Address'', ''Text'', [''WideChar'']) ''':''' Boolean  | ||
| − | Writes   | + | Writes a string to the specified address in the currently opened (target) process.    | 
| + | Set ''WideChar'' to true to write the string as widechar (UTF-16/Unicode).    | ||
| + | Returns true on success.  | ||
===Function Parameters===  | ===Function Parameters===  | ||
| − | {|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 10: | Line 13: | ||
|-  | |-  | ||
|Address  | |Address  | ||
| − | |[[CEAddressString]]   | + | |Integer or [[CEAddressString]]  | 
| − | |The address   | + | |The address in the target process to write to.  | 
|-  | |-  | ||
|Text  | |Text  | ||
|String  | |String  | ||
| − | |The   | + | |The string to write.  | 
| + | |-  | ||
| + | |WideChar  | ||
| + | |Boolean (optional)  | ||
| + | |Set to true to write as a widechar (UTF-16/Unicode) string. Default is false (ASCII/ANSI).  | ||
|}  | |}  | ||
| + | ===Returns===  | ||
| + | Boolean — true if the write was successful, false otherwise.  | ||
| + | |||
| + | ===Examples===  | ||
| + | <pre>  | ||
| + | -- Write an ASCII string to address 0x123456  | ||
| + | local success = writeString(0x123456, "Hello, world!")  | ||
| + | print("Write successful:", success)  | ||
| + | |||
| + | -- Write a widechar (Unicode) string to a CEAddressString  | ||
| + | writeString("game.exe+1234", "Unicode Text", true)  | ||
| + | </pre>  | ||
| − | + | {{LuaSeeAlso}}  | |
| − | |||
| − | |||
=== Related Functions ===  | === Related Functions ===  | ||
| − | * [[  | + | * [[ansiToUtf8]]  | 
| − | * [[  | + | * [[utf8ToAnsi]]  | 
| − | * [[  | + | * [[translate]]  | 
| − | + | {{ReadWriteMemory}}  | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 17:08, 11 July 2025
function writeString(Address, Text, [WideChar]) : Boolean
Writes a string to the specified address in the currently opened (target) process. Set WideChar to true to write the string as widechar (UTF-16/Unicode). Returns true on success.
Function Parameters[edit]
| Parameter | Type | Description | 
|---|---|---|
| Address | Integer or CEAddressString | The address in the target process to write to. | 
| Text | String | The string to write. | 
| WideChar | Boolean (optional) | Set to true to write as a widechar (UTF-16/Unicode) string. Default is false (ASCII/ANSI). | 
Returns[edit]
Boolean — true if the write was successful, false otherwise.
Examples[edit]
-- Write an ASCII string to address 0x123456
local success = writeString(0x123456, "Hello, world!")
print("Write successful:", success)
-- Write a widechar (Unicode) string to a CEAddressString
writeString("game.exe+1234", "Unicode Text", true)
See also[edit]
Related Functions[edit]
- ansiToUtf8
 - utf8ToAnsi
 - translate
 - 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