C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unpack Files to memory and then run them (like thinstall)

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Nemok
Guest





PostPosted: Wed Oct 26, 2005 4:07 pm    Post subject: Unpack Files to memory and then run them (like thinstall) Reply with quote



Hi,

Is it possible in anyway to load a file into memory and then run it
from there? I am working on a file compressor
(www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save
multiple files as an exe file that can then run the compressed files
after unpacking them to a temp folder. The problem is that I have to
unpack the files to the hard-disk and then run them from there, making
them vulnerable to user that may try to get the original (unprotected)
files.

So the user shouldn't have access to the file operations in the
background. So I need to keep the original unpacked files hidden from
the user, until after they are opened by the unpacker and then deleted.
So users should have no kind of access to the files (should not see
them, open them, should not be able to modify or copy them) but the
unpacker should be able to run them. (that is why I think that the
memory is the best solution)

So is there any way to protect them, like unpacking them directly to
memory and then run them from there? Something like a virtual disk in
memory?

Thanks.

Back to top
Victor Bazarov
Guest





PostPosted: Wed Oct 26, 2005 4:23 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote



Nemok wrote:
Quote:
Is it possible in anyway to load a file into memory and then run it
from there?

Everything is possible. C++ is a general-purpose programming language
that can help you do just about anything.

Quote:
I am working on a file compressor
(www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save
multiple files as an exe file that can then run the compressed files
after unpacking them to a temp folder. The problem is that I have to
unpack the files to the hard-disk and then run them from there, making
them vulnerable to user that may try to get the original (unprotected)
files.

OK. An obvious problem.

Quote:
So the user shouldn't have access to the file operations in the
background. So I need to keep the original unpacked files hidden from
the user, until after they are opened by the unpacker and then deleted.
So users should have no kind of access to the files (should not see
them, open them, should not be able to modify or copy them) but the
unpacker should be able to run them. (that is why I think that the
memory is the best solution)

A valid solution, I suppose.

How is all that relevant to C++ I am not sure yet. Do you have a C++
*language* question?

Quote:
So is there any way to protect them, like unpacking them directly to
memory and then run them from there? Something like a virtual disk in
memory?

These questions cannot be answered within the scope of this newsgroup.
If I were to speculate, then I'd say, yes, probably, if the facility of
'virtual disk in memory' is available. Of course, it all has nothing
to do with C++ language and therefore off-topic. Find a better place to
ask those questions. I suggest starting in a newsgroup dedicated to the
OS on which you're going to be running your program.

V

Back to top
mlimber
Guest





PostPosted: Wed Oct 26, 2005 4:32 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote



Nemok wrote:
Quote:
Hi,

Is it possible in anyway to load a file into memory and then run it
from there? I am working on a file compressor
(www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save
multiple files as an exe file that can then run the compressed files
after unpacking them to a temp folder. The problem is that I have to
unpack the files to the hard-disk and then run them from there, making
them vulnerable to user that may try to get the original (unprotected)
files.

So the user shouldn't have access to the file operations in the
background. So I need to keep the original unpacked files hidden from
the user, until after they are opened by the unpacker and then deleted.
So users should have no kind of access to the files (should not see
them, open them, should not be able to modify or copy them) but the
unpacker should be able to run them. (that is why I think that the
memory is the best solution)

So is there any way to protect them, like unpacking them directly to
memory and then run them from there? Something like a virtual disk in
memory?

Thanks.

This post is off-topic in this forum since standard C++ doesn't know
about executing other programs. You'll want to post in a newsgroup
related to your OS since the answer to your questions will be dependent
on how processes are started, allocated system resources, etc. on your
system.

Rhetorical question: Is the purpose of all this to prevent the user
from getting the actual files? If so, a determined and knowledgeable
user could probably still get around your security measures (just like
they do with encrypted songs from iTunes, etc.).

Cheers! --M


Back to top
Nemok
Guest





PostPosted: Wed Oct 26, 2005 4:43 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Well the relation to C++ is the fact that I am building this in C++ for
WinXP.
Any ideas on how to create something similar to RAM disk?

Back to top
Mirek Fidler
Guest





PostPosted: Wed Oct 26, 2005 4:51 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Quote:
This post is off-topic in this forum since standard C++ doesn't know
about executing other programs.

AFAIK, not quite correct. C library is part of C++ standard and defines
functions for executing other programs. Not that it would help in this
case :)

Mirek

Back to top
Victor Bazarov
Guest





PostPosted: Wed Oct 26, 2005 5:09 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Nemok wrote:
Quote:
Well the relation to C++ is the fact that I am building this in C++ for
WinXP.
Any ideas on how to create something similar to RAM disk?

A man in a flower shop: "Can you fix my flat tire?"
The flower lady: "No. This is a flower shop, what relation is
there to your tires?"
The man: "I was just driving _on_them_ before I walked in."

No, Nemok, no idea how to create something similar to RAM disk. C++ has no
mechanisms for that. Post to the newsgroup for your OS.

Back to top
mlimber
Guest





PostPosted: Wed Oct 26, 2005 5:13 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Mirek Fidler wrote:
Quote:
This post is off-topic in this forum since standard C++ doesn't know
about executing other programs.

AFAIK, not quite correct. C library is part of C++ standard and defines
functions for executing other programs. Not that it would help in this
case :)

Mirek

True, there is std::system() which could work if the OP could get a RAM
disk. Unfortunately, that part of the question is still off-topic here.

Cheers! --M


Back to top
red floyd
Guest





PostPosted: Wed Oct 26, 2005 6:03 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Nemok wrote:
Quote:
Well the relation to C++ is the fact that I am building this in C++ for
WinXP.
Any ideas on how to create something similar to RAM disk?


Minesweeper is written in C++ for WinXP. Should I ask Minesweeper
questions here?

Back to top
Neo
Guest





PostPosted: Thu Oct 27, 2005 8:37 am    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

OK ther topic isn't C++ ... but i've heard of something called UPX...
upx.sourceforge.net

it compresses ur files...on ur HD
Then decompresses it in memory when it is run and executes it.. no HD
involved :)

