![]() |
|
[.NET] Creating a launcher.. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Creating a launcher.. (/showthread.php?tid=6059563) |
Creating a launcher.. - Alien - Mar 23, 2020 I've gone back into an old Launcher project from a few years ago and have decided I'm gonna make it into a fully working project. Basically, the program reads an executable's byte code and runs it in memory. This part is already taken care of and I already have working code for this function. Now what I want to do is, be able to load the .exe via an OpenFileDialog and generate a new executable file that has the loaded .exe as a my.resource within it so that I can drop it without it ever being detected by the user. I am aware of CodeDom and believe it is most likely the best option to go with, but if anyone has any better ideas/suggestions I am open to them. Thanks. I want to do this the best way possible and to ultimately learn from this project. RE: Creating a launcher.. - Accord - Mar 23, 2020 Codedom, mono.cecil, and dnlib is what ive used for creating new assembly. RE: Creating a launcher.. - Alien - Mar 23, 2020 (Mar 23, 2020 10:07 PM)SIM-4463207 Wrote: Codedom, mono.cecil, and dnlib is what ive used for creating new assembly. I'll check into Mono and dnlib. Thanks! I'm currently in the process of getting CodeDom working. So far I've gotten it to add my executable as a resource file and generate a new .exe. Next task is to be able to execute it in the newly generated exe file from the my.resources. RE: Creating a launcher.. - StarZ - Mar 24, 2020 (Mar 23, 2020 09:19 PM)Alien Wrote: I've gone back into an old Launcher project from a few years ago and have decided I'm gonna make it into a fully working project. Basically, the program reads an executable's byte code and runs it in memory. This part is already taken care of and I already have working code for this function. Now what I want to do is, be able to load the .exe via an OpenFileDialog and generate a new executable file that has the loaded .exe as a my.resource within it so that I can drop it without it ever being detected by the user. My suggestion is not to drop anything. You can define an assembly and set it's content to execute it via a reflection runpe. Edit: Code ' thanks to Deathader for the reflection runpe...Yoinked from https://hackforums.net/showthread.php?tid=4391216 May have to play around with it to drop detections. But, It works. RE: Creating a launcher.. - BahNahNah - Mar 24, 2020 (Mar 24, 2020 02:45 PM)StarZ Wrote: My suggestion is not to drop anything. You can define an assembly and set it's content to execute it via a reflection runpe. What even is that code yikes. Code Dim objectValue As Object = RuntimeHelpers.GetObjectValue([assembly].CreateInstance(entryPoint.Name))You can simplify it to just Code Dim asm As Assembly = Assembly.Load(bytes)RE: Creating a launcher.. - Alien - Mar 24, 2020 A little update: I've gotten a lot closer to the end goal. Things that have been completed: 1. it Allows me to import a .exe file as a resource via openfiledialog and uses Codedom to generate the new Launcher.exe program with the .exe hidden inside the resources. 2. The newly generated Launcher.exe has a Launch button within it. Once the button is clicked it drops the .exe from its my.resources into the current directory that the launcher is running from. 3. I have working code that runs it from memory but i'm currently not at the point where its needed or can be used the way I want it to be used just yet. The steps still needed to be completed: 1. I need to find a way to have better access to the file.. I thought that dropping it for a brief second, reading it as bytes and then putting it into a variable for later usage (running it through memory), and deleting it, was the best plan. But at this point it seems to chaotic and it may possibly get detected by AV's in the future. Even so, for now this is what I am currently working at unless someone gives me a better idea. My goal overall: it needs to be as silent as possible meaning I don't want it to be dropping 10 million files etc. I'd rather most of the work to be done internally within the program if possible. RE: Creating a launcher.. - StarZ - Mar 24, 2020 (Mar 24, 2020 09:52 PM)BahNahNah Wrote: What even is that code yikes. Old code yoinked from google. Mainly to show a basic example of the concept in question. Thank you for posting a better solution. 👍 (Mar 24, 2020 10:16 PM)Alien Wrote: The steps still needed to be completed: Take a look at this old project on github. It shows a lazy way to store the payload. It's far from the best. However it is a viable solution for small payloads. RE: Creating a launcher.. - Alien - Mar 25, 2020 (Mar 24, 2020 11:19 PM)StarZ Wrote: Old code yoinked from google. Mainly to show a basic example of the concept in question. Thank you for posting a better solution. 👍 Going to take a look at it soon. Thanks! 😎 i'll update everyone on the progress and where I'm at with the project tomorrow. Update: After getting a good night sleep I woke up and immediately got back on the project. The program is now fully functional and does everything I wanted/needed it to do. I will add this to Github soon and make a separate thread for this project so other's can learn from the code as well. |