Protect intelectual property in .NET code?

G

Guest

Hello

What is the best way (or does it exists a way at all) to protect WinForm
application
from decompiling IL.
Can it be full compiled yo windows native before distribution.

And what is best way for intelectual property algoritams and others in exe
code?

Thank you.
MilanB
 
G

Guest

Thank you

Any comment why Microsoft does not have own native compier for Windows?
 
L

Lloyd Dupont

Microsoft does rely a lot on 3rd parties to provide many non-essential
functionality.
Arguably the .NET linker is not essential to .NET application devlopment.

BTW there is a native linker, it's called ngen.
You could ngen your assembly on install.
But the whole point of .NET is to have MSIL code.
If I use salamender tool I'm sure I will obtain code compiled for this or
that processor, whereas MSIL is is processor independant, and the native
compilation is provided by the JIT and target the user's processor.
 
J

Jon Skeet [C# MVP]

Lloyd said:
Microsoft does rely a lot on 3rd parties to provide many non-essential
functionality.
Arguably the .NET linker is not essential to .NET application devlopment.

BTW there is a native linker, it's called ngen.
You could ngen your assembly on install.

That's not what most people are after from a native linker though. In
particular:

1) It doesn't try to hide the IL in any way, shape or form.
2) It doesn't remove the necessity of having the .NET framework
installed.

All it does is remove JIT costs, sometimes at the expense of other
optimisations.

Jon
 
L

Lloyd Dupont

BTW there is a native linker, it's called ngen.
That's not what most people are after from a native linker though. In
particular:

1) It doesn't try to hide the IL in any way, shape or form.
2) It doesn't remove the necessity of having the .NET framework
installed.

All it does is remove JIT costs, sometimes at the expense of other
optimisations.
Hu? "sometimes at the expense of other optimisations"?
Really?

I've read that it could slow down cold startup as native image are much
bigger
(hence more IO), but I'm otherwise surprised by your statment...
Could you elaborate a bit more perhaps? Just curious....
 
J

Jon Skeet [C# MVP]

Lloyd Dupont said:
Hu? "sometimes at the expense of other optimisations"?
Really?
Yes.

I've read that it could slow down cold startup as native image are much
bigger
(hence more IO), but I'm otherwise surprised by your statment...
Could you elaborate a bit more perhaps? Just curious....

Well, from the docs for Ngen in the MSDN for .NET 2.0:

<quote>
For long-running applications, run-time JIT compilation performs
slightly better than native images. (Hard binding can mitigate this
performance difference to some degree.)
</quote>

Jeffrey Richter talks a little bit about it at (watch for line-wrap):

http://www.codeguru.com/Csharp/.NET/net_general/toolsand3rdparty/articl
e.php/c4651

Junfeng Zhang then rebuts Jeffrey's points in
http://blogs.msdn.com/junfeng/archive/2004/03/27/97304.aspx
but does allow:

<quote>
And statistics shows, NGEN=3Fd file at worst performs 5-10% worse than
runtime jitter. And it has a big win in startup time since you don=3Ft
have to compile the IL assembly. I will certainly accept the very small
percentage runtime performance decrease, in trade of the startup
performance gain.
</quote>

(Interesting to note that Junfeng doesn't mention in which situations
he accepts that performance decrease. For a short-running desktop app,
that's reasonable. For a service, it's not really.)
 
L

Lloyd Dupont

good reading, thanks for your links.

Jon Skeet said:
Well, from the docs for Ngen in the MSDN for .NET 2.0:

<quote>
For long-running applications, run-time JIT compilation performs
slightly better than native images. (Hard binding can mitigate this
performance difference to some degree.)
</quote>

Jeffrey Richter talks a little bit about it at (watch for line-wrap):

http://www.codeguru.com/Csharp/.NET/net_general/toolsand3rdparty/articl
e.php/c4651

Junfeng Zhang then rebuts Jeffrey's points in
http://blogs.msdn.com/junfeng/archive/2004/03/27/97304.aspx
but does allow:

<quote>
And statistics shows, NGEN=3Fd file at worst performs 5-10% worse than
runtime jitter. And it has a big win in startup time since you don=3Ft
have to compile the IL assembly. I will certainly accept the very small
percentage runtime performance decrease, in trade of the startup
performance gain.
</quote>

(Interesting to note that Junfeng doesn't mention in which situations
he accepts that performance decrease. For a short-running desktop app,
that's reasonable. For a service, it's not really.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top