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

.NET 

Button that generates a Form as an .exe

I'm working on a RAT.
I'm trying to create a generate stub button, but I'm not sure how to make it save the stub as an exe.
The stub is a regular form.
You can compile binaries by using codedom.
http://www.youtube.com/watch?v=qShN4TxMtU8
(Sep 16, 2013 08:48 AM)LijpeMD Wrote:  http://www.youtube.com/watch?v=qShN4TxMtU8

Like in the tutorial, should I put my form code in a .txt file?
(Sep 16, 2013 09:14 AM)Nills Wrote:  Like in the tutorial, should I put my form code in a .txt file?

He isn't putting his code in a .txt file..
But you should convert the code to VB.
(Sep 16, 2013 09:15 AM)LijpeMD Wrote:  He isn't putting his code in a .txt file..
But you should convert the code to VB.

Ohhh sorry I watched another one.

Anyways, this is my code after converting it:

Code
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  Dim provider As CodeDomProvider = CodeDomProvider.CreateProvider("VisualBasic")
  Dim settings As New CompilerParameters
  Dim results = New CompilerResults(Nothing)
  settings.GenerateExecutable = True
  settings.OutputAssembly = "Stub"
  settings.CompilerOptions = "/target:winexe"
  settings.TreatWarningsAsErrors = False

  settings.ReferencedAssemblies.Add("system.dll")

    End Sub

It doesn't do anything though.
Because it shouldn't do anything since you haven't added that to the code yet.
I think you should add a SaveFileDialog and then save the code which is generated.
(Sep 16, 2013 09:27 AM)LijpeMD Wrote:  Because it shouldn't do anything since you haven't added that to the code yet.
I think you should add a SaveFileDialog and then save the code which is generated.

I know about SaveFileDialog but what would I put?
To be honest I have no experience with CodeDom so someone correct me if I'm wrong.

I think you should save: Dim results = New CompilerResults(Nothing)

For example: Save(results)
(Sep 16, 2013 09:31 AM)LijpeMD Wrote:  To be honest I have no experience with CodeDom so someone correct me if I'm wrong.

I think you should save: Dim results = New CompilerResults(Nothing)

For example: Save(results)

Thank you for your help, I'll try it soon.
https://hackforums.net/showthread.php?tid=2512583
(Sep 16, 2013 09:35 AM)Nills Wrote:  Thank you for your help, I'll try it soon.

This is my code, I copied the SaveFileDialog from another thing I had.

Code
Dim provider As CodeDomProvider = CodeDomProvider.CreateProvider("VisualBasic")
  Dim settings As New CompilerParameters
  Dim results = New CompilerResults(Nothing)
  Dim save = New SaveFileDialog()
  settings.GenerateExecutable = True
  settings.OutputAssembly = "Stub"
  settings.CompilerOptions = "/target:winexe"
  settings.TreatWarningsAsErrors = False

  settings.ReferencedAssemblies.Add("system.dll")
  Dim OutputFile As String
  Dim sfd As New SaveFileDialog
  sfd.Filter = "*.exe | *.exe"
  If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then
    OutputFile = sfd.FileName

  Else() : Exit Sub
  End If

I don't know what to put here so it saves the file

Code
If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then
    OutputFile = sfd.FileName

  Else() : Exit Sub
OutputFile = sfd.result

?

- version
(Sep 16, 2013 10:36 AM)LijpeMD Wrote:  OutputFile = sfd.result

?

- version

There is no result.
And all the tutorials that has been posted in this thread doesn't show how to save it as an .exe


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by wastedcodeineOct 18, 2021 09:04 PM 3 155 Oct 18, 2021 09:04 PM
Last Post: AndroidiOSGameHacks
[Shell] by ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™May 11, 2020 12:50 PM 2 223 May 11, 2020 12:50 PM
Last Post: Exalted
[.NET] by christophertavaraFeb 7, 2019 12:26 PM 4 268 Feb 7, 2019 12:26 PM
Last Post: SaketSaket