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 


Exe Injection Problem...
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Feb 12, 2009 4:55 pm    Post subject: Exe Injection Problem... Reply with quote

When using exe injection, you cant display any windows. When you try to display windows it crash the program why?


And FYI exe injection is where you copy your own exe into the address space of another exe then executing a function in that copyed space so that it stays alive then you can delete and close the injecting exe.
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Feb 12, 2009 5:46 pm    Post subject: Reply with quote

Just feed it a module base. The reason it doesn't work, IIRC, is that you don't have any specific module associated with the exe, it's just a chunk of code. I remember coding a exe injector a while back, was good fun.

Whose code did you take to do this? Rolling Eyes
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Feb 12, 2009 6:07 pm    Post subject: Reply with quote

What do you mean whos code?
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Feb 12, 2009 6:10 pm    Post subject: Reply with quote

dnsi0 wrote:
What do you mean whos code?


Haha, so you mean you are trying to inject an exe like a dll, or are you WPM'ing the function? Either way; good luck. Both will fail.
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Feb 12, 2009 6:18 pm    Post subject: Reply with quote

You can inject an exe into another exe?
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Feb 12, 2009 6:38 pm    Post subject: Reply with quote

_void_ wrote:
You can inject an exe into another exe?


Ofcourse you can XD

And Flyte:

I just set the image base to a unused portion.
WHen I click inject, it finds the image size. Allocs a new section and writes it there. Then it executes a thread there. Everything else works EXCEPT displaying forms.
Back to top
View user's profile Send private message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Thu Feb 12, 2009 6:58 pm    Post subject: Reply with quote

Flyte wrote:
dnsi0 wrote:
What do you mean whos code?


Haha, so you mean you are trying to inject an exe like a dll, or are you WPM'ing the function? Either way; good luck. Both will fail.


I've always used WPM for .DLL's. How do I do it like you mentioned (first part before the word "or")?
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Thu Feb 12, 2009 7:23 pm    Post subject: Reply with quote

void: you can call LoadLibrary() to load an executable, and then GetProcAddress() to get its exports and call them, just like a DLL.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Thu Feb 12, 2009 10:15 pm    Post subject: Reply with quote

your saying a exe has a EXPORT_TABLE o0..

you could parse the PE like a dll and locate the exports o0 without Function calls like GetProcAddress and LoadLibrary(which are shimmed by everything btw)..

_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
Back to top
View user's profile Send private message MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Feb 12, 2009 11:04 pm    Post subject: Reply with quote

It's been a while since I made mine, but you need to do the following:

1) Create the exe you wish to inject with a .alloc section.
2) Load up the image in your address space.
3) Free enough memory in the targets address space for the parsed image (you can find it by looking at the sections).
4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub.
5) CreateRemoteThread() the execution stub.
6) ?????
7) Profit
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Feb 12, 2009 11:39 pm    Post subject: Reply with quote

Out of curiosity, why would you want to inject your EXE into another process?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri Feb 13, 2009 7:32 am    Post subject: Reply with quote

Flyte wrote:
4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub.

Most exe's won't have relocation data packed with them like dll's. (Is it even possible in exe's?) So how would you fix all the jumps and calls which need relocation?
Back to top
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Fri Feb 13, 2009 8:27 am    Post subject: Reply with quote

dnsi0 wrote:
_void_ wrote:
You can inject an exe into another exe?


Ofcourse you can XD

And Flyte:

I just set the image base to a unused portion.
WHen I click inject, it finds the image size. Allocs a new section and writes it there. Then it executes a thread there. Everything else works EXCEPT displaying forms.


Don't you mean inject a dll with a console into a process? You cant inject an .exe into another .exe. I think you can convert an .exe into a byte and save it to memory and inject it to another process

^^This probably wont make sense. (It's 4:30a.m)^^

_________________
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Fri Feb 13, 2009 8:41 am    Post subject: Reply with quote

Flyte wrote:
It's been a while since I made mine, but you need to do the following:

1) Create the exe you wish to inject with a .alloc section.
2) Load up the image in your address space.
3) Free enough memory in the targets address space for the parsed image (you can find it by looking at the sections).
4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub.
5) CreateRemoteThread() the execution stub.
6) ?????
7) Profit


Thats exactly what I did Flyte... Except I just made the image base higher on compilation so I don't have to rebase and fix all the crap.
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Feb 13, 2009 9:19 am    Post subject: Reply with quote

dnsi0 wrote:
Thats exactly what I did Flyte... Except I just made the image base higher on compilation so I don't have to rebase and fix all the crap.


Correction, that's what the code you took does. I've already a pretty good idea what it is and who made it (it's where I got the idea from originally).

tombana wrote:
Flyte wrote:
4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub.

Most exe's won't have relocation data packed with them like dll's. (Is it even possible in exe's?) So how would you fix all the jumps and calls which need relocation?


It's a linker option.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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