|
Do you want to make your programs with C# and also use of API functions?
|
|
|
|
|
It seems like the source code for most assemblies can be obtained through Lutz Roeder's Reflector or similar tool.
Therefore, if a company develops a new product in .NET, is there any way for the company to prevent another company from simply viewing the product assemblies through Reflector and obtaining the source code for themselves?
|
|
|
|
|
|
Member 3919049 wrote: Therefore, if a company develops a new product in .NET
... it is highly unlikely that they are in need of protecting said code.
led mike
|
|
|
|
|
|
Member 3919049 wrote: It seems like the source code for most assemblies can be obtained through Lutz Roeder's Reflector or similar tool.
You seem to misunderstand what reflector is doing (or what source code is).
Reflector does not give you the source code back. It shows you what the IL generated is and it can convert that IL into C# or VB.NET so it is easier to read. It does not, and cannot, give you back the original source code. The compiler will have made various optimisations and so reflector shows you those, because it does not know what the original was. It can only ever see what the final result is.
|
|
|
|
|
Colin Angus Mackay wrote: does not, and cannot, give you back the original source code
I have seen a plug-in for reflector which extracts the code into a file.
Colin Angus Mackay wrote: The compiler will have made various optimisations and so reflector shows you those, because it does not know what the original was. It can only ever see what the final result is.
I am not sure, but I think compiler won't make any changes to the source code. It generates equivalent IL and reflector is capable to show it in languages like C# , VB etc, Right ?
|
|
|
|
|
What Colin has said stands. It cannot return your original code. Sometimes the compiler optimizes your code in the compilation process, and a utility like Reflector returns you code based on the optimized version.
|
|
|
|
|
Although it isn't the exact original code,
the code generated by the Reflector can still reveal the business logic you have used.
So obfuscating could make it a little harder to understand what is going on.
codito ergo sum
|
|
|
|
|
It's new information for me. Can you tell me an example for the optimizations done ? I have checked our applications with reflector and can't find any changes in the code.
|
|
|
|
|
Do an If\then\else statement in VB like this:
Dim i As Integer = 3
If i = 1 Then
Console.WriteLine "1"
ElseIf i = 2 Then
Console.WriteLine "2"
ElseIf i = 3 Then
Console.WriteLine "3"
EndIf
You will most likely see that it gets shown to you in Reflector as a case statement.
Things like that...
|
|
|
|
|
Interesting. It shows case statement like
Select Case 3
Case 1
Console.WriteLine("1")
Exit Select
Case 2
Console.WriteLine("2")
Exit Select
Case 3
Console.WriteLine("3")
Exit Select
End Select Compiler changed the code. But the case statement generated looks bad, isn't it ? In this case why don't compiler generate something like Console.WriteLine("3") alone since it knows only 3 will be printed. I am just wondering
I tried slightly altered below code
Dim i As Integer = 3
If (i = 1) Then
Console.WriteLine("1")
ElseIf (i = 2) Then
Console.WriteLine("2")
ElseIf (i = 3) Then
Console.WriteLine("3")
Else
Console.WriteLine("none of them")
End If
Console.Read This will be compiled as it is. No changes are made.
Thanks for clearing doubt.
|
|
|
|
|
Remember though, the compiler did not really change the code, it just built the underlying IL in a way that when Reflector reversed it this is how it was structured.
Not sure if I agree that the case statement is worse or better than the if statement really although I question the real need for the Exit Select parts there.
If you change the if statement to take into account multiple conditions like this:
Dim i As Integer = 3
Dim test As Boolean = True
If (i=1) And (test = True) Then
You will see that Reflector keeps this as an If statement. Have not looked at the resulting IL closely but I just suspect that the IL for the first If is better (more efficient) coded as a case than an IF (maybe less tests?) and as you add conditions that efficiency looses it's value so it is built differently. I am not a compiler expert so I can't say for sure there.
|
|
|
|
|
The CodeProject occasionally gives out the Spices Obfuscator in the article competitions and it can be used to scramble the assembly to make it 'harder' for others to crack it.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
VS.Net ships with Dotfuscator Community Edition.
Look in your Tools menu.
|
|
|
|
|
Hi
Iam doing windows application using c#..
when i build the application...it's sucessfully build..
and run the application (Ctrl+f5) with out debugging mode..
it's giving error---
system.InvalidoperationException occured in .exe[3660].Just-in-time debuging exception failed..
but when i run the application in Debugging Mode F5 it's working Fine...
I think the problem is in my
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
mainform form = mainform.GetInstance();
Application.Run(form);
}
please give me solution where the exact problem is ?
murali krishna
|
|
|
|
|
Without knowing what are you doing in mainform we can't help.
|
|
|
|
|
hi there,
i developed a complex windows form application which contains a lot of controls (textbox, combobox). I use following code, when i've to change their text properties:
this.mytextbox.text = "smth";
considering that i've more than 50 textboxes and comboboxes, i'd like to know if there is another way to write down more efficient and structured code.
I was thinking about using a pattern (i remember to have read in codeproject something like that, but i still haven't found the article).
best regards.
|
|
|
|
|
hi
search in www.codersource.net [^]
u have to write a loop which iterates to all the controls in that form and according to your requirement change that control text .
|
|
|
|
|
hi all,
i developed one windows application which needs database interaction . now i want to deploy the application in the client system which dont have .net and database .
i know how to install .net framework component but which database component i want to install to run the database .im using sql 2005.
can u please explain me the procedure ...
thanks .
CSN
|
|
|
|
|
Depends on the app. The simplest thing I've found is to write an app that runs the installation scripts against the DB. You can also ship a DB backup and expect the user to restore it. I'm sure there are other ways, but the question is, how technical are your end users ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
First of all, is there any Sql server installed? Or which dbms are you using?
|
|
|
|
|
hi ,
thanks for ur reply . here in client system he dont have any database
i have to do all the things .
i dont know whether to install full version of sql server 2005 or sql server express 2005 . is sqlexpress2005 is sufficient ???
can u tell which is better one to do ..
thanks .
CSN
|
|
|
|
|
That depends on the client needs. You should check the differences between the express edition and the full version.
Also keep in mind that while the express edition is free, the full version is not. I never agree to install any pirated software to any client, it's not fair and you too could be held liable.
|
|
|
|
|
Im implementing a currency converter into an application of mine. The data i need to read from is stored in the file CurrRates.txt and is comma delimited. I am trying to set it up so that I open the file, read each line and send that line to an array, then read the next line etc, then closes the file.
As I am trying to learn all this ive spent ages looking for what is necessary, and so far all I have determined is that it usese FileStream. Ive spent along time trying to implement it but my knowledge is limited as, like i said, im still learning.
Any help would be appreciated.
|
|
|
|