Error after Obfuscation

winmanwinman Posts: 8
edited May 13, 2013 6:58AM in SmartAssembly
I am using Smart Assembly 6 for obfuscating my vb.net application.In my code i do have line of a code as MSFG1.AddItem("") . After obfuscation when the exe file is opened it gives error as "Object reference not set to an instance of object" .If i use index in AddItem that is code will be MSFG1.AddItem("",0) will not give any error while running the exe crated and works fine. So my question is why does AddItem to AxMSFlexGrid without an index gives error after building exe in SmartAssembly?

Comments

  • James BJames B Posts: 1,124 Silver 4
    Hi,

    Without a code sample, it's hard to say. It might be because the empty string value is changing with the encoding but supplying the index changes the behaviour (you could try changing it to MSFG1.AddItem(string.empty) instead?)

    Failing that, maybe try generating a debugging PDB with Smartassembly so you can step through and see what happens/what's null?
    Systems Software Engineer

    Redgate Software

  • How can i troubleshoot by using check pdb files?
  • James BJames B Posts: 1,124 Silver 4
    You set the option to enable debugging information. See here. You can then run the application, attach to it from within VS and set breakpoints as you normally would do.
    Systems Software Engineer

    Redgate Software

  • You set the option to enable debugging information. See here. You can then run the application, attach to it from within VS and set breakpoints as you normally would do.
    Sorry i didn't get what you are trying to say.
    Now i have exe which is obfuscated and .pdb file. But how can i read these or where should i set break point. I can set break point in VS and run the code for normal projects.But as you said where should i keep break points?And how to troubleshoot?
  • James BJames B Posts: 1,124 Silver 4
    You should be able to run your obfuscated application, then, in Visual Studio (with the solution open) attach to the running process. Once attached, you should be able to set breakpoints and step through the code as usual.
    Systems Software Engineer

    Redgate Software

  • But how can i attach the running application or exe file into a visual studio and set break points?
    I have only used break points in my code and debug the code. I haven't used with the application itself.
    So please provide more information on how it can be done?
  • James BJames B Posts: 1,124 Silver 4
    You simply open up your solution, but don't "debug" it. Instead, run your obfuscated application, then attach to it from within visual studio. The process is similar to debugging a windows service, as you cannot start these from within visual studio and need to use the same "attach" method - see here

    (I should point out this is all nothing to do with Smartassembly, but simply how to debug a running process)
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.