View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Fri Oct 23, 2015 1:01 am Post subject: Running an exe as stream file use CE lua |
|
|
Hi guys,
Credit to Panraven for his function to execute a lua file has store as stream file in Cheat Engine > Table :
Code: |
function loadTableCode(n) --- Load Table / File Lua Store in CE Table
local t = findTableFile(n)
if t ~= nil then
local s = t.Stream
local c = readStringLocal(s.Memory,s.Size)
return c ~= nil and loadstring(c) -- return a function
end
end
local f = loadTableCode('testbin.lua')
print(type(f))
if type(f) == 'function' then f() else print('not loaded') end
|
Now, i have testbin.lua for a test with the function above, it worked good.
Next, how to use that function for an execute file ?.
I try something like this. I have a small exe file and i think a exe file contain binaries = a binary file (If I am not wrong).
Convert the binary file (exe file, say it "blablabla.exe") to a string file with this code :
Code: |
local hBinaryFile = io.open("blablabla.exe", "rb");
local sBinaryContent = "";
if(hBinaryFile)then
while(true)do
local block = hBinaryFile:read(512); -- Read only 512 bytes per iteration
if(not block)then break;end
sBinaryContent = sBinaryContent..block
end
hBinaryFile:close();
end
-- Now lets output it again.
local hBinaryOutput = io.open("output.txt", "wb");
if(hBinaryOutput)then
hBinaryOutput:write(sBinaryContent);
hBinaryOutput:close();
end
|
I got the output string file save to a file "output.txt".
Last, is it possible we load this string file as a function and executing it using lua ?.
Or is there other ways executing an exe file has store in CE table as a stream file ?
Regards
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Fri Oct 23, 2015 3:18 am Post subject: |
|
|
exe's need to be executed from disk. so you'll always have to first write them to disk and then execute it (shellExecute).
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Fri Oct 23, 2015 9:27 am Post subject: |
|
|
Thanks Dark Byte, understood
|
|
Back to top |
|
|
|