Hack Forums
[.NET] Unpacked/Deobfuscated file not opening - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Unpacked/Deobfuscated file not opening (/showthread.php?tid=6050656)



Unpacked/Deobfuscated file not opening - SIM-3602297 - Feb 18, 2020

Whats going on:
I've unpacked a file using BoxedApp. However, after file has been unpacked from BoxedApp it no longer opens up. It just loads for a bit but doesn't start.
I debugged it in dnSpy and released that file missed from dlls - however i added all the dlls neccessary and now i'm getting this error when trying to run the unpacked exe:

[Image: qxFMGLp.png]

So basically i'm trying to run the file i've unpacked from BoxedApp Packer, and it's giving me the error as shown in the image.

"An unhandled exception occured in Taskmgr.exe (46040)
Exception: System.TypeInitiazationException
Message: The type initializer for "DriverProgram.Form1" threw an exception."

I need help to get this file to work...


RE: Unpacked/Deobfuscated file not opening - Accord - Feb 19, 2020

The code is now readable, you can hold ctrl+click on form1() to show its code, on the typeinitializerexception, i always get that when theres a dll error, maybe its dependency is not loaded successfully, please check the configuration


RE: Unpacked/Deobfuscated file not opening - gigajew - Feb 19, 2020

A type initialization error means you may be using a bad or null variable in your constructor of the form class or any subclasses constructors

Like for instance
Code
Public CustomClass customClass = null;
Public Form1(){
customClass.DoSomething(); // customClass is still null on init
}
It won’t always show up as a nullreferenceexception sometimes it can be disguised as a type initialization error