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 


Loading a DLL from inside of an EXE?
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
MooMooCow
Newbie cheater
Reputation: 0

Joined: 07 Jun 2007
Posts: 21

PostPosted: Wed Oct 29, 2008 6:30 am    Post subject: Loading a DLL from inside of an EXE? Reply with quote

I currently have a program that injects a DLL, but I hate distributing the executable with a DLL. The program and DLL is coded in C++ with some ASM. I would like to combine the EXE and the DLL into one file and then launch the DLL at start up. So, is it possible to combine a DLL to the end of an EXE file and have the EXE load the DLL successfully with LoadLibrary? If so, how?

I was thinking of just writting some nops at the end of the original EXE and then copying the DLL hex to the end of it, but I'm not sure where to go from there. I'm sure there will be a problem when I call LoadLibrary because it won't be able to find the DLL. Any ideas?

Thanks for any help and I hope this makes sense.
Back to top
View user's profile Send private message
Fafaffy
Cheater
Reputation: 65

Joined: 12 Dec 2007
Posts: 28

PostPosted: Wed Oct 29, 2008 6:36 am    Post subject: Re: Loading a DLL from inside of an EXE? Reply with quote

MooMooCow wrote:
I currently have a program that injects a DLL, but I hate distributing the executable with a DLL. The program and DLL is coded in C++ with some ASM. I would like to combine the EXE and the DLL into one file and then launch the DLL at start up. So, is it possible to combine a DLL to the end of an EXE file and have the EXE load the DLL successfully with LoadLibrary? If so, how?

I was thinking of just writting some nops at the end of the original EXE and then copying the DLL hex to the end of it, but I'm not sure where to go from there. I'm sure there will be a problem when I call LoadLibrary because it won't be able to find the DLL. Any ideas?

Thanks for any help and I hope this makes sense.


you do make sense
solution:
http://www.mediafire.com/?b3nwbakqa0n
+rep me
i think this is only for vista but you can check

What it does:
1.combines all the .dll's and the main exe all into 1 exe so for example
lets say you need music so you put windows media player on there
and theres a dll. if you renamed it or deleted it, then your program will not work.

But if you used this then the dll with bind with the exe so now you dont see the dll no more!

_________________
Brillia wrote:
I FUCKING FUCK SEX
Back to top
View user's profile Send private message Send e-mail
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Wed Oct 29, 2008 7:18 am    Post subject: Reply with quote

A more 'complete' solution is to add the DLL as a resource and extract it at runtime.

If you have the source to both, why not do whatever the DLL does in the main executable?
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Wed Oct 29, 2008 8:16 am    Post subject: Re: Loading a DLL from inside of an EXE? Reply with quote

fafaffy wrote:
+rep me

That's very annoying and against the rules. Confused

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Oct 29, 2008 8:18 am    Post subject: Reply with quote

Cause he's injecting it.
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Wed Oct 29, 2008 11:15 am    Post subject: Reply with quote

In that case, you can get rid of the exe and make the dll self-injecting. I'm not sure of the coding required for this though.
_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
MooMooCow
Newbie cheater
Reputation: 0

Joined: 07 Jun 2007
Posts: 21

PostPosted: Wed Oct 29, 2008 11:21 am    Post subject: Re: Loading a DLL from inside of an EXE? Reply with quote

fafaffy wrote:

you do make sense
solution:
http://www.mediafire.com/?b3nwbakqa0n
+rep me
i think this is only for vista but you can check

What it does:
1.combines all the .dll's and the main exe all into 1 exe so for example
lets say you need music so you put windows media player on there
and theres a dll. if you renamed it or deleted it, then your program will not work.

But if you used this then the dll with bind with the exe so now you dont see the dll no more!


Thanks. It sounds like what I'm looking for, but I keep getting the error:

Could not load assembly from the location

It says it is used for .NET programs and my program is not a .NET program. Maybe that is why.

Slugsnack wrote:
Cause he's injecting it.


Correct.

--Pillboi-- wrote:
In that case, you can get rid of the exe and make the dll self-injecting. I'm not sure of the coding required for this though.


I've never heard of a self injecting DLL, but anyway it won't help in my situation.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

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

PostPosted: Wed Oct 29, 2008 2:15 pm    Post subject: Reply with quote

Do what Zand said. Add the dll as a resource.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Oct 29, 2008 4:51 pm    Post subject: Reply with quote

I made a bot for maplestory that does that. Its called MyBot. What it does is it stores the 3 required files as binary in the exe and when it runs, it writes into a file. Look in the maple section if u want to see what it does.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Oct 29, 2008 5:02 pm    Post subject: Reply with quote

--Pillboi-- wrote:
In that case, you can get rid of the exe and make the dll self-injecting. I'm not sure of the coding required for this though.

wtf, never heard of that..
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Oct 29, 2008 5:26 pm    Post subject: Reply with quote

Slugsnack wrote:
--Pillboi-- wrote:
In that case, you can get rid of the exe and make the dll self-injecting. I'm not sure of the coding required for this though.

wtf, never heard of that..


Maybe he's thinking of proxy DLL's
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Oct 29, 2008 5:43 pm    Post subject: Reply with quote

How the hell would a dll run without a exe wrapper. and what is rundll32.exe? I read something that says it runs dlls as processes.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Wed Oct 29, 2008 5:52 pm    Post subject: Reply with quote

Quote:
rundll32.exe is a process which executes DLL's and places their libraries into the memory, so they can be used more efficiently by applications.
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: Wed Oct 29, 2008 8:48 pm    Post subject: Reply with quote

technically your quote smartz is correct except for the addition to the end..
RunDll is exactly like LoadDll.exe that olly uses except that RunDll Executes a funtion specified in the commandline.. it DOES not "place dll's in memory" other then its own.. nor does it "make anything more accessible" except for itself and most definitly not other applications.
Back to top
View user's profile Send private message MSN Messenger
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Thu Oct 30, 2008 3:35 am    Post subject: Reply with quote

noz3001 wrote:
Maybe he's thinking of proxy DLL's

I'm not really sure what I'm thinking of. Rolling Eyes

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
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