none
How to compile my C# app to x86 assembly instead of common language RRS feed

  • Question

  • Hi,

        I want to compile my application into assembly instead of common language, so it will not be easy to reflect the code (disassemble)

    How to do that?

    Wednesday, February 13, 2013 9:45 AM

Answers

  • AFAIK there is no C# compiler that can produce x86 directly. There are tools, such as this one, which can produce x86 code from .NET assemblies. There are other more traditional obfuscators out there as well that might provide what you need without resorting to x86 code generation.

    Wednesday, February 13, 2013 5:47 PM

All replies

  • AFAIK there is no C# compiler that can produce x86 directly. There are tools, such as this one, which can produce x86 code from .NET assemblies. There are other more traditional obfuscators out there as well that might provide what you need without resorting to x86 code generation.

    Wednesday, February 13, 2013 5:47 PM
  • Hi Markos,

    Welcome to the MSDN Forum.

    Based on your description, you just need one more step on your exe assembly:

    http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.110).aspx

    The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead of using the just-in-time (JIT) compiler to compile the original assembly.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 14, 2013 9:00 AM
    Moderator
  • Dear Mike,

       sound good, the question is, when I generate the images, how I install them in the target clients machines (windows)?

    I mean, I want to take only the bin files (without JIT) and install only those files ... so client will have "old fashion native binary files".

    Is there any article explain how to do that?

    Thursday, February 14, 2013 9:18 AM
  • Dear Mike,

       sound good, the question is, when I generate the images, how I install them in the target clients machines (windows)?

    I mean, I want to take only the bin files (without JIT) and install only those files ... so client will have "old fashion native binary files".

    Is there any article explain how to do that?

    the info in the link do't say anything, for example how to do that for .Net library (dll)?

    where the output will be?

    can I do that in my windows machine before install in others?

    Seems like all above questions are not so it is not useful.

    • Edited by Markos_King Thursday, February 14, 2013 9:27 AM
    Thursday, February 14, 2013 9:19 AM
  • Hi Markos,

    >>can I do that in my windows machine before install in others?

    That tool should be run on target machine since it will generate the native code with the native system and CPU platform.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 14, 2013 9:38 AM
    Moderator
  • this mean it is useless for my needs!

    I wand to .net application to be converted to binary files in advanced before send to clients, so no one will be easily disassemble it. As it was done before .Net , it does not make science why I can't compile my app to x86 binary file in advanced!!!!

    Thursday, February 14, 2013 9:46 AM
  • The link in dekurver's post takes you to the only tool that does what you want.  Everything else requires that the .NET framework be installed on the target machine.
    Thursday, February 14, 2013 10:33 AM