Whats the idea?

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, Alex.Davies, melvyn.harbour

Whats the idea?

Postby Uniwares_AS » Wed Jul 28, 2010 7:10 pm

While browsing a protected assembly I just found that SA created the following construct, whats the idea of that?

Code: Select all
public static void xx()
{
    try
    {
        try
        {
            xx3.xx();
        }
        catch (Exception)
        {
        }
    }
    catch (Exception exception2)
    {
        UnhandledException.xx(exception2);
        throw;
    }
}
Uniwares_AS
 
Posts: 132
Joined: Thu Oct 11, 2007 3:29 pm

Postby Alex.Davies » Thu Jul 29, 2010 9:55 am

Is the inner try-catch block there in the original source code?

The outer one is applied to all methods (it isn't worth checking for cases like this where it has no effect) to capture variables for the error reporting.
Alex
Developer,
Red Gate .NET Tools
Alex.Davies
 
Posts: 335
Joined: Tue Dec 02, 2008 12:23 pm
Location: Cambridge, uk

Postby Uniwares_AS » Thu Jul 29, 2010 12:43 pm

No, there is no try/catch at all. And as I could see, in pretty much every ctor SA seems to insert this preventive catch all, even in emtpy and default ctors. but only the ctors with code in it actually have the outer catch.
Seems pretty weird to me.
Uniwares_AS
 
Posts: 132
Joined: Thu Oct 11, 2007 3:29 pm


Return to SmartAssembly 5

Who is online

Users browsing this forum: No registered users and 1 guest