views:

135

answers:

1

I want to build an application being able to use .Net classes. If I go for C# I know that some tools like Refactor is able to reverse engineer the code (until I don't pay very expensive tools capable of avoiding this).

Do you know if the same applies when my application is developed in Visual C++ ( with /clr ). You can easily mix Managed Code with Unmanaged code calling directly all .Net classes I need.

Do you know if the result still can be reverse-engineered with Reflector?

What I really don't know is whether the final application is compiled as an ordinary binary (like unmanaged application) running directly on the CPU or if still some IL is generated with JIT on loading, so that can be reverse engineered?

+4  A: 

The answer is both. Methods that use CLR will be compiled as il, while methods that do not use clr will be compiled to native code. But the best answer for you will be to write some sample functions, compile the dll and open it in Refelctor.

Alex Reitbort
With `/clr:pure`, even functions that do not use CLR will be compiled to MSIL.
MSalters
Thanks! Just one more thing. Everything seems to boil to a unique solution: using .net as COM and all my code will be totally unmanaged C++.In this case does anyone knows if still IL is present and if the application might be more secure?
Abruzzo Forte e Gentile
The COM will be .Net and will be visible in reflector. The unmanaged c++ will be stay unmanaged c++.
Alex Reitbort
HI Alex. I don't get you. You are telling me that if I use a C++ client using unmanaged C++ COM classes, where .Net is the server (I hope to be right), still reflector can reverse engineer my code?I quote the MSDN section:"Exposing a Managed API as a COM APIEvery public managed class can be exposed to unmanaged clients through COM interop. This process is very easy to implement, because the COM interop layer takes care of all the COM plumbing. Thus, for example, every managed class appears to implement IUnknown, IDispatch, ISupportErrorInfo, and a few other standard COM interfaces."
Abruzzo Forte e Gentile
Not your code, the server (COM server that is written in .Net as I understood).
Alex Reitbort
The COM interop layer only deals with managed C++ (which can be decompiled with reflector). COM implemented in native C++ cannot be reversed with reflector and is also easy to use from .NET, however it is not nearly so easy to write.
Ben Voigt