Difference between revisions of "Lua:byteTableToQword"
Jump to navigation
Jump to search
m (Added CodeBox Template.) |
m (Syntax Highlighting.) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 25: | Line 25: | ||
===Examples=== | ===Examples=== | ||
| − | < | + | <syntaxhighlight lang="lua" line> |
local qword = byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11}) | local qword = byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11}) | ||
print(string.format("0x%X", qword)) -- Output: 0x1122334455667788 | print(string.format("0x%X", qword)) -- Output: 0x1122334455667788 | ||
| − | </ | + | </syntaxhighlight> |
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
| − | |||
{{ReadWriteMemory}} | {{ReadWriteMemory}} | ||
Latest revision as of 15:48, 25 June 2026
<> Reference
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]
1 local qword = byteTableToQword({0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11})
2 print(string.format("0x%X", qword)) -- Output: 0x1122334455667788
See Also[edit]
Main Pages
Memory Access Related Lua Functions
Read Functions
Read Functions (Local Process)
Write Functions
Write Functions (Local Process)
Byte Table Conversions (Value → Byte Table)
Byte Table Conversions (Byte Table → Value)