Windows 10: Loading an External EXE into Memory and Calling/Running the EXE from Memory as Many Times...

Discus and support Loading an External EXE into Memory and Calling/Running the EXE from Memory as Many Times... in Windows 10 Customization to solve the problem; A very good day to you All, I hope you are doing Very Well, Please kindly see the attached code for a C# Program This C# Program will Load an... Discussion in 'Windows 10 Customization' started by One_Above_All, Aug 18, 2019.

  1. Loading an External EXE into Memory and Calling/Running the EXE from Memory as Many Times...


    A very good day to you All,

    I hope you are doing Very Well,


    Please kindly see the attached code for a C# Program


    This C# Program will Load an External EXE Program into Memory


    This C# Program will then do a Function Call to Run that EXE Program that sits in Memory


    The External EXE Program is an Executable that sending Keypress to the Desktop


    It does nothing except sending out keypresses to the Desktop


    The Calling Function to Run the EXE From Memory is listed below


    //Execute the assembly

    exeAssembly.EntryPoint.Invoke(null, null); //no parameters

    Is there any way for me to call the above function as many times as I want so that I can keep on running the EXE from memory as many times as I want ?

    The below code works for the 1st call to run the EXE


    On the second call to run the EXE - The code returns an error message and is not able to proceed any further


    What I would like to be able to do is to


    1) Load the EXE into Memory

    2) Set it up in such a way where I can Call the Invoke Function as many times as I wish in order to Run the External Keypress Program as many times as I wish


    Is there any way to do this ?


    Secondly I would like for the external EXE program to be able to interact with all the surrounding applications that are running on the Windows Desktop

    This is because the external EXE program is actually a program that sends out keypresses

    I am calling and running this external EXE program multiple times in order to deliver multiple keypresses many many times over

    The keypresses are to interact with any Running APP that I have opened in the Windows desktop

    And thus I would like for this keypresses app to be able to affect and interact with all the apps on the Windows desktop

    How can I modify the code so that I can allow for this external EXE to be able to interact with all running desktop apps?

    Here is the code
    ======================================
    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
    //Needed
    using System.Reflection;
    using System.IO;

    namespace MemoryLauncher
    {
    static class Program
    {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
    RunInternalExe("x.exe");
    }

    private static void RunInternalExe(string exeName)
    {
    //Get the current assembly
    Assembly assembly = Assembly.GetExecutingAssembly();

    //Get the assembly's root name
    string rootName = assembly.GetName().Name;

    //Get the resource stream
    Stream resourceStream = assembly.GetManifestResourceStream(rootName + "." + exeName);

    //Verify the internal exe exists
    if (resourceStream == null)
    return;

    //Read the raw bytes of the resource
    byte[] resourcesBuffer = new byte[resourceStream.Length];

    resourceStream.Read(resourcesBuffer, 0, resourcesBuffer.Length);
    resourceStream.Close();

    //Load the bytes as an assembly
    Assembly exeAssembly = Assembly.Load(resourcesBuffer);

    //Execute the assembly
    exeAssembly.EntryPoint.Invoke(null, null); //no parameters
    }
    }

    }

    ======================================

    :)
     
    One_Above_All, Aug 18, 2019
    #1
  2. Juzar_Ali Win User

    Win10 Regsvr32.exe memory cannot be read message

    Hi,

    I suggest you to run Memory Diagnostic tool and check if it helps.

    Memory Diagnostic tool is used to detect the possible memory problems.

    Follow the below steps:


    • Type Memory Diagnostic in the search area in the task bar and select
      Windows Memory Diagnostic.

    • Select Restart now and check for problem.
    The error message that you received indicates there may be some memory issues with the system (mapping the memory).

    Meanwhile, I suggest you to run System Maintenance troubleshooter to diagnose the exact issue ( slow internet etc.).


    • Press Windows key + W.

    • Type Troubleshooter in the Search box and hit enter.

    • Select System and Security.

    • Select System Maintenance under System options.

    • Follow the on-screen instructions to run the troubleshooter.
    Hope this helps. Please get back to us if you need any further assistance.

    Thank you.
     
    Juzar_Ali, Aug 18, 2019
    #2
  3. Eric Ber Win User
    Can't run .exe file

    Hi Phil,

    There are several reasons why you are having issues running .exe files on your Windows 10 laptop. To assist you better, kindly answer the questions below:

    • Have you made any changes to your laptop prior to this issue?
    • What troubleshooting steps have you done so far?
    • What is the error message that you received when running .exe files?

    Regards.
     
    Eric Ber, Aug 18, 2019
    #3
  4. Schism082 Win User

    Loading an External EXE into Memory and Calling/Running the EXE from Memory as Many Times...

    Can't run exe file

    Hello, I am trying to run an exe file I downloaded. When I click the exe I downloaded, it loads a little and then nothing happens. All other exe files work. I tried FixExec, and Microsoft's FixIt. They run and say they fixed the exe files but my exe won't
    run. How do I get my program to run?
     
    Schism082, Aug 18, 2019
    #4
