Skip to content

Improper IL Decompilation of try/filter/catch statements #3061

@AV-IO

Description

@AV-IO

Steps to reproduce

  1. Decompile MobileConcepts45.dll (obtained from CyberGhost download and installation) to IL
  2. Fail to compile to DLL target with ilasm.exe .\MobileConcepts45.il /DLL /noautoinherit
  3. Modify MobileConcepts45.il file to match ECMA-335 (6th edition) §11.19.4 by removing catch keyword
  4. All applicable (try/filter/catch) statements should now read as follows:
.try {
// ...
}
filter {
// ...
}
{
// ...
}
  1. Successfully compile to DLL target with ilasm.exe .\MobileConcepts45.il /DLL /noautoinherit

Error message shown

.\MobileConcepts45.il(62976) : error : syntax error at token 'catch' in:               catch

Details

  • ILSpy 8.1.0.7455
  • ilasm v. 4.8.9105.0 (Included in Visual Studio 2022 v. 17.6.3)
  • Windows 11 development environment (provided by Microsoft)

Resolution

I believe to resolve this for the future, ILSpy should no longer output the catch keyword when preceded directly by a filter statement in order to comply with ECMA-335.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions