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

.NET 

Program FUD if compiled in Visual Studio but 11/59 if compile via codedom.

As the title says my program is FUD if I compile it via visual studio but if I compile via codedom the detections jumps from 0 to 11. Some shitty AVs detect my file as a Gen:Heur.MSIL.Agent.17. I'm using the same icon and assembly infos for both executables. The code is also the same.
I think it's due to the codedom code, since it's used commonly it'll detect it as fishy.
I tried to decompile my executables (codedom e non codedom) and looks like that codedom does not add resources and similar things. I need a obufuscator that can obuscate the .vb file... maybe this will solve my problem.
(Mar 9, 2015 09:49 AM)Moon Rock Wrote:  I think it's due to the codedom code, since it's used commonly it'll detect it as fishy.

Ah yes, it seems like you have no idea what you are talking about.

When compiling with VS it adds other flags as well as compiler options when compiling. CodeDom doesn't. You need to specify them yourself.
(Mar 9, 2015 10:41 AM)tweety Wrote:  Ah yes, it seems like you have no idea what you are talking about.

When compiling with VS it adds other flags as well as compiler options when compiling. CodeDom doesn't. You need to specify them yourself.

Can you help me whit this? This is my codedom compiler:

Code
Public Sub Compile(ByVal Output As String, ByVal Source As String, ByVal DotNet2 As Boolean)
      On Error Resume Next
      Dim Compiler As ICodeCompiler = (New VBCodeProvider).CreateCompiler()
      Dim Parameters As New CompilerParameters()
      Dim cResults As CompilerResults
      Parameters.GenerateExecutable = True
      Parameters.OutputAssembly = Output
      Parameters.ReferencedAssemblies.Add("System.dll")
      Parameters.ReferencedAssemblies.Add("System.Data.dll")
      Parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")
      Parameters.CompilerOptions &= " /target:winexe /win32icon:" & ICO
      Dim Version = New Dictionary(Of String, String)
      If DotNet2 = True Then
      Version.Add("CompilerVersion", "v2.0")
      Else
      Version.Add("CompilerVersion", "v4.0")
      End If
      cResults = Compiler.CompileAssemblyFromSource(Parameters, Stub)
      If cResults.Errors.Count > 0 Then
      For Each CompilerError In cResults.Errors
      Console.BackgroundColor = ConsoleColor.White
      Console.ForegroundColor = ConsoleColor.Red
      Console.WriteLine(CompilerError.ErrorText)
      Next
      ElseIf cResults.Errors.Count = 0 Then

      End If
    End Sub
End Module
(Mar 9, 2015 10:58 AM)SIM-2071734 Wrote:  Can you help me whit this? This is my codedom compiler:

Code
Public Sub Compile(ByVal Output As String, ByVal Source As String, ByVal DotNet2 As Boolean)
      On Error Resume Next
      Dim Compiler As ICodeCompiler = (New VBCodeProvider).CreateCompiler()
      Dim Parameters As New CompilerParameters()
      Dim cResults As CompilerResults
      Parameters.GenerateExecutable = True
      Parameters.OutputAssembly = Output
      Parameters.ReferencedAssemblies.Add("System.dll")
      Parameters.ReferencedAssemblies.Add("System.Data.dll")
      Parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")
      Parameters.CompilerOptions &= " /target:winexe /win32icon:" & ICO
      Dim Version = New Dictionary(Of String, String)
      If DotNet2 = True Then
      Version.Add("CompilerVersion", "v2.0")
      Else
      Version.Add("CompilerVersion", "v4.0")
      End If
      cResults = Compiler.CompileAssemblyFromSource(Parameters, Stub)
      If cResults.Errors.Count > 0 Then
      For Each CompilerError In cResults.Errors
      Console.BackgroundColor = ConsoleColor.White
      Console.ForegroundColor = ConsoleColor.Red
      Console.WriteLine(CompilerError.ErrorText)
      Next
      ElseIf cResults.Errors.Count = 0 Then

      End If
    End Sub
End Module

Ah yes there's your problem right there, "On Error Resume Next". Remove it and never use it again, also helps if you dont C&P code :D
I'm not copying anything... why I should remove "On Error Resume Next"? It's for debug propouses... sometimes I rename the icon, in this way the compiler does not crash.
(Mar 9, 2015 02:54 PM)SIM-2071734 Wrote:  I'm not copying anything... why I should remove "On Error Resume Next"? It's for debug propouses... sometimes I rename the icon, in this way the compiler does not crash.

If that's all you're using it for then why not use a Try Catch and display the exception so you can actually see whats going wrong?
OK now i'm using Try(s) to preventiva crashes. BTW can someone help me or send me a tutoral/mdsn wiki page whit all the flagas/options forma codedom?

I'm on my phone atm
All you need to know is available here :

https://msdn.microsoft.com/en-us/library....100).aspx

You must click on the links and read the contents ... we unfortunately can't do it for you....
The first step in the development of a project is to read resources before coding ;)
Visual studio also compiles with vbc.exe. So, the question you must ask yourself is what are the differences in my file compiled in the IDE and with codedom and how do I find them. If you decompile both apps using a combination of Reflector and Ildasm and the compare utility for notepad++ you should be able to find all the differences between your 2 files, then figure out how to make codedom compile with the same settings.

This will probably take you a few hours but you will learn a lot and you can create a nice dynamic generation of your binary without the issues you are having.
(Mar 11, 2015 06:33 AM)jessman420 Wrote:  Visual studio also compiles with vbc.exe. So, the question you must ask yourself is what are the differences in my file compiled in the IDE and with codedom and how do I find them. If you decompile both apps using a combination of Reflector and Ildasm and the compare utility for notepad++ you should be able to find all the differences between your 2 files, then figure out how to make codedom compile with the same settings.

This will probably take you a few hours but you will learn a lot and you can create a nice dynamic generation of your binary without the issues you are having.
By adding some System.* libs i got it 6/59 ty :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by brokenheartsJun 30, 2025 01:05 AM 29 1,076 Jun 30, 2025 01:05 AM
Last Post: HOMODIN
[Tutorial] by WhiteTVFeb 17, 2025 08:25 AM 0 112 Feb 17, 2025 08:25 AM
Last Post: WhiteTV
by HackersDec 11, 2024 05:11 PM 21 524 Dec 11, 2024 05:11 PM
Last Post: padrino