Devator
Devator

Reputation: 3904

Debugging obfuscated code

I have an application which is obfuscated with EazFuscator.NET. However, debugging this is quite impossible (even though it's a small application), for example, this is an error report:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Stacktrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at .(Object , RunWorkerCompletedEventArgs )
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)

It clearly states the error is caused within a background worker. Since it's a small application, I have the feeling I know where but that's simply because it's a small application.

I'm already attaching the configuration files from the user and there's a checkbox to include a screenshot on the error report.

Is there any way to make this debugging easier for me while still having obfuscated code?

Upvotes: 1

Views: 3363

Answers (2)

DaNeSh
DaNeSh

Reputation: 1062

Most of obfuscators generate mapping files that shows you mapping between original class / method names and obfuscated ones. You should store these files somewhere for each version or ... and use them to find the real stack trace.

Upvotes: 2

SergeyS
SergeyS

Reputation: 3553

I had such experience of debugging client's issues on small obfuscated program too. And I can suggest you two options:

1) Making configurable verbose logging for your program, which client can enable in settings. You can collect huge amount of info using this logging (for example: entry point to each important method with parameters passed to it). Generally speaking having a good logging in your program is a HUGE time saver in debugging client's (and not only client's) issues.

2) Also if user will allow you to access environment you can reinstall application (or change specific DLLs) with unobfuscated ones temporarily. After debugging is completed - just revert changed DLLs back.

Upvotes: 3

Related Questions