Archived

This topic is now archived and is closed to further replies.

RenaudRichard

Inluding exe as a resource through visual c++

Recommended Posts

RenaudRichard    122
Hi how would I go about including a exe file as a resource file in visual c++, so that when you build the new exe through the compiler the included exe is built in the new one? If what I jus said made no sense let me know and I can clearify Thanks in advance

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Why would anyone want to do that? Seems a little silly. If it''s some kind of shareware protection mechanism, it''s unusually lame.

Share this post


Link to post
Share on other sites
Extrarius    1412
So you want to build an exe that includes itself as a resource?

Clarification on what exactly you want and why you want it would be helpful. Somebody might know a (better) way to do what you want.

Share this post


Link to post
Share on other sites
fooman    122
i guess he''s quite new and wants to programm a highlanguage virus, bc he doesnt know asm^^

the better way would be to just store the code/stack-segment stuff of your exe into your other programm as a string/stringresource, and write a little loader.

Share this post


Link to post
Share on other sites
RenaudRichard    122
I dont wanna build a virus...
Were moving in the downloadable game market, and we want to be able to limit the user''s time playing our games. So I have to build a wrapper that will bascily take account how much the user has played a game. When the user''s time is up, the wrapper that Im building will offer the user to purchase the game. We can''t build this feature in the game exe itself, because some of the games we will offer we will not have the source code for it.

Understand?

I''ve already figured out how to load the exe as a resource in visual c++ and now I jus need to know how to run it as a resource.

Thanks for your interest guys

Share this post


Link to post
Share on other sites
fooman    122
just let the user register each time he playes to your server, bc he has to download a main gameresourcefile, without it cant start your game, if the limit is reached, dont let him download anymore...

Share this post


Link to post
Share on other sites
RenaudRichard    122
I understand....the thing is the user doesnt play this from the net....the user downloads a game once, once its on the user''s computer he/she doesn''t have to go back online to play it...the user is able to reboot the computer and run the game without the net, if theres still enought time aloud.

Sorta like Real.com or GameHouse does it...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I am the one who posted the first response. Just as i thought, it was some kind of copy protection.

1) Like I originally said: Don''t do it that way, any newbie can rip out resources from a program.

2) There is no way to execute a resource. At least not without doing really advanced low-level stuff that might not work on all versions of the OS.

I suggest you find some other strategy.

Share this post


Link to post
Share on other sites
doynax    850
i''m guessing that protection is not much of an issue since it''s a shareware game. it''s quite easy as long as you don''t need any real security..

then you can just write the resouce''s contents onto a temporary file and execute it from there (use tempnam or some similar function and make sure it''s got a random extension), and don''t forget to delete the original exe once you''re done.

this method is commonly used for making 4k demos in win32

Share this post


Link to post
Share on other sites
RenaudRichard    122
Oh and its not really shareware games...its more like a full version game but limited by time...to be more precise...the user can only play it for 60 minutes unless he/she enters a registration code.

Share this post


Link to post
Share on other sites