devxlogo

Reverse Engineer .NET DLLs

If you’ve ever wanted to know how something in the .NET Framework does what it does, check out .NET Reflector. This awesome utility will reverse engineer compiled .NET dlls back into C# or VB.NET code. The example below is the reverse-engineered implementation for String.GetHashCode:

public override unsafe int GetHashCode(){      fixed (char* text1 = ((char*) this))      {            char* chPtr1 = text1;            int num1 = 0x15051505;            int num2 = num1;            int* numPtr1 = (int*) chPtr1;            for (int num3 = this.Length; num3 > 0; num3 -= 4)            {                  num1 = (((num1 << 5) + num1) + (num1 >≫ 0x1b)) ^ numPtr1[0];                  if (num3 <= 2)                  {                        break;                  }                  num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ numPtr1[1];                  numPtr1 += 2;            }            return (num1 + (num2 * 0x5d588b65));      }}

For more information about Lutz Roeder’s .NET Reflector, see the .NET Reflector site.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.