Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

C# .exe to .dll / execute or run .dll as if it were a .exe

Okay so for example I have 2 projects, Form1.exe & console1.exe, what I want is to execute console1.exe within form1.exe, so I used,

Code
if (isLogin(true))
        {
            MessageBox.Show($"Welcome!");
            Process.Start("console1.exe");

Now the problem with this is, in order to execute console1.exe the user must store that file locally, now the issue with that is, he/she can execute console1.exe without executing form1.exe

So what I did was used ILMerge to merge the .exe's as you would a .dll but it's unable to now find console1.exe, so merging didn't work.

So now my conclusion was to reopen visual studio & create a reference .dll out of console1.exe.

Problem with this is executing the .dll as if it were still a .exe without calling methods separately, so to execute the file as if it were one method.

So basically executing the parent class, which will then follow up with the sub classes.

Now is there anyway I can reference console1.exe and merge it to form1.exe preventing users from running it as a solo application, or is it possible to set rules on console1.exe that it may not execute unless called from form1.exe, or the second conclusion to run it as a .dll reference library in one command not multiple sub classes.
1) Add console1.exe as resource in form1 project settings
2) when you need execute console1.exe from form1.exe simply extract the console1.exe resource to temp folder (Windows Temp folder would be nice)
3) execute console1.exe with wait for exit
4) after wait for exit delete console1.exe, so user can't use it.

Profit.
One method would be encrypting console1 using the login details as the encryption key then but that in resources.
When someone logs in, decrypt the resource and use reflection to run the program.
Lotta blood to let, peace to make, give a fuk about a check
i go t a file in my flash disk :
filename : extract_sound.exe
icon : zip/rar icon
size : 81mb
when i double click on it
then just show up a new windows at directory "libraries"
no activity happen

How can i get open the file inside?
Why not just move the code from console1 to form1...
how to move it,,i don't understand
(Sep 15, 2016 11:15 PM)Johansinan Wrote:  i go t a file in my flash disk :
filename : extract_sound.exe
icon : zip/rar icon
size : 81mb
when i double click on it
then just show up a new windows at directory "libraries"
no activity happen

How can i get open the file inside?
Please create a thread with your question and not use another one unrelated.
(Sep 15, 2016 11:39 PM)Corios Wrote:  Why not just move the code from console1 to form1...
Not the same question


Possibly Related Threads...
Thread / Author Replies Views Last Post
by neonbytesJul 29, 2024 01:32 PM 13 465 Jul 29, 2024 01:32 PM
Last Post: Klonopin
[C#] by Transporter007May 26, 2023 06:22 PM 22 665 May 26, 2023 06:22 PM
Last Post: Smoky
[C] by Who_Am_IAug 13, 2022 05:00 PM 7 370 Aug 13, 2022 05:00 PM
Last Post: nulluser123