Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 What is Reflector?

Author  Topic 

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-07-21 : 17:51:15
Can anyone explain what "Reflector for .NET" is, and how it's used?

Drew aka The Drewster

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-07-21 : 17:59:57
Perhaps you mean Reflection? If so, just google reflection and .net for information.

Tara Kizer
Go to Top of Page

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-07-21 : 18:21:48
Yeh, I think that's it... I had been directed to Lutz Roeders "Reflector for .Net" which appears to be related: http://www.aisto.com/roeder/dotnet/

I'd posted a topic earlier about programmatically calling a particular dialog box that SSMS uses. Someone had told me:
quote:

Simply refelctor the code and take this a a good starting point to built your own register diallog. Well you have to reflector the code of SSMS to find the appropiate parts. Find the Forms section within the assembly and see what is happening behind the scenes-


I'm intrigued now, and wonder if someone can clarify.

Drew aka The Drewster
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-07-21 : 19:27:52
Reflector is a tool every .net develper simply MUST have.
What it does is this:
you have a dll that is built in a .net language (VB.net, C#, VC++.net)
When compiled the dll is in the form of IL = Intermediate language.
see .net compilation is basically a 2 step process:
1. translate your written code into IL
2. Compile IL to lower level machine commands.

So what Reflector does it it acctualy translates the IL code that the dll is
made of to normal code you can read.

you simply load the dll right click on it and choose Disassembler.
you can also choose c# or VB.net as the language that the code is shown in.
To do this Reflector uses .net reflection.

If you need more data don't be shy to ask



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-07-22 : 16:33:51
Well that's unf#ckin-believable! I disassembled an executable I wrote earlier, and indeed there in front of me was all my code. It was better than that, it presented my code more elagently!

But this leads to more questions...

1. A product like SQL Server has loads of dlls, how do I know which dll is relevant to what I want to see the code to?

2. How do I prevent people from being able to disassemble my apps?

3. Why is it that many cannot be dissasembled, displaying a message such as, "Module 'C:\Program Files\Microsoft SQL Server\90\Tools\Bin\DdsShapes.dll' does not contain a CLI header.
"?

4. Is this not reverse engineering, thus illegal?

Drew aka The Drewster
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-07-22 : 16:50:45
>> How do I prevent people from being able to disassemble my apps?

There are third party apps that will "obfuscate" your code to make dissassebly (not sure that's techically the right sort of term these days!!) very hard indeed.

>> ... DdsShapes.dll' does not contain a CLI header

That particular DLL was probably NOT built using a CLI language - perhaps they actually wrote that one in assembler?

>> Is this not reverse engineering, thus illegal?

If reverse engineering is prohibited in the license, for the product you are using, then "Yes it is illegal"

But who's going to police that then, eh?

My IP lawyer always says "Safeguard your property, trying to enforce the law is much harder, and expensive"

Kristen
Go to Top of Page

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-07-22 : 17:06:50
quote:

>> ... DdsShapes.dll' does not contain a CLI header

That particular DLL was probably NOT built using a CLI language


You reckon? All the SQL Server 2005 dlls seem not to contain the header.

Drew aka The Drewster
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-07-23 : 08:36:37
To answer you questions:
1. I guess you could use Dependency walker tool that takes a normal non .net dll and displays it's
functions signatures and which dll's it references. but doing it this way is pain in the ass.

2. With .net you can't. Yes there are obfuscators but they just change the names of the function,
variables and values. At least i haven't come accross one that would make reflection impossible.

3. Reflection works only for DLL's that are built and compiled in .net languages
AFAIK SQL server isn't built in .net. Tt would be way to slow if it was.
.net is slow compared to "old" c++.

4. I don't think this could be called reverse engineering. It's use of .net language possibilities.
But i'm no legal expert.

Here's a little example of how could you "reverse engineer" some code.
I downloaded the SQL Prompt tool from Red gate. It's very cool tool
And it's also written in .net.

Look at its 3 dll's in Reflector for a while. and tell me if you could "reverse engineer" it.
Without a lot of work you can't. it's not that simple. and my guess is that their code is obfuscated.

Does that lift some fogs over .net?



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -