justinstenning / SharpDisasm

SharpDisasm - x86 / x86-64 disassembler for .NET
https://www.nuget.org/packages/SharpDisasm
Other
212 stars 39 forks source link

Use exceptions instead of Debug.Assert #6

Open emnh opened 8 years ago

emnh commented 8 years ago

I am disassembling with try catch something that may be valid opcodes or not (just whole memory of a program).

For example I am hitting a debug assert at Udis86/Decode.cs line 429.

Debug.Assert(u.error == 0, "invalid operand size");

Currently I am working around it using http://stackoverflow.com/questions/2854024/how-to-prevent-debug-assert-to-show-a-modal-dialog, but I think it would be better to have a better failure mode when invalid operations are encountered.