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 


Comment on CE / a small question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Jughead007
How do I cheat?
Reputation: 0

Joined: 23 Dec 2012
Posts: 4

PostPosted: Wed Apr 10, 2013 5:05 am    Post subject: Comment on CE / a small question Reply with quote

People I would like to express my appreciation to DarkByte and everyone who helped developing CE, contributing on CE forum etc. It's an excellent and inspiring tool. I especially love the built in auto-assembler which it's just a solid bliss to work with. I'm new in CE with pretty small assembly coding experience but I could already easily manage to write injections using a common memory area that's shared between different processes via Kernel32 WinAPI calls. As a CE newbie, it was stunning for me how easy it was to work with WinAPI calls in a built-in assembler/disassembler like this xD It seemed just as easy as I would do it in visual basic Wink

One question:

I'm completely new in Lua language and cheattables and I'd like to know what's the most effective way to automatize opening a process & inject an assembly code. I mean on my current CE level, I do it the following way:

1.) I run the process I want to inject an assembly code into.

2.) I run CE with a command line option that contains the path and name of the cheat table.

3.) I open the process in CE.

4.) I enable assembly code injection.

What's the easiest general way (if there is any) to reduce the above steps to just load a table that would make CE to wait for the process to be launched and then auto-inject an assembly code when the process appears in the process list ?

(again, I'm new in Lua and cheattables sry if this is a n00b question)
Back to top
View user's profile Send private message
Mohsen
Advanced Cheater
Reputation: 1

Joined: 04 Apr 2013
Posts: 69
Location: PE

PostPosted: Wed Apr 10, 2013 5:16 am    Post subject: Reply with quote

Why don't you use built-in cheat engine trainer creator ?
File -> Generate generic trainer...

On topic :

Code:

function rep()
  timer_setEnabled(t, false);


   autoAssemble([[
    alloc(newmem,2048,"a.exe"+1468)
    label(returnhere)
    label(originalcode)
    label(exit)

    newmem:

    originalcode:
    nop

    exit:
    jmp returnhere

    "a.exe"+1468:
    jmp newmem
    nop
    returnhere:

  ]]);
  object_destroy(t);
  closeCE();
end
 
createProcess(TrainerOrigin .. "\\a.exe", "", false, false);
openProcess("a.exe");
t = createTimer(nil, false);
timer_setInterval(t, 100);
timer_onTimer(t , rep);
timer_setEnabled(t, true);
     


This is my first and last time which made a complete code because I was interested on topic.
Back to top
View user's profile Send private message
Jughead007
How do I cheat?
Reputation: 0

Joined: 23 Dec 2012
Posts: 4

PostPosted: Wed Apr 10, 2013 5:28 am    Post subject: Reply with quote

Thanx for the quick reply, yea I studied generating trainers and Lua language, but I'm just lame, I need time Very Happy Thanx for the script that seems what I'm lookin for Wink

May be a next version of CE could have such thing as a built in function though ...
Back to top
View user's profile Send private message
Jughead007
How do I cheat?
Reputation: 0

Joined: 23 Dec 2012
Posts: 4

PostPosted: Wed Apr 10, 2013 10:04 pm    Post subject: My solution and another question Reply with quote

Ok just a small addition to this thread to make it complete. Firstly, another thanx to Mohsen, as I'm a n00b on Lua scripting and absolutely couldn't solve this prob without his help. Here I'm adding my final and absolutely working version of the Luascript that exactly performs what I want.

The following version doesn't launch the target process but it waits for the user / another app to do it. Once the target process appears in the process list, CE will perform the injection and quits:

Code:

function CheckAndInject()
timer_setEnabled(t, false);

TargetProcessName = "AnyProcess.exe"
openProcess(TargetProcessName);

if getOpenedProcessID() == getProcessIDFromProcessName(TargetProcessName) then

autoAssemble([[

// ... any auto-assembler script ...

]]);

object_destroy(t);
closeCE();

else
timer_setEnabled(t, true);
end
end

t = createTimer(nil, false);
timer_setInterval(t, 500);
timer_onTimer(t, CheckAndInject);
timer_setEnabled(t, true);


This script can be made to include auto-launching the target process by simply inserting the line:

Code:

createProcess("AnyProcessPath/AnyProcess.exe", "commandline options", false, false);


right before the "createTimer line" of the above script.

Another interesting question I'm itching to know is that are there any limitations for the size of Lua / auto-assembler scripts ?
Back to top
View user's profile Send private message
Mohsen
Advanced Cheater
Reputation: 1

Joined: 04 Apr 2013
Posts: 69
Location: PE

PostPosted: Thu Apr 11, 2013 12:20 am    Post subject: Re: My solution and another question Reply with quote

Jughead007 wrote:

Another interesting question I'm itching to know is that are there any limitations for the size of Lua / auto-assembler scripts ?


Code:

          alloc(newmem,2048,"a.exe"+1468)


The limit is 2048 bytes, equal to 2KB.
You have read, write, execute permission.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Thu Apr 11, 2013 2:37 am    Post subject: Reply with quote

You can change that to any size you want
_________________
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
Jughead007
How do I cheat?
Reputation: 0

Joined: 23 Dec 2012
Posts: 4

PostPosted: Thu Apr 11, 2013 6:19 am    Post subject: Script code length Reply with quote

Ermmm ... yes I supposed the allocated memory for the assembled codes has no limits but that's another one that good to be sure Wink What I was really wondering was are there any size limits for the script files themselves (that contain the source code) as I tend to create pretty much big codes, but, in the meantime, as I further studied auto-assembler I found that it has include feature so I can even organize my assembly codes in modules Very Happy so nevermind this question I was a goose as usual Very Happy

Thanx for replying anyways Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Thu Apr 11, 2013 6:38 am    Post subject: Reply with quote

As much space as a 64 bit application can hold in memory (a lot)
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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