title: How can I isolate the compiled logic of a C++ program from the rest of the file header data?
body: <p>I want to observe the difference in op code binary output of compilation between two versions of a very basic C++ program. For example, 2 + 2 = ?, with no libraries called. I expected the compiled output to be a tiny file of binary op codes with a few small headers, being new to compiled programs, but there are large headers.</p>
  <p><code>simple.cpp</code></p>
  <pre><code>int main()
  {
      unsigned int a = 2;
      unsigned int b = 2;
      unsigned int c = a + b;
  }
  </code></pre>
  <p>compiler:</p>
  <pre><code>g++ -std=c++0x simple.cpp -o simple
  </code></pre>
  <p>Is there a format that I can export to that doesn't contain headers, just op code binary that we instruct the machine to execute? If not, what bytes or location in the resulting file can I look for to isolate the relevant logic from the program?</p>
  <p>I need the machine code, not assembly, since my project is the analysis of differently obfuscated versions of a source file to attempt recognizing one based on the other. A complex subject with questionable feasibility, but nevertheless that's why I'm asking to isolate the machine code and not just the assembly - to test analysis against the true machine code outputs.</p>
  <p>I tried googling the header structure but can't seem to find much info.</p>