I am programming with visual studio express using the Dark GDK libraries, and If I wanted to conceal my hard artwork such as pictures and artwork I developed so that no one could take it from my project directory to play my game how can I compile all of the files into one .exe?
I understand that this will slow down the load time for the game and require more resources but I need to know how to do this for windows applications as well. **Hopefully it's a simple compiler linker option -Crossing fingers**.

Thank you,

Dani AI

Generated

As hinted, embedding assets as resources is the usual, supported route; as said, that only slows down casual copying — determined users can extract resources. For the concrete goal of shipping one EXE that contains artwork plus a separate VB helper EXE, three practical options are: embed the helper and assets as resources and extract/run at runtime; convert binary files into compiled C arrays and link them into the build; or ship a single installer/self-extractor (Inno/NSIS/7-Zip SFX) that produces the files on install. If the VB logic can be converted to a DLL or incorporated directly, that is the cleanest solution.

A minimal resource approach (safe to do in Express by adding a text .rc) is to add the helper as RCDATA and read it back with the Win32 resource API, then write to a temp file and launch it. Example resource entry:

/* MyResources.rc */
#include "resource.h"
IDR_HIDEEXE RCDATA "HideMyProgram.exe"

And at runtime use FindResource / LoadResource / LockResource / SizeofResource, write the bytes to a temporary path and call CreateProcess. The Win32 docs for FindResource/LoadResource/LockResource are a good reference:

Cautions and best practices: AV scanners often flag generic binders or programs that unpack and execute binaries at runtime. To reduce false positives, prefer a proper installer, sign the binary with Authenticode, or refactor the VB work into a library. For deterrence (not prevention), encrypt resource bytes and decrypt immediately before use; do not rely on this as true protection of assets. For Visual C++ Express 2008, create a plain-text .rc and resource.h, add them to the project, or use a small external resource editor — but building the VB functionality into the same process is the most robust path.

Recommended Answers

All 5 Replies

Heh .. I hope this isnt advanced I am hoping for a simple compiler setting to do this in form of a few clicks.
Using : Visual Studio C++ Express 2008

My project folder for example contains these four files.

MyProgram.cpp
MyProgram.exe //Made in c++
HideMyProgram.exe // Made in VB, by different dev company
SomePicture.bmp

MyProgram.exe copies HideMyProgram.exe to startup folder for example. But I dont want to give a folder to my users without them seeing all four of these files. Instead I want one single executable. How do I do this?
How can all four of these files be encapsulated into my program to still achieve the same outcome, but being a single stand alone .exe?

I have found file binders that do this, but they are tagged by antivirus companies we use. This is no good!

>How to do compile all of your files into one .exe

Resource files.

>How to do compile all of your files into one .exe

Resource files.

Could you give an example ? I will look into this I remember doing some windows api programming tutorials loading resources, but I am not sure how to go about doing this to load a .exe as a resource into my main program.

Could you give an example ? I will look into this I remember doing some windows api programming tutorials loading resources, but I am not sure how to go about doing this to load a .exe as a resource into my main program.

// Bitmap resources
//
LANGUAGE 0, SUBLANG_NEUTRAL
IDB_MAIN           BITMAP         ".\\bkrng.bmp"

Also, if somebody wants to steal your artwork, they will.

All they have to do is open your program in a resource editor and save your art resource.

Your best bet is encrypting your files, then decrypting them at runtime.

Believe me when I say that if somebody wants to steal your artwork, you cannot stop them, bot you can make it harder for them to do.

Thanks allot you have taught me something new :) as this I did not know.
Another thing I found out is my version of visual studio 2008 express does not provide a resource editor. I know theres a program called resedit for this so maybe I will try that instead.
The main thing I am honestly after here is being able to compile a seperate .exe in with my .exe. For example the other .exe I have is made in visual basic, but it does some processing I need, and I need them all combined into one .exe.
I have a program called hot fusion which can do this, but I being like all of you .. want to know how to do it the harder way lol.. the programmers way!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.