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 


[Delphi] Storing a DLL within a *.RES

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Mon Dec 03, 2007 1:32 pm    Post subject: [Delphi] Storing a DLL within a *.RES Reply with quote

Hello everyone. I work with delphi.

I want to make a program which holds a DLL resource (not using it ... just simply storing it like an archive)

And whenever i press a buton on my form, this DLL to be extracted to the folder where is my Application.


I've looked some tutorials and examples how is it done but for some odd reason i can't figure out how is it done with extracting/saving it.

By the way i've compiled the res file with the dll in it with those arguements:

Code:
hack DLL "demoplayer.dll"


Any working examples/code is appreciated. Very Happy

Thank you all for even reading my request. Smile Have a nice day!

_________________

Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Dec 03, 2007 1:37 pm    Post subject: Reply with quote

FindResource, LoadResource, SizeofResource, LockResource, CreateFile, WriteFile, CloseHandle
_________________
Back to top
View user's profile Send private message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Mon Dec 03, 2007 1:51 pm    Post subject: Reply with quote

appalsap wrote:
FindResource, LoadResource, SizeofResource, LockResource, CreateFile, WriteFile, CloseHandle



Those command are not helping me much.

Here is an example how we load BMP:

Code:
var bBitmap : TBitmap;
begin
 bBitmap := TBitmap.Create;
 try
  bBitmap.Handle := LoadBitmap(hInstance, 'ATHENA');
  Image1.Width := bBitmap.Width;
  Image1.Height := bBitmap.Height;
  Image1.Canvas.Draw(0,0,bBitmap);
 finally
  bBitmap.Free;
 end;
end;


Can't something similar to happen with my request of extracting the dll?

_________________

Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Dec 03, 2007 1:53 pm    Post subject: Reply with quote

h4c0r-BG wrote:
Those command are not helping me much.


That's the best I can give you without writing your code for you, which I don't want to do because there are many examples of this very thing on the forums.

_________________
Back to top
View user's profile Send private message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Mon Dec 03, 2007 2:11 pm    Post subject: Reply with quote

Okay ... the first line should look like this:

FindResource(hinstance, 'hack', RT_RCDATA);

I am asking do i need to use RT_RCDATA here or is it something else?

_________________

Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Dec 03, 2007 2:15 pm    Post subject: Reply with quote

no, use 'DLL' since that's what you put in your rc file
_________________
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Dec 03, 2007 2:30 pm    Post subject: Reply with quote

Code:

var
ms:TResourceStream;
begin
ms:=TResourceStream.Create(hInstance,'hack','DLL');
ms.SaveToFile('c:\MyHack.dll');

Very Happy
Back to top
View user's profile Send private message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Mon Dec 03, 2007 2:39 pm    Post subject: Reply with quote

Thank you HolyBlah.

Too bad first I will have to rep somebody else if i want to rep you.

You mush change reputation of different member to be able to change reputation of the same member twice.

Crying or Very sad

But don't worry. Very Happy

_________________

Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Mon Dec 03, 2007 2:57 pm    Post subject: Reply with quote

you can rep me
_________________
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Dec 03, 2007 2:58 pm    Post subject: Reply with quote

You dont have to +rep me...
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
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