Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


cttrainer.exe in lua, with error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
the rose
Newbie cheater
Reputation: 0

Joined: 28 Mar 2012
Posts: 19

PostPosted: Fri Apr 27, 2012 6:26 am    Post subject: cttrainer.exe in lua, with error Reply with quote

my ctrainer.exe in lua, appears to run :Error:Access violation.
I am using, the following script:

function replaceAOB1()

r=AOBScan("62 06 66 ?? ?? 24 03 a1 4f ?? ?? ?? d0 4f ?? ?? ?? d0 4f ?? ?? ?? 47")


if (r~=nil) then
c=strings_getCount(r)
if (c>0) then
resultlist1=nil
resultlist1={}
for i=0,c-1 do
a=strings_getString(r,i);
resultlist1[i+1]={}
resultlist1[i+1][1]=a
resultlist1[i+1][2]=readBytes(a, 23, true)

for j=12,21 do
writeBytes(tonumber("0x"..a)+j, 2)
end


end

else
print("No results");
end
else
print("Scan error")
end

end

function restoreAOB1()
for i=1,#resultlist1 do
local a=tonumber("0x"..resultlist1[i][1])
local orig=resultlist1[i][2];
for j=12,22 do
writeBytes(a+j,orig[j])
end
end
end

function activatetick(mr, before, currentstate)
if (before==false) and (currentstate==true) then
replaceAOB1()
end

return true
end

function deactivatetick(mr, before, currentstate)
if (before==false) and (currentstate==false) then
restoreAOB1()
end

return true
end

al=getAddressList()
mr=addresslist_getMemoryRecordByID(al,0);
memoryrecord_onActivate(mr,activatetick)
memoryrecord_onDeactivate(mr,deactivatetick)

-----------------------------------------------------------------------
this error in my script? or will be a bug in the cheat engine?

thank you
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Fri Apr 27, 2012 8:11 am    Post subject: Reply with quote

Test it without saving it as a .exe, add some debug prints and execute the script yourself

Also, if that is all of the script, it won't work. there is no command to open the process

_________________
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
View user's profile Send private message MSN Messenger
the rose
Newbie cheater
Reputation: 0

Joined: 28 Mar 2012
Posts: 19

PostPosted: Fri Apr 27, 2012 11:29 am    Post subject: Reply with quote

I put the command to open the process.

was thus:

function myattach(timer)
if getProcessIDFromProcessName("Transformice.exe") ~= nil then
object_destroy(timer)
openProcess("Transformice.exe")
end
end

t=createTimer(nil);
timer_setInterval(t,100)
timer_onTimer(t,myattach)

function replaceAOB1()

r=AOBScan("62 06 66 ?? ?? 24 03 a1 4f ?? ?? ?? d0 4f ?? ?? ?? d0 4f ?? ?? ?? 47")


if (r~=nil) then
c=strings_getCount(r)
if (c>0) then
resultlist1=nil
resultlist1={}
for i=0,c-1 do
a=strings_getString(r,i);
resultlist1[i+1]={}
resultlist1[i+1][1]=a
resultlist1[i+1][2]=readBytes(a, 23, true)

for j=12,21 do
writeBytes(tonumber("0x"..a)+j, 2)
end


end

else
print("No results");
end
else
print("Scan error")
end

end

function restoreAOB1()
for i=1,#resultlist1 do
local a=tonumber("0x"..resultlist1[i][1])
local orig=resultlist1[i][2];
for j=12,22 do
writeBytes(a+j,orig[j])
end
end
end

function activatetick(mr, before, currentstate)
if (before==false) and (currentstate==true) then
replaceAOB1()
end

return true
end

function deactivatetick(mr, before, currentstate)
if (before==false) and (currentstate==false) then
restoreAOB1()
end

return true
end

al=getAddressList()
mr=addresslist_getMemoryRecordByID(al,0);
memoryrecord_onActivate(mr,activatetick)
memoryrecord_onDeactivate(mr,deactivatetick)

-----------------------------
works as .ct

as .exe (display the following error)

An unhandled exception occured at $0042208f:
Edecompressionerrror: buffer error
$0042208F
$0041A68D

(I can not create a cttrainer.exe in the moon) Sad Sad Sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Fri Apr 27, 2012 12:15 pm    Post subject: Reply with quote

save your trainer with a lesser level of compression (or none at all) and then test it.
If the size is an issue, then compress the generated exe yourself

_________________
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
View user's profile Send private message MSN Messenger
misha-cs
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 12

PostPosted: Mon Jul 02, 2012 7:01 am    Post subject: Reply with quote

I'm making a trainer in the format .exe, where i'm using debug functions (ondebagger, pause, unpause). During the functions activation there is a mistake:
Code:
Error: Access violation


At when i make the trainer in format .cetrainer without Protection for editing, there no such mistakes.
How can I generate the trainer in the format .exe without such mistakes?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Mon Jul 02, 2012 8:12 am    Post subject: Reply with quote

Yes, there is a bug in cheat engine 6.2 regarding pause/unpause in protected trainers. Because it is protected some gui elements have been destroyed, but pause/unpause make use of that without checking if they exist or not

See if you can do an alternate method of pause. (speedhack speed 0, or set a breakpoint and wait for it to trigger)

_________________
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
View user's profile Send private message MSN Messenger
misha-cs
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 12

PostPosted: Mon Jul 02, 2012 10:48 am    Post subject: Reply with quote

Thanks! I do it!
Back to top
View user's profile Send private message
shadowwolf
How do I cheat?
Reputation: 0

Joined: 01 Apr 2013
Posts: 9
Location: The netherlands

PostPosted: Sun Apr 07, 2013 8:54 am    Post subject: Reply with quote

what does this error mean?
Error:[string "autoAssemble([[aobscan(bla, 89 08 8B 0D ?? ..."]:13: attempt to call global 'autoAssamble' (a nil value)
Back to top
View user's profile Send private message
Mohsen
Advanced Cheater
Reputation: 1

Joined: 04 Apr 2013
Posts: 69
Location: PE

PostPosted: Sun Apr 07, 2013 8:56 am    Post subject: Reply with quote

This means autoAssamble is not found..
Post your while script if possible
Back to top
View user's profile Send private message
shadowwolf
How do I cheat?
Reputation: 0

Joined: 01 Apr 2013
Posts: 9
Location: The netherlands

PostPosted: Sun Apr 07, 2013 2:23 pm    Post subject: Reply with quote

ok, i`ll try it out, hope it works with some changes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites