newuser
newuser

Reputation: 27

I tried to view .NET BCL libraries with .NET reflector, but it does not show any symbols

It show only defination of function inside the class . For egs. I open Read function but it shows only definition like

public override int Read([In,Out], byte buffer[], int offset,int count)

But .Net reflector shows everything about my .dll file including logic.

Please help i want to hide my logic like microsoft .dll files

Upvotes: 1

Views: 195

Answers (2)

Glenn Ferrie
Glenn Ferrie

Reputation: 10410

This is what the source code from the BCL looks like for that method:

 public virtual int Read(byte[] buffer, int index, int count) {
        if (buffer==null)
            throw new ArgumentNullException("buffer", Environment.GetResourceString("ArgumentNull_Buffer"));
        if (index < 0)
            throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
        if (count < 0)
            throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
        if (buffer.Length - index < count)
            throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));

        if (m_stream==null) __Error.FileNotOpen();
        return m_stream.Read(buffer, index, count);
    }

I think you'll need to dig deeper into the source code to find what you're looking for.

Happy Hunting!

BCL source code: https://www.microsoft.com/en-us/download/details.aspx?id=4917

Upvotes: 0

Rohit Vipin Mathews
Rohit Vipin Mathews

Reputation: 11787

You can't prevent a managed-DLL from being opened in a decompiler, all what you can do is to obfuscate it. You can use tools like Dotfuscator to obfuscate your code.

From the official site

Dotfuscator provides all “normal” obfuscation methodologies in addition to many unique ones. No obfuscation technology is 100 percent secure. As with other obfuscators, Dotfuscator makes life more difficult for decompilers and disassemblers; it does not claim 100 percent protection.

A few things it accomplishes are :

  • Identifier Renaming
  • Control Flow Obfuscation
  • User String Encryption
  • Watermarking
  • Tamper Notification and Runtime Intelligence with SO-signal

Upvotes: 4

Related Questions