Bug in assembly resource decompilation

Hi,
I upgraded Net Reflector to version 11.1 from version 10.3.
When I try to open an localized assmbly resource like System.Web.Mvc.resources.dll clicking on assemIy node I obtain the following error:

Translation failure in 'System.Web.Mvc.resources, Version=5.2.7.0, Culture=de, PublicKeyToken=31bf3856ad364e35' in 'System.Web.Mvc.resources, Version=5.2.7.0, Culture=de, PublicKeyToken=31bf3856ad364e35'.
System.Reflection.TargetInvocationException


Caused by:

Unable to get assembly reference for type of code identifier.
System.NotSupportedException
  in Reflector.ObjectModelResolutionHelper.GetAssemblyReference(ITypeReference value)
  in Reflector.CodeIdentifier.SetTypeDeclaration(IType type)
  in Reflector.CodeIdentifier..ctor(Object value)
  in Reflector.Application.UserInterface.HtmlFormatterViewer.GenerateLinkUrl(Object value)
  in Reflector.Application.UserInterface.HtmlFormatterViewer.WriteReference(String text, String toolTip, Object target)
  in Reflector.Application.Languages.CSharpLanguage.LanguageWriter.WriteCustomAttribute(ICustomAttribute customAttribute, IFormatter formatter)
  in Reflector.Application.Languages.CSharpLanguage.LanguageWriter.WriteCustomAttributeList(ICustomAttributeProvider value, IFormatter formatter, String target, HashSet`1 hide)
  in Reflector.Application.Languages.CSharpLanguage.LanguageWriter.WriteAssembly(IAssembly value)
  in Reflector.Application.UserInterface.DisassemblerWindow.Render(Boolean expandTypes, Boolean expandMethods)

Conversely using the older version 10.3 the assembly is loaded correctly.

Thanks
Filippo
Tagged:

Answers

  • Pete2019Pete2019 Posts: 1 New member
    Confirmed, the latest 11.1.0.2167 has serious bug, basically cannot decompile anything with generic implemented. After update to latest Visual Studio 2022 service pack, the reflector 11.1.0.2167 produces the errors with pretty much all dll files, this application not usable anymore. Please use Jetbrains dotPeek instead. Here is an example:

    System.Reflection.TargetInvocationException


    Caused by:

    Malformed function pointer signature.
    System.NotSupportedException
      at Reflector.CodeModel.Assembly.Module.ReadFunctionPointer(ByteArrayReader reader, IGenericArgumentProvider genericType, IGenericArgumentProvider genericMethod)
      at Reflector.CodeModel.Assembly.Module.ReadTypeSignature(ByteArrayReader reader, IGenericArgumentProvider genericType, IGenericArgumentProvider genericMethod, Boolean& pinned)
      at Reflector.CodeModel.Assembly.Module.ReadTypeSignature(ByteArrayReader reader, IGenericArgumentProvider genericType, IGenericArgumentProvider genericMethod)
      at Reflector.CodeModel.Assembly.FieldDeclaration..ctor(TypeDeclaration declaringType, UInt16 flags, Int32 name, Int32 signature)
      at Reflector.CodeModel.Assembly.Module.DecodeTypeDeclarationTable()
      at Reflector.CodeModel.Assembly.Module.DecodeMetaData()
      at Reflector.CodeModel.Assembly.Module.get_Types()
      at Reflector.CodeModel.Assembly.Equality.ResolveTypeReference(ITypeReference typeReference, HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.TypeReference.Resolve(HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.Equality.ResolveTypeReference(ITypeReference typeReference, HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.TypeReference.Resolve(HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.CustomAttribute.GetUnderlyingFieldType(IType value)
      at Reflector.CodeModel.Assembly.CustomAttribute.ReadValue(ByteArrayReader reader, IType type)
      at Reflector.CodeModel.Assembly.CustomAttribute.get_Arguments()
      at Reflector.CodeModel.Visitor.Cloner.TransformCustomAttribute(ICustomAttribute value)
      at Reflector.CodeModel.Visitor.Transformer.TransformCustomAttributeCollection(ICustomAttributeCollection attributes)
      at Reflector.CodeModel.Visitor.Cloner.TransformTypeDeclaration(ITypeDeclaration value)
      at Reflector.CodeModel.Visitor.Transformer.TransformTypeDeclarationCollection(ITypeDeclarationCollection value)
      at Reflector.CodeModel.Visitor.Cloner.TransformTypeDeclaration(ITypeDeclaration value)
      at Reflector.Disassembler.Disassembler.TransformTypeDeclaration(ITypeDeclaration value)
      at Reflector.CodeModel.Visitor.Transformer.TransformTypeDeclarationCollection(ITypeDeclarationCollection value)
      at Reflector.Disassembler.Disassembler.TransformNamespace(INamespace value)
      at Reflector.Application.Translator.TranslateNamespace(INamespace value, Boolean memberDeclarationList)
      at Reflector.Application.UserInterface.DisassemblerWindow.Render(Boolean expandTypes, Boolean expandMethods)
  • pshrosbreepshrosbree Posts: 2 New member
    Has there been any progress on resolving this bug? I am using Version 11.1.0.2167 vspro in standalone mode.
  • brock01brock01 Posts: 1 New member
    Pete2019 said:
    Confirmed, the latest 11.1.0.2167 has serious bug, basically cannot decompile anything with generic implemented. After update to latest Visual Studio 2022 service pack, the reflector 11.1.0.2167 produces the errors with pretty much all dll files, this application not usable anymore. Please use Jetbrains dotPeek instead. Here is an example:

    System.Reflection.TargetInvocationException


    Caused by:

    Malformed function pointer signature.
    System.NotSupportedException
      at Reflector.CodeModel.Assembly.Module.ReadFunctionPointer(ByteArrayReader reader, IGenericArgumentProvider genericType, IGenericArgumentProvider genericMethod)
      at Reflector.CodeModel.Assembly.Module.ReadTypeSignature(ByteArrayReader reader, IGenericArgumentProvider genericType, IGenericArgumentProvider genericMethod, Boolean& pinned) pro apk
      at Reflector.CodeModel.Assembly.Module.ReadTypeSignature(ByteArrayReader reader, IGenericArgumentProvider genericType, IGenericArgumentProvider genericMethod)
      at Reflector.CodeModel.Assembly.FieldDeclaration..ctor(TypeDeclaration declaringType, UInt16 flags, Int32 name, Int32 signature)
      at Reflector.CodeModel.Assembly.Module.DecodeTypeDeclarationTable()
      at Reflector.CodeModel.Assembly.Module.DecodeMetaData()
      at Reflector.CodeModel.Assembly.Module.get_Types()
      at Reflector.CodeModel.Assembly.Equality.ResolveTypeReference(ITypeReference typeReference, HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.TypeReference.Resolve(HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.Equality.ResolveTypeReference(ITypeReference typeReference, HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.TypeReference.Resolve(HashSet`1 alreadyChecked)
      at Reflector.CodeModel.Assembly.CustomAttribute.GetUnderlyingFieldType(IType value)
      at Reflector.CodeModel.Assembly.CustomAttribute.ReadValue(ByteArrayReader reader, IType type)
      at Reflector.CodeModel.Assembly.CustomAttribute.get_Arguments()
      at Reflector.CodeModel.Visitor.Cloner.TransformCustomAttribute(ICustomAttribute value)
      at Reflector.CodeModel.Visitor.Transformer.TransformCustomAttributeCollection(ICustomAttributeCollection attributes)
      at Reflector.CodeModel.Visitor.Cloner.TransformTypeDeclaration(ITypeDeclaration value)
      at Reflector.CodeModel.Visitor.Transformer.TransformTypeDeclarationCollection(ITypeDeclarationCollection value)
      at Reflector.CodeModel.Visitor.Cloner.TransformTypeDeclaration(ITypeDeclaration value)
      at Reflector.Disassembler.Disassembler.TransformTypeDeclaration(ITypeDeclaration value)
      at Reflector.CodeModel.Visitor.Transformer.TransformTypeDeclarationCollection(ITypeDeclarationCollection value)
      at Reflector.Disassembler.Disassembler.TransformNamespace(INamespace value)
      at Reflector.Application.Translator.TranslateNamespace(INamespace value, Boolean memberDeclarationList)
      at Reflector.Application.UserInterface.DisassemblerWindow.Render(Boolean expandTypes, Boolean expandMethods)

    It seems like version 11.1.0.2167 of Reflector has a critical bug that prevents decompiling assemblies with generics. The issue results in errors, including System.NotSupportedException: Malformed function pointer signature. After updating to the latest Visual Studio 2022 service pack, this version becomes unusable for most DLLs.

    For now, I recommend switching to JetBrains dotPeek, which is more reliable. Here's an example of the error encountered with Reflector:

    plaintextCopy codeSystem.Reflection.TargetInvocationException: Malformed function pointer signature.
    System.NotSupportedException ...
    

    dotPeek should provide a better decompiling experience until Reflector gets patched.

  • henery6547henery6547 Posts: 2 New member

    It seems you're encountering a bug related to assembly resource decompilation. Assembly decompilation typically refers to the process of converting compiled machine code or assembly language back into a higher-level source code. Here are some common issues and potential causes for bugs during this process:

    Possible Causes:

    1. Incorrect Handling of Data Sections: Assembly programs consist of code and data sections, and decompilers might struggle with distinguishing between them. If the data section is misinterpreted as code or vice versa, it can lead to incorrect decompilation.

    2. Optimizations During Compilation: Compiler optimizations can result in code that's harder to decompile. This includes things like inlining functions, loop unrolling, or register renaming. The decompiler might fail to correctly reconstruct the original high-level structure.

    3. Missing or Inaccurate Debug Information: If the assembly code lacks debug symbols or proper annotations, the decompiler can misinterpret or fail to fully reconstruct the high-level source code.

    4. Control Flow Issues: The decompiler might have issues reconstructing control flow, especially if the program uses low-level tricks like self-modifying code, indirect jumps, or obfuscation.

    5. Unsupported Instruction Set: If the assembly uses a specific processor instruction set that's not well-supported by the decompiler, it may result in errors or incomplete decompilation.

    6. Inaccurate Stack Handling: A decompiler might have trouble dealing with complex stack manipulations, such as those used in recursive function calls, indirect addressing, or register spills.

    7. Corrupted Input Files: If the assembly file itself is corrupted or improperly formatted, this can introduce bugs during decompilation.

    8. Compatibility Issues: Sometimes the decompiler might not support the specific version of the binary or assembly code you're working with.

    Steps to Debug:

    1. Check Input Format: Ensure that the assembly or binary you're working with is in a format that the decompiler supports (e.g., ELF, PE, Mach-O).

    2. Use Another Decompiler: If one tool is failing, try using a different assembly decompiler, such as IDA Pro, Ghidra, or Radare2. Different tools handle assembly differently.

    3. Examine Control Flow: Look at the control flow in the disassembled assembly to see if any jumps, calls, or branches are misrepresented.

    4. Check for Obfuscation: If the code is obfuscated, you might need to use specific deobfuscation techniques or tools to get better results.

    5. Debug with Debug Information: If possible, obtain debug symbols or source maps for the assembly to aid the decompiler in correctly identifying function boundaries and variable names.

    6. Test with a Small Example: Test the decompiler on a simpler assembly file to check if the issue is with the specific binary or the tool itself.

    Common Decompilers:

    1. Ghidra – Open-source and supports many architectures.
    2. IDA Pro – Highly regarded for advanced analysis, but it's proprietary.
    3. Radare2 – An open-source reverse engineering framework.
    4. Binary Ninja – A more modern, user-friendly option for reverse engineering.

    If you have more specific details about the bug or error message, feel free to share them, and I can offer more targeted advice.

  • shainshain Posts: 1 New member

    It seems you're encountering a bug related to assembly resource decompilation. Assembly decompilation typically refers to the process of converting compiled machine code or assembly language back into a higher-level source code. Here are some common issues and potential causes for bugs during this process:

    Possible Causes:

    1. Incorrect Handling of Data Sections: Assembly programs consist of code and data sections, and decompilers might struggle with distinguishing between them. If the data section is misinterpreted as code or vice versa, it can lead to incorrect decompilation.

    2. Optimizations During Compilation: Compiler optimizations can result in code that's harder to decompile. This includes things like inlining functions, loop unrolling, or register renaming. The decompiler might fail to correctly reconstruct the original high-level structure.

    3. Missing or Inaccurate Debug Information: If the assembly code lacks debug symbols or proper annotations, the decompiler can misinterpret or fail to fully reconstruct the high-level source code.

    4. Control Flow Issues: The decompiler might have issues reconstructing control flow, especially if the program uses low-level tricks like self-modifying code, indirect jumps, or obfuscation.

    5. Unsupported Instruction Set: If the assembly uses a specific processor instruction set that's not well-supported by the decompiler, it may result in errors or incomplete decompilation.

    6. Inaccurate Stack Handling: A decompiler might have trouble dealing with complex stack manipulations, such as those used in recursive function calls, indirect addressing, or register spills.

    7. Corrupted Input Files: If the assembly file itself is corrupted or improperly formatted, this can introduce bugs during decompilation.

    8. Compatibility Issues: Sometimes the decompiler might not support the specific version of the binary or assembly code you're working with.

    Steps to Debug:

    1. Check Input Format: Ensure that the assembly or binary you're working with is in a format that the decompiler supports (e.g., ELF, PE, Mach-O).Use

    2.  Another Decompiler: If one tool is failing, try using a different assembly decompiler, such as IDA Pro, Ghidra, or Radare2. Different tools handle assembly differently.

    3. Examine Control Flow: Look at the control flow in the disassembled assembly to see if any jumps, calls, or branches are misrepresented.

    4. Check for Obfuscation: If the code is obfuscated, you might need to use specific deobfuscation techniques or tools to get better results.

    5. Debug with Debug Information: If possible, obtain debug symbols or source maps for the assembly to aid the decompiler in correctly identifying function boundaries and variable names.

    6. Test with a Small Example: Test the decompiler on a simpler assembly file to check if the issue is with the specific binary or the tool itself.

    Common Decompilers:

    1. Ghidra – Open-source and supports many architectures.
    2. IDA Pro – Highly regarded for advanced analysis, but it's proprietary.
    3. Radare2 – An open-source reverse engineering framework.
    4. Binary Ninja – A more modern, user-friendly option for reverse engineering.

    If you have more specific details about the bug or error message, feel free to share them, and I can offer more targeted advice.

    It seems you're facing a decompilation bug due to various potential causes like incorrect data handling, optimization issues, or missing debug information. Try using a different decompiler, checking for obfuscation, or ensuring the file format is compatible for more accurate results.

  • winkapkwinkapk Posts: 1 New member
    If you want to enjoy all the premium editing tools for free and improve your video quality, then you should download the latest version of the Wink APK app on your Android mobile device.
Sign In or Register to comment.