473,396 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

start program directly from memory?

Hello!

I would like load teh data(it's my program decrypted) in memory and run it
directly from my memory.

If you have an idea?

best regards,

wavemill
Nov 17 '05 #1
5 2505
> If you have an idea?

Assembly.Load(byte[]) may be useful.
Mattias

Nov 17 '05 #2
Hello!

thank's for your answers.

assembly.load, load but not run my program.

I would like run my program directly from my memory.

best regards,

wavemill

"Mattias Sjögren" wrote:
If you have an idea?


Assembly.Load(byte[]) may be useful.
Mattias

Nov 17 '05 #3
Lets suppose that assebly that you've loaded has type (class) MyType. This
type has method StartProgram();

After the assembly was loaded this type can be obtained with
Assembly asm = Assebmly.Load(byte[]);
Type t = asm.GetType("MyType");
BindingFlags flags = (BindingFlags.Public | BindingFlags.Instance );
MethodInfo mInfo = t.GetMethod("StartProgram", flags);
mInfo.Invoke(...);
--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com
"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
Hello!

thank's for your answers.

assembly.load, load but not run my program.

I would like run my program directly from my memory.

best regards,

wavemill

"Mattias Sjogren" wrote:
If you have an idea?


Assembly.Load(byte[]) may be useful.
Mattias

Nov 17 '05 #4
after the assembly is loaded. Assembly.EntryPoint will give you the
entry point of your executable (the static Main), you can call Invoke
off of that to start the program.

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
Hello!

thank's for your answers.

assembly.load, load but not run my program.

I would like run my program directly from my memory.

best regards,

wavemill

"Mattias Sjogren" wrote:


Nov 17 '05 #5
This is my code:
FileStream fs = new FileStream(@"C:\Documents and Settings\Berdoues\Mes
documents\VisualStudioProjects\Application_Test_Wi ndowsForm\LoadAssembly\CaptureControl.exe",FileMod e.Open);
BinaryReader br = new BinaryReader(fs);
byte[] byteload = br.ReadBytes(Convert.ToInt32(fs.Length));
fs.Close();
br.Close();

Assembly asm = Assembly.Load(byteload);
object o = asm.CreateInstance("CaptureControl");
MethodInfo mi = asm.EntryPoint;
if(mi != null)
{
mi.Invoke(o,null);
}

It doesn'work.
"capturecontrol" is the name of my assemble and the namespce of my class
I don't understand the parameter of mi.Invoke(?,?);
Thank you for your help and patience!

wavemill

"Daniel Jin" wrote:
after the assembly is loaded. Assembly.EntryPoint will give you the
entry point of your executable (the static Main), you can call Invoke
off of that to start the program.

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
> Hello!
>
> thank's for your answers.
>
> assembly.load, load but not run my program.
>
> I would like run my program directly from my memory.
>
> best regards,
>
> wavemill
>
> "Mattias Sjogren" wrote:


Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Nimit | last post by:
Hi, I wasn't sure which forum this post belongs to, so I've posted it to a couple forums that I thought may be appropriate. In giving me advice, please consider me a beginner. Below is a synopsis...
75
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
4
by: Casual Reader | last post by:
Hi, I have a C# program that in principle should only use a constant amount of memory to execute (with periodic garbage collection) and in fact does so when executed in Mono under either Windows...
8
by: wavemill | last post by:
This is my code: FileStream fs = new FileStream(@"C:\Documents and Settings\Berdoues\Mes documents\VisualStudioProjects\Application_Test_WindowsForm\LoadAssembly\CaptureControl.exe",FileMode.Open);...
2
by: holysmokes99 | last post by:
I am developing a component in .Net 1.1, and want to debug it using the "start external program" of the debugger in the IDE. The program I want to start references both 1.1 and 2.0 components. The...
63
by: biyubi | last post by:
Hi, a year ago I won the 2005 Best Game categoryof the International Obfuscated C Code Contestwith a chess program. http://www.ioccc.org/whowon2005.html...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
1
by: Jim Langston | last post by:
Windows. Situation: Using a Python program called OpenRPG. I have a program that displays form data (a character sheet) in C++. I am able in the C++ program to build a string and copy it into the...
4
by: =?Utf-8?B?U3ZlbiBXLg==?= | last post by:
Hi Newsgroup, I am developing a C# Windows Forms application that launches processes within a background worker.. The processes seem to have a memory limit of about 278mb. Some proccesses...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.