title: Does Apple modify iOS application executables on apps submitted to the App Store?
body: <p>Is an app's executable file byte-for-byte identical when the app is purchased through the App Store and installed on a user's iPhone, compared to the original executable file submitted to Apple in the original app bundle?  Or is it different (for example, with additional signatures or encryption)?</p>
  
  <p>I am concerned only about the executable file, not the entire app bundle.</p>
  
  <p>In particular, would code such as ...</p>
  
  <pre><code>int main(int argc, char* argv[]) {
     FILE* file = fopen(argv[0], "rb");
     // Read entire contents of executable file; calculate a hash value
     // ...
     fclose(file);
  }
  </code></pre>
  
  <p>... calculate the same hash as calculating the hash outside of the iPhone on the original, submitted executable?</p>
  
  <p>For example, calculating a SHA256 hash as above then using "Build and Run" in XCode to run on an attached iPhone produces exactly the same result as calculating the SHA256 hash by running <code>openssl sha256 MyAppExecutableFile</code> from a terminal in OS X.  This means the act of installing the app through XCode does not alter the executable file.</p>
  
  <p>My question is whether or not this still holds when an app is submitted to the App Store, purchased, and installed.</p>