Difference between revisions of "Lua:byteTableToQword"
Jump to navigation
Jump to search
m (Added CodeBox Template.) |
|||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' byteTableToQword(''Table'') ''':''' | + | {{CodeBox|'''function''' byteTableToQword(''Table'') ''':''' Number}} |
| − | Converts a | + | Converts a table of bytes to a 64-bit qword (integer). |
| − | + | ===Function Parameters=== | |
| − | === Function Parameters === | + | {|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 12: | Line 11: | ||
|- | |- | ||
|Table | |Table | ||
| − | | | + | |Table |
| − | | | + | |A table containing the bytes to convert (least significant byte first). |
|} | |} | ||
| + | ===Returns=== | ||
| + | Number — The resulting 64-bit qword (integer). | ||
| − | == | + | ===Explanation=== |
| − | + | The function takes a table of bytes (e.g., <code>{0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11}</code>) and combines them into a single 64-bit value. | |
| − | + | The first element is the least significant byte (little-endian order). | |
| − | |||
| − | |||
| − | |||
| − | + | For example, <code>byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11})</code> returns <code>0x1122334455667788</code>. | |
| − | |||
| − | |||
| + | ===Examples=== | ||
| + | <pre> | ||
| + | local qword = byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11}) | ||
| + | print(string.format("0x%X", qword)) -- Output: 0x1122334455667788 | ||
| + | </pre> | ||
| − | + | {{LuaSeeAlso}} | |
| − | |||
| − | |||
=== Related Functions === | === Related Functions === | ||
| − | + | {{ReadWriteMemory}} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 23:11, 4 December 2025
| <> Function function byteTableToQword(Table) : Number |
Converts a table of bytes to a 64-bit qword (integer).
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| Table | Table | A table containing the bytes to convert (least significant byte first). |
Returns[edit]
Number — The resulting 64-bit qword (integer).
Explanation[edit]
The function takes a table of bytes (e.g., {0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11}) and combines them into a single 64-bit value.
The first element is the least significant byte (little-endian order).
For example, byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11}) returns 0x1122334455667788.
Examples[edit]
local qword = byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11})
print(string.format("0x%X", qword)) -- Output: 0x1122334455667788
See also[edit]
| Lua |
| Script Engine |
Related Functions[edit]
| Read Functions |
|---|
| readBytes |
| readSmallInteger |
| readInteger |
| readQword |
| readPointer |
| readFloat |
| readDouble |
| readString |
| Read Functions (Local Process) |
| readBytesLocal |
| readIntegerLocal |
| readQwordLocal |
| readPointerLocal |
| readFloatLocal |
| readDoubleLocal |
| readStringLocal |
| Write Functions |
| writeBytes |
| writeSmallInteger |
| writeInteger |
| writeQword |
| writeFloat |
| writeDouble |
| writeString |
| Write Functions (Local Process) |
| writeBytesLocal |
| writeIntegerLocal |
| writeQwordLocal |
| writeFloatLocal |
| writeDoubleLocal |
| writeStringLocal |
| Byte Table Conversions (Value → Byte Table) |
| wordToByteTable |
| dwordToByteTable |
| qwordToByteTable |
| floatToByteTable |
| doubleToByteTable |
| stringToByteTable |
| wideStringToByteTable |
| Byte Table Conversions (Byte Table → Value) |
| byteTableToWord |
| byteTableToDword |
| byteTableToQword |
| byteTableToFloat |
| byteTableToDouble |
| byteTableToString |
| byteTableToWideString |