Programming a container for executables?

Started by
10 comments, last by the_edd 12 years, 2 months ago
Hi. smile.png
I wish to create a program that will run an executable, and then act as a container for that running executable.
My program should be able to pass the executable fake system information, such as "System Time", and block it from any internet access.
I am working with C# under windows.

What is the best method to accomplish this? Is there a name for programs that do this?

Thankyou for your time, forum-ers! biggrin.png
Advertisement

Is there a name for programs that do this?

Broadly speaking it's a form of sandbox.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


[quote name='The Batfrog' timestamp='1328668282' post='4910738']
Is there a name for programs that do this?

Broadly speaking it's a form of sandbox.
[/quote]

Ah! That looks like it! smile.png
I'll do some general research on creating sandboxes.
Any ideas on how to implement a sandbox with network access restriction and system information spoofing?
Would the "AppDomain" class be of any help?
Are we talking about arbitrary applications, or just one specific one?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


Are we talking about arbitrary applications, or just one specific one?


Arbitrary.

[quote name='ApochPiQ' timestamp='1328678556' post='4910784']
Are we talking about arbitrary applications, or just one specific one?


Arbitrary.
[/quote]
Then what you want is called a "virtual machine" :)

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.


Then what you want is called a "virtual machine" smile.png


Thankyou smile.png
However, I feel as though using a virtual machine would be unnecessarily computationally expensive, as it would involve running an entire operating system inside the VM.

I imagine there must be a lighter alternative by running the executable through a simpler sandbox, and intercepting kernel API calls such as GetSystemTime.
Is this at all possible?
Can you just hook the Win32 API calls using Detours (or you could do the same thing yourself)?
-- gekko

Can you just hook the Win32 API calls using Detours (or you could do the same thing yourself)?


This 'hooking' looks like exactly what I'm trying to do! YAY! :)

A couple of questions:

  • Is hooking Win32 API calls with my own code (without Detours) relatively easy?
  • What's the best way to block network access to a sandboxed executable?
"best"?

Run it on a machine with no network connection.... obviously.

But could we just back up slightly -- why do you want to do this?

This topic is closed to new replies.

Advertisement