How to tell if a .NET application was compiled in DEBUG or RELEASE mode?

I blogged this a long time ago, and I don’t know if it still valid or not, but the code is something like… private void testfile(string file) { if(isAssemblyDebugBuild(file)) { MessageBox.Show(String.Format(“{0} seems to be a debug build”,file)); } else { MessageBox.Show(String.Format(“{0} seems to be a release build”,file)); } } private bool isAssemblyDebugBuild(string filename) { return … Read more

How to write and executable Windows .exe manually (machine code with Hex editor)?

There’s a quite minimalistic but fully working (on Win7, too) exe on corkami/wiki/PE101, every byte of it is explained in the nice graphic. You can type it all by hand in a hex editor, but the paddings may make that a little tedious. As for the history, yes someone at Microsoft invented the exe format … Read more

What are the uses of self modifying code? [closed]

Turns out that the Wikipedia entry on “self-modifying code” has a great list: Semi-automatic optimization of a state dependent loop. Runtime code generation, or specialization of an algorithm in runtime or loadtime (which is popular, for example, in the domain of real-time graphics) such as a general sort utility preparing code to perform the key … Read more

How to compile a linux shell script to be a standalone executable *binary* (i.e. not just e.g. chmod 755)?

The solution that fully meets my needs would be SHC – a free tool, or CCsh a commercial tool. Both compile shell scripts to C, which then can be compiled using a C compiler. Links about SHC: https://github.com/neurobin/shc http://www.datsi.fi.upm.es/~frosal/ http://www.downloadplex.com/Linux/System-Utilities/Shell-Tools/Download-shc_70414.html Links about CCsh: http://www.comeaucomputing.com/faqs/ccshlit.html

Determine target ISA extensions of binary file in Linux (library or executable)

The unix.linux file command is great for this. It can generally detect the target architecture and operating system for a given binary (and has been maintained on and off since 1973. wow!) Of course, if you’re not running under unix/linux – you’re a bit stuck. I’m currently trying to find a java based port that … Read more

How do I create executable Java program? [duplicate]

You can use the jar tool bundled with the SDK and create an executable version of the program. This is how it’s done. I’m posting the results from my command prompt because it’s easier, but the same should apply when using JCreator. First create your program: $cat HelloWorldSwing.java package start; import javax.swing.*; public class HelloWorldSwing … Read more