Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
AV-IO opened this issue Aug 22, 2023 · 1 comment
Closed

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

AV-IO opened this issue Aug 22, 2023 · 1 comment
Labels

Comments

@AV-IO
Copy link

AV-IO commented Aug 22, 2023

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.

@siegfriedpammer
Copy link
Member

Thanks for reporting! Next time, please upload the binary in question directly, so I don't have to go and download + install software in order to reproduce the bug. Thank you for your understanding!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2023
mattsh247 pushed a commit to mattsh247/ILSpy that referenced this issue Jul 30, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants