Nax Posted October 31, 2011 Share Posted October 31, 2011 Sometimes, you have a .NET worm, keylogger or another virus. You'd like to crypt it, but can't afford a crypter? Here's the solution, build one yourself in 10 minutes! This little guide will teach you the basics :smile: Let's get started. Things that you'll need: C# Compiler (Visual Studio for example) Know a tiny little of the .NET language C# And all the obvious items, computer etc. Make a new Windows Forms Application (project). I assume you know how to make one =) Put a textbox on the form, and set the '(Name)' property to "txtLinkToFile": This is the hidden content, please Sign In or Sign Up Put two buttons on the form, and make it (kinda) look like this: This is the hidden content, please Sign In or Sign Up Now double click at the Browse button ( This is the hidden content, please Sign In or Sign Up ) Now we'll make an OpenFileDialog, to select the file that needs to be encrypted. Follow this little gif: This is the hidden content, please Sign In or Sign Up The code: This is the hidden content, please Sign In or Sign Up What it does, is make a new OpenFileDialog, open it, and checks if the user presses OK after selecting a file in the OpenFileDialog. If the user has pressed OK, the filename of the selected file will be in the textbox. Now double click the Crypt! button ( This is the hidden content, please Sign In or Sign Up ) We need to encrypt the data, and decrypt it when the program runs. So here's what we do: We take the RC4 function and paste it outside a void. The RC4 function: This is the hidden content, please Sign In or Sign Up Then we go back to the crypting button ("Crypt!") and make a ResourceWriter. The ResourceWriter will create a resource file for our project, which will contain the encrypted file. We do it like this: This is the hidden content, please Sign In or Sign Up So we make the ResourceWriter, read all the bytes of the file-to-be-encrypted, encrypt the bytes with our RC4 function, and add it as a resource! Then we close the ResourceWriter, which will (when closing) add the file to the resource-file. This is the hidden content, please Sign In or Sign Up How it should look like at this moment: This is the hidden content, please Sign In or Sign Up Next up is setting up the compiler parameters. Quite easy, follow the steps: We make a CompilerParameters' variable: This is the hidden content, please Sign In or Sign Up And we add these options: This is the hidden content, please Sign In or Sign Up GenerateExecutable => Makes sure it does not generate any DLL file. OutputAssembly => This is the path your executable will be generated (compiled) to. ReferencedAssemblied.Add => Adds the main DLL (System.dll). It's required to run the application (& compile it) EmbeddedResources.Add => Adds the resource to the executable when compiled with these parameters. So now we're done with the parameters, we add a source to the resources. Press CTRL+ALT+L to open up the Solution Explorer. Right click at your projects name and click at "Properties". From the tab at the left, choose "Resources": This is the hidden content, please Sign In or Sign Up Then click "Add Resource" and after that; "Add New Text File". This is the hidden content, please Sign In or Sign Up Enter the name "Source": This is the hidden content, please Sign In or Sign Up Then paste this code inside of it. If you need an explenation of what it does, feel free to leave a comment or PM me. This is the hidden content, please Sign In or Sign Up So now all is left to do, is compile the source! We do that with a CSharpCodeProvider, like this: This is the hidden content, please Sign In or Sign Up Then we delete the resources file: This is the hidden content, please Sign In or Sign Up After that, we check for any errors. We loop through all the errors and show a messagebox for each error. If there are no errors, it shows none, because it skips the for-each loop. This is the hidden content, please Sign In or Sign Up That's about it! So after this little tutorial, your source looks like this: This is the hidden content, please Sign In or Sign Up And here's a little video (P.S. I forgot to add the deletion-code of the generated resources file): This is the hidden content, please Sign In or Sign Up Extra thing: To disable the console window, make it a Windows Forms Application by specifieing the compiler-parameter "target". You add this parameter to the compileroptions: This is the hidden content, please Sign In or Sign Up For the ones who'd like to know: By setting the parameter /target (or /t) to "winexe", it changes the subsystem from 0x002 to 0x003 which is a non-console executable. However 0x002 is a console executable. (Check out This is the hidden content, please Sign In or Sign Up for the ones that like to know more about this) So your code would look like this: This is the hidden content, please Sign In or Sign Up Credits:CaptainBri Link to comment Share on other sites More sharing options...
Recommended Posts