And i think the source is available under GNU.

There u go.
Neo

Back to top
Nemok
Guest





PostPosted: Thu Oct 27, 2005 2:59 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Thanks Neo. I see you are the only one here that is not too busy to say
I am off topic to actually read my question and give me an answer if
possible.

Back to top
Victor Bazarov
Guest





PostPosted: Thu Oct 27, 2005 3:14 pm    Post subject: Re: Unpack Files to memory and then run them (like thinstall Reply with quote

Nemok wrote:
Quote:
Thanks Neo. I see you are the only one here that is not too busy to say
I am off topic to actually read my question and give me an answer if
possible.

<sigh> I see you are not the only one here not realizing that perpetuating
off-topic is simply not good for _everybody_. comp.lang.c++ is *not*
a chat room for every issue remotely related to C++.

Back to top
mlimber
Guest





PostPosted: Fri Oct 28, 2005 8:20 pm    Post subject: Re: [OT] Unpack Files to memory and then run them (like thin Reply with quote

Victor Bazarov wrote:
Quote:
Nemok wrote:
Thanks Neo. I see you are the only one here that is not too busy to say
I am off topic to actually read my question and give me an answer if
possible.

sigh> I see you are not the only one here not realizing that perpetuating
off-topic is simply not good for _everybody_. comp.lang.c++ is *not*
a chat room for every issue remotely related to C++.

To quote Judge Easterbrook: "If the rules are good, enforce them; if
the rules are bad, change them; there's little point in having good
rules but winking at noncompliance."
(http://www.legalaffairs.org/howappealing/20q/2004_08_01_20q-appellateblog_archive.html)

Cheers! --M


Back to top
Victor Bazarov
Guest





PostPosted: Fri Oct 28, 2005 9:08 pm    Post subject: Re: [OT] Unpack Files to memory and then run them (like thin Reply with quote

mlimber wrote:
Quote:
Victor Bazarov wrote:

Nemok wrote:

Thanks Neo. I see you are the only one here that is not too busy to say
I am off topic to actually read my question and give me an answer if
possible.

sigh> I see you are not the only one here not realizing that perpetuating
off-topic is simply not good for _everybody_. comp.lang.c++ is *not*
a chat room for every issue remotely related to C++.


To quote Judge Easterbrook: "If the rules are good, enforce them; if
the rules are bad, change them; there's little point in having good
rules but winking at noncompliance."
(http://www.legalaffairs.org/howappealing/20q/2004_08_01_20q-appellateblog_archive.html)

I am not sure what you're trying to say with this quote. Honestly.

To the OP and others:

If we could _enforce_ the rules, we'd not be having this conversation.
Neither I nor other regulars here are going to change the topicality of
this newsgroup (IOW, the "rules" are just fine). But the rules are just
that, rules. Guidelines. No mechanism here exists to enforce them,
comp.lang.c++ is "unmoderated". That's why we "police" this newsgroup
and not *filter* it (like most moderated NGs).

Now, following the rules (guidelines) is the responsibility of every
poster, not a chosen few who pick which posts make it and which are left
to decay in bit- (or byte-) buckets as in moderated newsgroups. I do
actually think that this is a much better situation. Nobody has their
brains shot out by a pepper pellet here, nobody's arms or noses are
broken by a hard-rubber baton.

I will not tire to repeat this spiel: if we don't do our "policing" (in
whatever form it happens to exist), this newsgroup will cease to function
as intended. As part of "policing", the rule is not to answer off-topic
questions _at_all_. Not by marking it [OT], not in any other way. If
an off-topic question is answered, the off-topic question poster usually
simply leaves (he got what he wanted) never to come back again. He wasn't
interested in C++ to begin with, anyway. And some other bloke might see
that OT is perpetuated and deduce that it is perfectly OK to ask it again.
Another sod answers that one, and so on.

If the poster who doesn't know where to post is simply nudged in the right
direction, it is by far better than supplying the answer alongside some
vague mention of off-topicality. If he leaves hungry, he's more likely to
find the _proper_ place to eat. He'll just have to. Basically this is
the same as "give the man a fish" vs "teach the man to fish" thing.

V

P.S. If that's what Judge Easterbrook meant, good. If it's not, I am not
going to cry, anyway.

Back to top
Jim Langston
Guest





PostPosted: Mon Oct 31, 2005 9:42 am    Post subject: Re: [OT] Unpack Files to memory and then run them (like thin Reply with quote


"Victor Bazarov" <v.Abazarov (AT) comAcast (DOT) net> wrote

Quote:
mlimber wrote:
Victor Bazarov wrote:

Nemok wrote:

Thanks Neo. I see you are the only one here that is not too busy to say
I am off topic to actually read my question and give me an answer if
possible.

sigh> I see you are not the only one here not realizing that
perpetuating
off-topic is simply not good for _everybody_. comp.lang.c++ is *not*
a chat room for every issue remotely related to C++.


To quote Judge Easterbrook: "If the rules are good, enforce them; if
the rules are bad, change them; there's little point in having good
rules but winking at noncompliance."
(http://www.legalaffairs.org/howappealing/20q/2004_08_01_20q-appellateblog_archive.html)

I am not sure what you're trying to say with this quote. Honestly.

...
P.S. If that's what Judge Easterbrook meant, good. If it's not, I am not
going to cry, anyway.

Basically what Judge Easterbrook was saying was that if you have rules don't
let people break them. If you let people break them, and you have a reason
to, then the rule is no good so change it.

What I think he (the quoter) meant by that quote was, we stick to c++
questions here. If your problem is not c++ specific, it's OT and shouldnt'
be answered, because that's our rule.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.