Thema:

Loading an External EXE into Memory and Calling/Running the EXE from Memory as Many Times...

Loading...
  1. Loading an External EXE into Memory and Calling/Running the EXE from Memory as Many Times... - Similar Threads - Loading External EXE

  2. conhost,exe using IMMENSE amount of memory.

    in Windows 10 Gaming
    conhost,exe using IMMENSE amount of memory.: conhost.exe as shown in the screenshot is using high amounts of memory. When I first booted up my laptop Lenovo Ideapad Gaming 3 it was at 2000 MEGABYTES! 2 WHOLE gigabytes of ram...Things I have tried:Step 1: Run the SFC.Click on the Start button, Type CMD.Right click on CMD...
  3. conhost,exe using IMMENSE amount of memory.

    in Windows 10 Software and Apps
    conhost,exe using IMMENSE amount of memory.: conhost.exe as shown in the screenshot is using high amounts of memory. When I first booted up my laptop Lenovo Ideapad Gaming 3 it was at 2000 MEGABYTES! 2 WHOLE gigabytes of ram...Things I have tried:Step 1: Run the SFC.Click on the Start button, Type CMD.Right click on CMD...
  4. DWM EXE high memory, anyone know how to fix it

    in Windows 10 Ask Insider
    DWM EXE high memory, anyone know how to fix it: [ATTACH] https://preview.redd.it/u7m40go4z8b61.png?width=666&format=png&auto=webp&s=a54ff7e9c58e02b4417c2abc2d4682e8e03c2e36 submitted by /u/mr_griffon [link] [comments] https://www.reddit.com/r/Windows10/comments/kx0o1w/dwm_exe_high_memory_anyone_know_how_to_fix_it/
  5. running .exe command

    in Windows 10 Customization
    running .exe command: I am using mingw compiler. while i am running a CC++ program works fine program it compiles successfully but when i ran it i am facing a problem.I am getting that access is denied.I tried reinstalling but nothing has changed.I am facing this problem when i am connected to...
  6. No exe files will run!

    in Windows 10 BSOD Crashes and Debugging
    No exe files will run!: No exe files will run. This includes, Command Prompt, regedit, reset get started or anything else that has exe file during exicution. Using windows 10, on a hp envy laptop. *** Email address is removed for privacy ***...
  7. Running a .exe with no GUI

    in Windows 10 Ask Insider
    Running a .exe with no GUI: I use Linux on my home computer, but at most other places it’s Windows 10. I created a Python script to ask the user for a password and if it’s correct it’ll display my passwords. This is obviously insecure because the user could edit the file and see all the data that’ll be...
  8. RUN won't 'run' EXE files

    in Windows 10 Support
    RUN won't 'run' EXE files: Since 1803 was loaded on 3 of my Dell laptops (various models) I've discovered that the RUN function (under Windows Start Button) won't "run" an EXE file that is located in my download folder. Same response on 3 different laptops. I have a history of the APP for these EXEs...
  9. Can't run .exe

    in Windows 10 Software and Apps
    Can't run .exe: An update to AVG was performed on our computer. After that ran, when we try to open any program we receive the message: xxxx.exe- Application error the application was unable to start correctly (0xc0000135). Click OK to close the application. This occurs for any...
  10. 3 locked instances .exe but Unable to run .exe file

    in Windows 10 Support
    3 locked instances .exe but Unable to run .exe file: Hi everyone, I've got this serious problem recently. I can't run some .exe file. This problem happens a month ago, but now that file is able to run now, and now it got other .exe file can't run. Everytime I keep launch the .exe application file, the cursor just keep...

Users found this page by searching for:

  1. load exe into memory