View previous topic :: View next topic |
Author |
Message |
Centos How do I cheat? Reputation: 0
Joined: 07 Mar 2022 Posts: 9
|
Posted: Wed Jul 06, 2022 6:28 am Post subject: [Help] extra files don't work in exe trainer |
|
|
I have one .h file and another .bin file attached to a table and they both work fine as part of a ct file.
Then I put them in the Include folder and added this folder during exe generation as extra files and set the path with getCheatEngineDir() at the beginning of the table. They are both appearing in the appropriate folder under the temp folder when the trainer is launched, but none of the functions using these 2 files is working.
Here is my code of adding the path
{$lua}
if syntaxcheck then return end
path = getCheatEngineDir()
addCIncludePath(path .. 'include\\abc.h')
addCIncludePath(path .. 'include\\abc.bin')
[ENABLE]
blah blah...
Did I miss something? Please help me.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Wed Jul 06, 2022 8:35 am Post subject: |
|
|
addCIncludePath needs the path, no the filepath. So just \\include
_________________
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 |
|
|
Centos How do I cheat? Reputation: 0
Joined: 07 Mar 2022 Posts: 9
|
Posted: Wed Jul 06, 2022 7:02 pm Post subject: |
|
|
Dark Byte wrote: | addCIncludePath needs the path, no the filepath. So just \\include |
I changed it to
{$lua}
if syntaxcheck then return end
path = getCheatEngineDir()
addCIncludePath(path .. '\\include')
[ENABLE]
blah blah...
still no luck
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu Jul 07, 2022 4:47 am Post subject: |
|
|
try `addCIncludePath(path .. 'include\\')` instead
also, how do you reference the included files ?
_________________
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 |
|
|
Centos How do I cheat? Reputation: 0
Joined: 07 Mar 2022 Posts: 9
|
Posted: Fri Jul 08, 2022 11:00 pm Post subject: |
|
|
Dark Byte wrote: | try `addCIncludePath(path .. 'include\\')` instead
also, how do you reference the included files ? |
It looks like this:
Code: | {$lua}
if syntaxcheck then return end
local HeaderFile = findTableFile("abc.h")
if (HeaderFile ~= nil) then HeaderFile.saveToFile("abc.h") end
local Meta = findTableFile("abc.bin")
if (Meta ~= nil) then
local mem = allocateMemory(Meta.Stream.Size)
local data = readBytesLocal(Meta.Stream.Memory, Meta.Stream.Size, true)
writeBytes(mem, data)
registerSymbol("AnyName", mem, true)
else
registerSymbol("AnyName", 0, true)
end |
And in the other code blocks, just #include "abc.h" if neccessary
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Fri Jul 08, 2022 11:54 pm Post subject: |
|
|
try saveToFile(getCheatEngineDir().."abc.h") as the working path may be different in trainers
also, you don't even have to write to disk. You can emit the content of the include file into the AA script
Code: |
{$lua}
local tf=findTableFile("abc.h")
local ss=createStringStream()
ss.copyFrom(tf.Stream,tf.Stream.Size)
local r=[[{$c}
]]
r=r..ss.DataString..[[
]] --needed
r=r..'{$asm}' --there's a reason I don't use the format parameter
ss.destroy()
--print(r)
return r
{$asm}
//the rest of your aa script, and do not use #include "abc.h"
|
---offtopic---
Also,
Code: |
local mem = allocateMemory(Meta.Stream.Size)
local data = readBytesLocal(Meta.Stream.Memory, Meta.Stream.Size, true)
writeBytes(mem, data)
registerSymbol("AnyName", mem, true)
|
can be rewritten as:
Code: |
local mem=copyMemory(tf.stream.Memory, tf.stream.Size, nil, 2) --2=copy from CE to target
registerSymbol("AnyName", mem, true)
|
_________________
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 |
|
|
Centos How do I cheat? Reputation: 0
Joined: 07 Mar 2022 Posts: 9
|
Posted: Sun Jul 10, 2022 4:21 am Post subject: |
|
|
Thank you! I will try it later.
|
|
Back to top |
|
|
|