zedseven
zedseven
CC#
Created by zedseven on 5/10/2025 in #help
Reasons why a DLL might decompile to have every function return `null`?
I have a third-party DLL that I'm working with, and when I try to decompile it, the decompiled code shows every function as empty, returning null or true. The IL code that the decompilers show matches the bad code:
IL_0000: nop
IL_0001: nop
IL_0002: ldnull
IL_0003: ret
IL_0000: nop
IL_0001: nop
IL_0002: ldnull
IL_0003: ret
I've tried four different decompilers, all with the same results: dotPeek, ILSpy, dnSpy, and ildasm. The only exception seems to be when I use the View Disassembly window in Visual Studio while debugging - then I can see some IL code that looks correct, but when I get it to actually decompile, it uses ILSpy and goes back to being useless. I know for a fact that the functions do not simply return null, and that this code is incorrect. Does anyone have any ideas why this might be the case, or how I can get around it? I'm trying to decompile it to understand a nondescript error that the DLL gives me when calling it from an unmanaged C++ program with a bridge DLL.
53 replies