Inluding exe as a resource through visual c++

Started by
11 comments, last by RenaudRichard 19 years, 11 months ago
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
Advertisement
Why would anyone want to do that? Seems a little silly. If it''s some kind of shareware protection mechanism, it''s unusually lame.
Guess you dont know how...
Anybody else know?
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.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
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.
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
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...
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...
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.
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

This topic is closed to new replies.

Advertisement