|
Hi,
I just found (and disapointed a bit) that after developing a huge app i used "Lutz Roeder's Reflector" to watch my app hierarchy just for fun and realised that all the source code was in the Disassembler panel, just the way i writed it, including private methods, i mean all!. Hey! What if my app is commercial software? then i'm giving it for free (the whole source code included).
Is there a way to protect my code from being watch, crack or reverse engineered? I'm kind of lost.
Thanx a LOT!
|
|
|
|
|
C# applications have this problem of transparent code. You can try using an Obfuscator (one is supplied with Visual Studio itself) but it will solve the problem only partially. As of today, there does not appear to be a perfect solution for this problem. While you can make it more difficult for others to see your code or to reverse engineer it, but unfortuately there does not appear to be a perfect solution which could stop it absolutely.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Whow! It seems like a huge bug in the C# specification.
1) Whose this bug: C# or .NET Framework?
2) Does this happens in VB. NET?
3) Does this happens in C++ (native, not .NET)
4) Is C# 2.0 going to solve this issue?
Thanx for your comment Ashok.
I've got a lot of .NET commercial apps, i'll rip and steal lots of hard to write code....hehehe, no just kiding, i could but i wont. I disagree with ilegal stuff, that's why i posted this thread.
Anyone else has something to say about this issue?
|
|
|
|
|
Heinz Suez wrote:
Whow! It seems like a huge bug in the C# specification.
It is not a bug but a deliberate design because the .NET applications are not compiled to native code but to the intermediate language code (called MSIL). This MSIL code is then compiled to the native code at the time when the user runs the program by using what is known as Just-in-time compilation. It is this MSIL code which is converted by "Lutz Roeder's Reflector" or ILDASM (supplied with Visual Studio) to show legible code.
Heinz Suez wrote:
1) Whose this bug: C# or .NET Framework?
2) Does this happens in VB. NET?
This problem is with .NET framework, so the code written in VB .NET can also be seen in a similar manner.
Heinz Suez wrote:
3) Does this happens in C++ (native, not .NET)
No, it does not happen in C++ native code. But, C++ .NET will have the same problem.
Heinz Suez wrote:
4) Is C# 2.0 going to solve this issue?
In the Beta version available for C# 2.0 as of today, this problem exists. One does not know about the final C# 2.0 product but the chances are that this problem is not being solved even in that.
Hope it answers your question.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
This is not a problem or a bug with either the C# language spec or the .NET Framework. It is an unfortunate side-effect of having some of the functionality that we enjoy in the .NET Framework, like Reflection.
This "problem" will not be fixed in the .NET Framework 2.0 either. You use use Obfuscators to make i tharder to read the dissassembled code, but this doesn't hide everything. Public methods, fields, and whatnot can't be obfuscated because, well, you can't change the names of these items without making the public items very confusing to use.
It's possible, with 3rd party tools, to compile the C# code to native code, but they also have their problems with portability, supportability, features that depend on reflection, and don't forget the cost of those tools.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Heinz Suez wrote:
huge bug in the C# specification
It's not a bug, if you want the advantages of managed code (reflection, JIT, typesafe..), you need to generate code at a higher level than machine language and any such language is easier to disassemble.
Heinz Suez wrote:
1) Whose this bug: C# or .NET Framework?
2) Does this happens in VB. NET?
Yes, all compilers that generate managed code will result in your "problem".
Heinz Suez wrote:
Does this happens in C++ (native, not .NET)
Native C++ compiler generates machine code. If you can disassemble machine code, then yes, there is a "problem" there too.
Heinz Suez wrote:
4) Is C# 2.0 going to solve this issue?
No.
Heinz Suez wrote:
Anyone else has something to say about this issue?
If you have code that you don't want to be emitted in IL (and therefore disassembled), write that code in native C++ and use managed C++ to wrap it.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Known solution for your issue is already given by Ashok. Based on definision,
'Obfuscation refers to the deliberate act of nondestructively changing either the source code of a computer program or machine code when the program is in some compiled or binary form, so that it is not easy to understand or read'
So once you apply this techinics in your source, it is very tough to read or understnd the flow of source or ideas invloved in it. Because it will rename with non identifiable string.
You can have a look at the give url also. Hope this will give you some more ideas in Obfuscation.Obfuscation[^]
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I have seen this so much it makes me sad. Do you really care if the person sees how you assign text to a Label? Hell NO! If you have propriety algorhytms, invest in a decent obfuscator/encrypter (not the crap u get for free), or hire a person that can code in C/C++, or learn yourself how to do it.
Now secondly, even if someone reconstructes the source code, if your application is so big, dont you think it will take quite a few man hours to figure it out, learn what the code does? I doubt anyone will bother, would be easier just to buy the application.
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
Ok, thanx to all for your answer....ok, ok, i understand, it's not a problem it's a feature. But that feature makes my commercial projects in open source projects. I'll try to obsfucate my code or try native C++.
|
|
|
|
|
I just want to make it clear that there is no way, whatsoever, to completely protect your code from being reverse engineered. If code can be executed, it can be reversed. It does not matter whether it's written in .NET, native C++, VB, COBOL, or any other language.
I know it's a rather sobering fact, but it's one that all developers of commercial software need to realize. What you should do is worry less about this and try to focus on realistic security goals. You can't stop reverse engineering, but you can make it as boring and annoying as possible. Go ahead and use obfuscators/encryptors/packers, but make sure that they do not negatively affect the user experience. Test your app thoroughly after being protected. If you provide a trial or demo of your app, do no include full functionality. I don't mean disable some functions here. I mean don't include them at all. Disabled code can be enabled again. Finally, if you have some licensing or registration scheme, accept that pirates will be able to reverse it and shoot for simply trying to keep your users honest. If you are ambitious and have a significant amount of time, have your licensing use strong encryption implemented correctly. You can also use things like watermarks to track pirated copies of your software.
Basically, what you ask is impossible, but do your best and don't panic.
|
|
|
|
|
Hai,
I am having following queries regarding to C#.Please clear my Queries
1) Is C# fully dependendent of DotNet. With out dotnet C# don't have any existance?
2)Without using dotnet frame work's compiler can we compile a C# program.Any other compiler is there to compile a C# program.
3) Can we write stand alone programs in C# and compile?
4)Can we develop any application using C# alone in notepad editor and without using dotnet(including dotnet frame work)
5) What is the compiler compiles C# program in dotnet frame work?
Please give me a clear view in this.
Thank You,
Rahul.P.Menon.
SoftwareDeveloper(.NET)
|
|
|
|
|
As i know, C# runs in other frameworks rather MS .NET like: Mono, GTK#. C# is framework dependant (i think that's why we call it managed code, there's a lot of undercode, correct me if i'm wrong).If you have one of the above frameworks you can surely write apps in notepad.
That's all i can say for now (not too much).
|
|
|
|
|
Hello
Rahul.P.Menon wrote:
1) Is C# fully dependendent of DotNet. With out dotnet C# don't have any existance?
Is it possible to produce eggs without chickens ? No.
C# is a .NET language, so any program written on C# requires .NET framework.
Rahul.P.Menon wrote:
2)Without using dotnet frame work's compiler can we compile a C# program.Any other compiler is there to compile a C# program.
You can try to look on Mono[^] project, which allows you to write C# application on Linux and Windows too.
Rahul.P.Menon wrote:
3) Can we write stand alone programs in C# and compile?
Do you mean which does not require .NET framework ? No again.
Rahul.P.Menon wrote:
4)Can we develop any application using C# alone in notepad editor and without using dotnet(including dotnet frame work)
You can write your application in any editor, even in notepad if you are masochist. But, no, you will not be able to compile it without .NET Framework.
Rahul.P.Menon wrote:
5) What is the compiler compiles C# program in dotnet frame work?
csc.exe
With best regards,
Andrew
|
|
|
|
|
Hai,
Thanks much for the valuable information. But it really seems bad for powerful language like C# always depend on dotnet frame work.
Thank you,
Rahul.P.Menon
SoftwareDeveloper(.NET)
|
|
|
|
|
Rahul.P.Menon wrote:
But it really seems bad for powerful language like C# always depend on dotnet frame work.
Why?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Rahul,
Your statement is roughly analagous to saying:
"It seems bad for this lovely suede bucket seat to depend upon an engine, steering wheel, suspension, wheels, chassis and drive train to get around." Without the mechanical parts, there is no car no matter how lovely and soft the seat is (provided your last name isn't Flintstone).
The language is a tool for combining and expressing the contents of the framework in interesting or useful ways (or in completely boring or silly ways - makes no difference). It might be considered nothing more than a convenience or abstraction to save developers the time it would take to write IL directly, and that's really all it amounts to - semantic games to keep developers working and off Prozac.
Without the framework, C# or any of the other .Net languages would have little of the power they now offer in terms of rapid development. They would lack (among other things) a type system and a runtime environment - CLR and CTS are both considered parts of the framework. For giggles, imagine coding an application without any of the types in mscorlib.dll some time.
It might be easier to think in framework-centric terms. The framework is the necessary part of any managed code solution; the language is the variable/disposable part - it matters least.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hai,
Whatever you told is right.If a car engine is specific for particular wheel or a particular chasis or steering how we can say that we can depend on that car engine.If the car engine functions independendent of other things , a person can use accessories he like.
C++,VB,Java are using independantly to develop stand applications. Like that why C# alone is not using to develop applications.But C# is using with dotnet to develop application.
If the csc.exe compiler can compile C# program ,Can it use alone to develop applications.
I know using dotnet tool it is easy and rapid to make applications.So developing application without tool is out of scope and not necessary.Only because of this C# is not trying to use alone.
Because of my anxiety I raised these queries,so that I can correct my wrong I deas and aquire much information.Thank you very much for all the help and information provided.
Thank You,
Rahul.P.Menon
SoftwareDeveloper(.NET)
|
|
|
|
|
Rahul.P.Menon wrote:
C++,VB,Java are using independantly to develop stand applications.
Each of these is no different than C# or VB.NET or Managed C++.
Wrong. They all have their own run-time environments. Java is the closest cousin to the .NET Framework. The compilers for C++, C#, and VB.NET are built into the .NET Framework, exctly like Java's compiler is built into it's framework environment.
C# is just as "stand alone" as anything else...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It is powerful because it DOES depend on the .NET framework, as do C++.NET and VB.NET. Java depends just as greatly on the JRE, the only difference is terminology.
VB6 might be just a little more independent, but you could say that it depends on the Windows framework (system DLLs), they just happen to come with the operating system.
I can write a program in PowerBuilder 9 and compile it, but I must make sure the user has PBVM90.DLL and LIBJCC.DLL on the path for that executable. And if I want use Datawindows, PBDWE90.DLL. And if I want to use an ODBC database, PBODB90.DLL and PBODB90.INI. (The list goes on...) Those are PowerBuilder's "framework", although they don't call it that.
The advantage with C# (and C++ and VB) .NET is that you (the developer) don't have to worry about the framework being on the path, windows handles that for you. The user can install the .NET framework from the web, and you can just give them your EXE file. (Or whatever you developed).
Perhaps you are confused about the difference between the .NET framework and Visual Studio .NET? Your users don't have to have Visual Studio, they only need the .NET runtime, which is freely downloadable from Micorsoft.com.
|
|
|
|
|
look at the lines:
double x = double.MaxValue;
double y = double.MaxValue;
double what = (x+y)-y;
if c# select the double operator+(double,double), then what should be "PositiveInfinity"; but it is double.MaxValue!
Why does this happen? Is there a
decimal operator + (double,double)?
If there is, then there should be no " double operator +(double,double)".
Who knows the fact? Please help. Thanks.
|
|
|
|
|
I think that the compiler optimizes x+y-y to x.
---
b { font-weight: normal; }
|
|
|
|
|
nope.
(x+y)-y got the same result.
|
|
|
|
|
Here is the compiled code:
x = double.MaxValue;<br />
<br />
00000020 mov dword ptr [ebp-10h],0FFFFFFFFh<br />
00000027 mov dword ptr [ebp-0Ch],7FEFFFFFh<br />
<br />
y = double.MaxValue;<br />
<br />
0000002e mov dword ptr [ebp-18h],0FFFFFFFFh<br />
00000035 mov dword ptr [ebp-14h],7FEFFFFFh<br />
<br />
z = x + y - y;<br />
<br />
0000003c fld qword ptr [ebp-10h]<br />
0000003f fadd qword ptr [ebp-18h]<br />
00000042 fsub qword ptr [ebp-18h]<br />
00000045 fstp qword ptr [ebp-20h]
The actual calculation is done in the FPU, storing the result of the first calculation internally. It looks like the datatype used internally can handle larger values than a double, as the result of the calculation is correct.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I have a windows form application that works well in my computer in debug and release modes from IDE and windows explorer. I do XCOPY deployment on other computer. When I run the applicaiton there, it gives System.TypeInitialization exception.
As expected, this exception is thrown when I call a class with only public static variables...no constructors, propterties and methods.
How can I solve this issue?? Please help me
Cheers
CNU
|
|
|
|
|
This may seem stupid, but it's the most common mistake with XCOPY deployment. Did you make sure you copied all the .DLL files in the bin folder to the applications deployment folder? Did you reference some other assembly that's registered in the GAC on the development machine, but is not deployed to the target machine?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|