Difference between revisions of "Lua:readBytesLocal"

From Cheat Engine
Jump to navigation Jump to search
(Victor)
m
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
</a> Rick /    Has de llegir-te el post que vam pucbliar sobre el megaupload fa ja un temps, perf2 t'ho resumeixo ...  El me9s pre0ctic e9s que et baixis un programa com el jDownloader, que e9s un gestor de desce0rregues.   El que tens aqued no es pot escoltar.  Sf3n una se8rie de links, que porten a fitxers que formen part d'un tot.   Quan ho tinguis tot baixat (tb es pot fer al brut) es descompon amb el winzip, winrar o similar i et sortiran totes les cane7ons.   A partir d'aqued ja pots veure el que hi ha, seleccionar, ...   Digues-nos si ara ho veus me9s clar.  Si no, em df3nes un toc i t'ho explico ...
+
[[Category:Lua]]
 +
'''function''' readBytesLocal(''Address'', ''ByteCount'', [''ReturnAsTable''])
 +
 
 +
Reads bytes from the specified address in Cheat Engine's own process memory (not the target process). 
 +
Returns the bytes as multiple return values or as a table if ''ReturnAsTable'' is true.
 +
 
 +
===Function Parameters===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Parameter
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|Address
 +
|Integer or [[CEAddressString]]
 +
|The address in Cheat Engine's memory to read from.
 +
|-
 +
|ByteCount
 +
|Integer
 +
|The number of bytes to read.
 +
|-
 +
|ReturnAsTable
 +
|Boolean (optional)
 +
|If true, returns a table of bytes. If false or omitted, returns each byte as a separate return value.
 +
|}
 +
 
 +
===Examples===
 +
<pre>
 +
-- Read 4 bytes and get them as separate values
 +
local b1, b2, b3, b4 = readBytesLocal(0x123456, 4)
 +
print(b1, b2, b3, b4)
 +
 
 +
-- Read 4 bytes and get them as a table
 +
local bytes = readBytesLocal(0x123456, 4, true)
 +
for i, v in ipairs(bytes) do
 +
   print("Byte " .. i .. ": " .. v)
 +
end
 +
</pre>
 +
 
 +
{{LuaSeeAlso}}
 +
 
 +
=== Related Functions ===
 +
{{ReadWriteMemory}}

Latest revision as of 17:11, 11 July 2025

function readBytesLocal(Address, ByteCount, [ReturnAsTable])

Reads bytes from the specified address in Cheat Engine's own process memory (not the target process). Returns the bytes as multiple return values or as a table if ReturnAsTable is true.

Function Parameters[edit]

Parameter Type Description
Address Integer or CEAddressString The address in Cheat Engine's memory to read from.
ByteCount Integer The number of bytes to read.
ReturnAsTable Boolean (optional) If true, returns a table of bytes. If false or omitted, returns each byte as a separate return value.

Examples[edit]

-- Read 4 bytes and get them as separate values
local b1, b2, b3, b4 = readBytesLocal(0x123456, 4)
print(b1, b2, b3, b4)

-- Read 4 bytes and get them as a table
local bytes = readBytesLocal(0x123456, 4, true)
for i, v in ipairs(bytes) do
  print("Byte " .. i .. ": " .. v)
end

See also[edit]

Related Functions[edit]