.NET Reflector export controls
I have an assembly made by myself but I lost the source. That time I obfuscated it but I have de-obfuscated it. But it's full of crap now xD Reflector crashes when i'm trying to view some parts of the code. I tryed exporting the whole assembly into a project but I get error/exceptions.
I came up with a new idea. I'd like to get the whole forms, so just the controls etc... no even handlers and stuff just the code to re-create the form. So i want an exact (almost exact) copy of the form from my assembly. Usally this is located in the FormName.Designer.cs file but I can't reach that. I can't find it...
Because my i开发者_如何学运维dea behind this was: Re-create the form and then load the old assembly and use it as a reference and link everything up.
EDIT: Sorry my question at final: How do I just export the controls, the GUI, how do I decompile just that?
Kirk
When you obfuscate code, you're pretty much deciding you don't want anybody to be able to get anything out of it. I'm guessing that whatever you used to obfuscate it also obfuscated the designer classes, etc. Your time will be better spent running the program and trying to recreate the forms by hand than by attempting to pull data from the obfuscated executable.
For future reference, there's a lot to be said for source control. Even just setting up a Mercurial repository in a Dropbox folder is enough to save you a lot of heartache.
I'm guessing that some parts are crashing because your obfuscater placed invalid opcodes in unreachable branches of the CIL (i.e. byte code). The result of this is that a JITer will ignore them (because they're in unreachable code) but decompilation tools will blow as they will try to decompile everything including the invalid opcodes. It's basically a booby-trap technique for decompilers.
It may be worth trying to find a tool that can strip the invalid opcodes.
Here's one I found after a little searching, never used it though - good luck!
http://portal.b-at-s.net/download.php?view.439
Update
From your comments, it appears that my suspicions were correct, you have bad opcodes in your assembly.
I can't give advice on specific tools, but there are a number of tools to choose from for removing bad opcodes. A Google search found an alternative tool:
https://github.com/Contra/GIOR
精彩评论