Difference between revisions of "Lua:wideStringToByteTable"

From Cheat Engine
Jump to navigation Jump to search
Line 44: Line 44:
  
 
=== Related Functions ===
 
=== Related Functions ===
* [[readBytes]]
+
{{ReadWriteMemory}}
* [[readInteger]]
 
* [[readQword]]
 
* [[readPointer]]
 
* [[readFloat]]
 
* [[readDouble]]
 
* [[readString]]
 
* [[writeBytes]]
 
* [[writeInteger]]
 
* [[writeQword]]
 
* [[writeFloat]]
 
* [[writeDouble]]
 
* [[writeString]]
 
* [[readBytesLocal]]
 
* [[readIntegerLocal]]
 
* [[readQwordLocal]]
 
* [[readPointerLocal]]
 
* [[readFloatLocal]]
 
* [[readDoubleLocal]]
 
* [[readStringLocal]]
 
* [[writeBytesLocal]]
 
* [[writeIntegerLocal]]
 
* [[writeQwordLocal]]
 
* [[writeFloatLocal]]
 
* [[writeDoubleLocal]]
 
* [[writeStringLocal]]
 
* [[wordToByteTable]]
 
* [[dwordToByteTable]]
 
* [[qwordToByteTable]]
 
* [[floatToByteTable]]
 
* [[doubleToByteTable]]
 
* [[stringToByteTable]]
 
* [[byteTableToWord]]
 
* [[byteTableToDword]]
 
* [[byteTableToQword]]
 
* [[byteTableToFloat]]
 
* [[byteTableToDouble]]
 
* [[byteTableToString]]
 
* [[byteTableToWideString]]
 

Revision as of 09:27, 4 July 2017

function wideStringToByteTable(String) : table

Converts a string is encoded using a widechar formatting to a byte table.


Function Parameters

Parameter Type Description
String string The widechar formated string to convert to a byte table


Examples

 local bt = wideStringToByteTable('player.weapons.rifle')
 bt[#bt + 1] = 0
 bt[#bt + 1] = 0
 writeBytes('00123ABC', bt)


Code:

 local bt = wideStringToByteTable('test')
 for i, v in ipairs(bt) do
   print(i - 1, string.format('%02X', v))
 end

Output:

 0 74 
 1 00 
 2 65 
 3 00 
 4 73 
 5 00 
 6 74 
 7 00 


See also

Related Functions