[Solved] Read Memory Stream form findTableFile?
Posted: Fri Mar 03, 2017 9:29 pm
I'm am trying to read a table file, right now I just save it to disc then read file as normal, but how do I read the memory stream directly?
Community Cheat Tables of Cheat Engine
https://fearlessrevolution.com/
Code: Select all
local file = findTableFile('test.cea')
local lst = getPropertyList(file)
for i = 1, lst.Count - 1 do
print(lst[i])
end
local stream = file.getData()
print(stream)
local bytes = stream.read(stream.Size)
for i = 1, #bytes do
print(bytes[i], string.char(bytes[i]))
end
Code: Select all
stream
0EBD9B90
47 /
47 /
47 /
47 /
32
67 C
69 E
65 A
32
116 t
101 e
115 s
116 t
32
102 f
105 i
108 l
101 e
13
10
Code: Select all
local bytes = stream.read(stream.Size)
local str = byteTableToString(bytes)
Code: Select all
function GetTableFileAsString(tfName)
local tf = findTableFile(tfName)
if tf then
local ss = createStringStream()
ss.copyFrom(tf.Stream,tf.Stream.Size)
local ret = ss.DataString
ss.Destroy()
return ret
end
end
print(GetTableFileAsString("insert-table-file-name"))
Code: Select all
local stream = tableFile.getData()
local fileStr = nil
local bytes = stream.read(stream.Size)
for i = 1, #bytes do
if fileStr == nil then
fileStr = ''
end
fileStr = fileStr .. string.char(bytes[i])
end
Code: Select all
if tableFile then
local ss = createStringStream()
ss.copyFrom(tableFile.Stream,tableFile.Stream.Size)
local fileStr = ss.DataString
ss.Destroy()
end