![]() |
|
[.NET] Application That Doesn't Open a Form on Load - 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] Application That Doesn't Open a Form on Load (/showthread.php?tid=5634799) Pages: Pages
1
2
|
Application That Doesn't Open a Form on Load - AvengeDev - May 29, 2017 Wondering how I would go about creating an application that doesn't load any form designer thingy. I just want it to run the code and create it's own process and that's it. Thanks :)! * - _UnderDog - May 29, 2017 I'm sure there is a more professional way but I find that if you set the form features to 0% opacity with the minimum possible size and start-minimised (with show in taskbar, etc. disabled) works fine. * - Ninja - May 29, 2017 Make a console application and make the window style hidden is all I can think off. * - AvengeDev - May 29, 2017 (May 29, 2017 08:48 PM)_UnderDog Wrote: I'm sure there is a more professional way but I find that if you set the form features to 0% opacity with the minimum possible size and start-minimised (with show in taskbar, etc. disabled) works fine.Worked perfectly, thank you :) * - Rhez - May 30, 2017 (May 29, 2017 11:18 PM)AvengeDev Wrote: Worked perfectly, thank you :) Oh? But the better answer was given by Ninja? * - _UnderDog - May 30, 2017 (May 30, 2017 02:24 AM)Rhez Wrote: Oh? But the better answer was given by Ninja? I agree but i suppose it's easier to learn for starters that don't yet know console applications? Maybe there's features that need to run in the background that don't work the same in a console application, for example a while back i coded my first rat i needed a hidden window for features work more smoothly considering i was a beginner (still am tbh 😝 ) * - AvengeDev - May 30, 2017 (May 30, 2017 02:24 AM)Rhez Wrote: Oh? But the better answer was given by Ninja?The console application method was messing with my code and giving me errors. It may be clunky but the other method worked for me. * - Ninja - May 30, 2017 (May 30, 2017 07:15 AM)AvengeDev Wrote: The console application method was messing with my code and giving me errors. It may be clunky but the other method worked for me. Probably because by default the Console application doesn't have certain references such as System.Drawing. (May 30, 2017 06:27 AM)_UnderDog Wrote: I agree but i suppose it's easier to learn for starters that don't yet know console applications? Maybe there's features that need to run in the background that don't work the same in a console application, for example a while back i coded my first rat i needed a hidden window for features work more smoothly considering i was a beginner (still am tbh 😝 ) There are very few things that don't work properly in a console application. Theoretically you can do anything from a console application as a windows forms application. However, you are right; the webbrowser component for example just doesn't work properly in a console application while running in the background. * - Washi - May 30, 2017 Uh, why not just create a console app and then set the application type to Windows Forms Application?: ![]() Or am I misunderstanding the question completely? 😧 * - Ninja - May 30, 2017 (May 30, 2017 12:35 PM)Washi Wrote: Uh, why not just create a console app and then set the application type to Windows Forms Application?: He wants a process without GUI or anything that can be interacted with running, I think. So basically a headless, windowless, consoleless, etc. process. * - AvengeDev - May 30, 2017 (May 30, 2017 07:48 PM)Ninja Wrote: He wants a process without GUI or anything that can be interacted with running, I think.Correct, I have figured this out now so thanks everyone for the replies 🤝 * - Washi - May 31, 2017 (May 30, 2017 07:48 PM)Ninja Wrote: He wants a process without GUI or anything that can be interacted with running, I think. Isn't that exactly what I suggested? I'm not even creating a window/form and the console window is not displayed either if you set the application type like in the screenshot 😧. * - AmericanExpress - May 31, 2017 If you would like to have a program which has absolutely no window (no GUI) then the best way to do this would be through having a native application; by native I am referring to a program which uses no APIs from the Win32 API (only the Native API). This means that ntdll.dll will still be present although DLLs like user32.dll (responsible for GDI functions and the driver win32k.sys exports the kernel-mode version of the GDI functions) and kernel32.dll will not be present. However you cannot make a native application in the .NET framework therefore you may as well do something like below: - Change the opacity and other properties as mentioned above. - Upon execution of your program you can spawn a duplicate instance through dynamic forking of a legitimate Windows process which is not already running and is not obvious (e.g. don't do it on a program like taskmgr.exe or notepad.exe since that would be suspicious). - When the program is executed within your Load event you can check the file path the program is executing from. If it believes it is running from the path of the Windows folder then do whatever you need to do, if not go to #2 and do the dynamic forking. The above would be the most ideal solution for you to conceal your code execution without raising eye brows or native related content such as API hooking (e.g. to hide the presence of a process). Gl :) (May 30, 2017 09:52 AM)Ninja Wrote: However, you are right; the webbrowser component for example just doesn't work properly in a console application while running in the background.He is right about the web browser component not working properly in a console application (due to no support for Windows control components which are brought to us by GDI functions exported by user32.dll -> win32k.sys), although you can still make use of the Win32 API to perform networking related activity. Therefore, you can still P/Invoke functions like URLDownloadToFile (and other similar web-request based functions exported by urlmon.dll). So as long as OP already has code execution so he can spawn another program with a hidden window then your suggestion about using a console application would work fine also. Unless he needed the program to be ran by the user, in that case the best method for a VB/C# based program would be to just use a normal Windows Forms Application and then change opacity/taskbar properties and the such. * - AvengeDev - May 31, 2017 (May 31, 2017 08:31 AM)Washi Wrote: Isn't that exactly what I suggested? I'm not even creating a window/form and the console window is not displayed either if you set the application type like in the screenshot 😧.It is, but the console app doesn't fit my needs as far as coding itself goes. * - Ninja - May 31, 2017 (May 31, 2017 08:31 AM)Washi Wrote: Isn't that exactly what I suggested? I'm not even creating a window/form and the console window is not displayed either if you set the application type like in the screenshot 😧. Oh I didn't know that, I thought you meant something else. Now that I think of it, it makes total sense. My bad. |