Tearing apart a C# executable - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Tearing apart a C# executable

elway23elway23 Posts: 57Member
Can anyone tell me if there is any software out there that will allow you to take the compiled C# exe file and rip it apart so you can actually see it's source code?

Alternatively, can anyone thing of a way to force a C# program to throw an exception so that it will tell you "an error has occured" and then ask you if you'd like to debug it?

Thanks!

Comments

  • GenjuroGenjuro Posts: 913Member
    : Can anyone tell me if there is any software out there that will allow you to take the compiled C# exe file and rip it apart so you can actually see it's source code?
    :
    : Alternatively, can anyone thing of a way to force a C# program to throw an exception so that it will tell you "an error has occured" and then ask you if you'd like to debug it?
    :
    : Thanks!
    :

    Uhm... no way - once it's compiled, you can only look at its assembly code. But, .NET comes to our aid (again).
    But, .NET compiles in Intermediate Language, not (always) into binary code.
    Instead of a binary disassembler, you can use ILDASM.EXE (you should have it, it's in the SDK) to open an EXE, and look its "Intermediate Language source code".

    Try that.
  • dannysmurfdannysmurf Posts: 21Member
    There is a program around that will disassemble a C# executable into actual C# source code, called Anakrino.

    If you want to debug a program and have it stop at a certain point, just set a breakpoint in the compiler and debug the program instead of compiling it.
  • elway23elway23 Posts: 57Member
    Yep...I managed to get my hand on Anakrino. The problem was that it wasn't MY code I was having problems with. I needed to see how someone else implemented a part of the program and only had the .exe. I got it now, though....Thanks!!


    : There is a program around that will disassemble a C# executable into actual C# source code, called Anakrino.
    :
    : If you want to debug a program and have it stop at a certain point, just set a breakpoint in the compiler and debug the program instead of compiling it.
    :

  • Praveen123Praveen123 Posts: 3Member
    : : Can anyone tell me if there is any software out there that will allow you to take the compiled C# exe file and rip it apart so you can actually see it's source code?
    : :
    : : Alternatively, can anyone thing of a way to force a C# program to throw an exception so that it will tell you "an error has occured" and then ask you if you'd like to debug it?
    : :
    : : Thanks!
    : :
    :
    : Uhm... no way - once it's compiled, you can only look at its assembly code. But, .NET comes to our aid (again).
    : But, .NET compiles in Intermediate Language, not (always) into binary code.
    : Instead of a binary disassembler, you can use ILDASM.EXE (you should have it, it's in the SDK) to open an EXE, and look its "Intermediate Language source code".
    :
    : Try that.
    :

  • Praveen123Praveen123 Posts: 3Member
    : Can anyone tell me if there is any software out there that will allow you to take the compiled C# exe file and rip it apart so you can actually see it's source code?
    :
    : Alternatively, can anyone thing of a way to force a C# program to throw an exception so that it will tell you "an error has occured" and then ask you if you'd like to debug it?
    :
    : Thanks!
    :

  • Praveen123Praveen123 Posts: 3Member
    : Yep...I managed to get my hand on Anakrino. The problem was that it wasn't MY code I was having problems with. I needed to see how someone else implemented a part of the program and only had the .exe. I got it now, though....Thanks!!
    :
    :
    : : There is a program around that will disassemble a C# executable into actual C# source code, called Anakrino.
    : :
    : : If you want to debug a program and have it stop at a certain point, just set a breakpoint in the compiler and debug the program instead of compiling it.
    : :
    :
    :

  • jonathantan86jonathantan86 Posts: 1Member
    Use throw(e) or throw to raise an exception. But with the default settings it will automatically jump to the nearest exception handler (I think).
    Anyway you can use breakpoints.
Sign In or Register to comment.