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 


[Question] Self-Injecting Code

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
sven3107
Expert Cheater
Reputation: 0

Joined: 04 Feb 2009
Posts: 118
Location: Belgium

PostPosted: Tue Mar 10, 2009 2:50 pm    Post subject: [Question] Self-Injecting Code Reply with quote

Hey, got another question (YES another one).
i found out you can make permanent adjustments to exe and other files by just opening the file instead of running it and attaching CE.
My question is if i can use some kind of function to make the executable inject the code below as soon as i run it.
Code:

alloc(newmem,2048)
label(returnhere)
label(do)
label(undo)
label(exit)

UObject::execAddEqual_FloatFloat+A1:
jmp newmem
returnhere:

newmem:
cmp edi,0F000000
ja undo
jna do

do:
fst dword ptr [edi]
pop edi
fstp dword ptr [edx]
jmp returnhere

undo:
nop
nop
pop edi
fstp dword ptr [edx]
jmp returnhere

exit:
jmp returnhere


It's not the biggest of code injections but i want to know if i can use something like
00033000:
db ....

so it would inject the code into itself when it starts up.

- It's a code that triggers rapid fire in UT2004, it checks if the address being modified is a reload timer and jumps to a NOP if true.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
mStorm
Expert Cheater
Reputation: 0

Joined: 21 Feb 2009
Posts: 107

PostPosted: Tue Mar 10, 2009 3:11 pm    Post subject: Reply with quote

This is something I'm also interested in.

I would think you would use some type of dll injection via C++?
Back to top
View user's profile Send private message
sven3107
Expert Cheater
Reputation: 0

Joined: 04 Feb 2009
Posts: 118
Location: Belgium

PostPosted: Tue Mar 10, 2009 3:39 pm    Post subject: Reply with quote

i don't know C# or C++...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Mar 10, 2009 4:23 pm    Post subject: Reply with quote

dll injection also works with delphi (and a lot easier)

anyhow, you use alloc, which isn't directly possible by just editing the code. Unless you use code caves. (executable codecaves that is)
But keep in mind that sections will be loaded at different offsets, so you have to inspect the pe header to find out where the actual virtual address is and not the offset in the file.

But for an easier solutions: Just try a standalone trainer that executes that script

anyhow, since you're playing with ut2k4, I've attached a example of what you can do with ce combined with dll injection (ut2k42-ll.cea would be the one you want to execute)
Fun fact: This same dll is also used in my ut3 version



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
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
sven3107
Expert Cheater
Reputation: 0

Joined: 04 Feb 2009
Posts: 118
Location: Belgium

PostPosted: Wed Mar 11, 2009 7:41 am    Post subject: Reply with quote

So you can't just make it inject the code as soon as the game starts?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Mar 11, 2009 12:30 pm    Post subject: Reply with quote

only if you code your own trainer that does all that

Ce's trainers currently only execute code on user request

_________________
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