Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked [C#] Make a crypter to crypt .NET files


Nax

Recommended Posts

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

 

Put two buttons on the form, and make it (kinda) look like this:

 

This is the hidden content, please

 

Now double click at the Browse button (

This is the hidden content, please
)

 

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

The code:

This is the hidden content, please

 

 

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
)

 

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

 

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

 

 

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

 

How it should look like at this moment:

 

This is the hidden content, please

 

Next up is setting up the compiler parameters. Quite easy, follow the steps:

 

We make a CompilerParameters' variable:

 

This is the hidden content, please

 

And we add these options:

 

This is the hidden content, please

 

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

 

Then click "Add Resource" and after that; "Add New Text File".

 

This is the hidden content, please

 

Enter the name "Source":

 

This is the hidden content, please

 

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

 

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

 

Then we delete the resources file:

 

This is the hidden content, please

 

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

 

 

That's about it! So after this little tutorial, your source looks like this:

 

This is the hidden content, please

 

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

 

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

 

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
for the ones that like to know more about this)

 

So your code would look like this:

This is the hidden content, please

Credits:CaptainBri

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.