The BCI is proposed as a Global Consultant for IT solutions that lead to the use of the Internet in order to enable the company to develop and expand the catchment area of its customers with solutions, Domain registration, Hosting / Housing, E-mail WebMail, E-commerce, Certification 3WC and quan'altro Vs visibility can be vital to the network.
Start an executable file directly from memory PDF Print E-mail

Run a program by taking its image from memory, rather than doing so directly from its binary file, an operation may be useful in many cases, sometimes, it may prompt the development of a crypt, which is operated only by a 'special utility, called launcher, which decrypts only after having loaded in memory at other times you need to start a file without using the resources of the hard disk.
In the latter case, use the namespace System.Reflection provides classes and interfaces that can provide a view of managed types, methods and fields loaded into memory, in particular, the class Assembly allows you to define self-describing an Assembly object, or a block of generation of application-type Common Language Runtime reusable, allowing the operator to run to fully understand the contents of an application and use of control rules.

Initially, you load the executable into a data stream or in a buffer as an array of bytes using the class FileStream, which allows to obtain a Stream object to a file with write operations and supplemental reading:

  1. string percorso = "percorso_file";
  2. FileStream file_load = new FileStream(percorso, FileMode.Open);
  3. BinaryReader pnt_binario = new BinaryReader(file_load);
  4. byte[] arr_binario = pnt_binario.ReadBytes(Convert.ToInt32(file_load.Length));

Next, you load the array of bytes into the Assembly cache and try to trace the address of the application, through a loop made with a while () loop or a for (), in order to create an ' instance useful to invoke:

  1. Assembly caricamento = Assembly.Load(arr_binario);
  2. MethodInfo pnt_indirizzo = caricamento.EntryPoint;
  3. if (pnt_indirizzo != null) {
  4. ...
  5. object istanza = caricamento.CreateInstance(pnt_indirizzo.Name);
  6. pnt_indirizzo.Invoke(istanza, null);
  7. ...
  8. }
 

Select language

Site visit

045787
TodayToday84
YesterdayYesterday237
WeekWeek321
MonthMonth1479
IP:38.107.191.119
Bossoni Consulenza Informatica di Omar Bososni - Quinzano d'Oglio (BS) Via Gramsci, 11 - P.IVA 01935580983
BCI Software & Solutions Template by Ahadesign Powered by BCI!
Banner