Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DLL comparison to confirm If same source code is used

I am comparing to make sure 2 dlls are generated from same source. As I could not use external tools to compare, I just created IL files using IL disassembler and comparing manually.

  • For the below fields in a .IL file , the count is same while comparing.

     //   CLR method headers : 
     //   Num.of method bodies  - 
     //   Num.of fat headers    - 
     //   Num.of tiny headers   - 
    
     // Managed code : 
     //   Ave method size - 
    
  • Order of class names are not same while count and names are same .

Is it safe to assume for the above scenarios that both DLLs are from same source code?

like image 784
Krishna Avatar asked Jan 21 '26 03:01

Krishna


1 Answers

You can use ILSpy to decompile both DLLs. Use Save Code... option for both libraries, so you can save it as complete Visual Studio project (csproj). Then simple WinMerge (with recursion) on both directories will show you all differences in the source code.

I've recently successfully used this approach to make sure what version of DLL was used on production machines.

like image 165
Konrad Kokosa Avatar answered Jan 23 '26 16:01

Konrad Kokosa