title: mach_header 64bit and __PAGEZERO segment 64bit
body: <pre><code>const struct mach_header *mach = _dyld_get_image_header(0);
  struct load_command *lc;
  struct segment_command_64 *sc64;
  struct segment_command *sc;
  
  if (mach-&gt;magic == MH_MAGIC_64) {
      lc = (struct load_command *)((unsigned char *)mach + sizeof(struct mach_header_64));
      printf("[+] detected 64bit ARM binary in memory.\n");
  } else {
      lc = (struct load_command *)((unsigned char *)mach + sizeof(struct mach_header));
      printf("[+] detected 32bit ARM binary in memory.\n");
  }
  
  for (int i = 0; i &lt; mach-&gt;ncmds; i++) {
  
      if (lc-&gt;cmd == LC_SEGMENT) {
          sc = (struct segment_command *)lc;
          NSLog(@"32Bit: %s (%x - 0x%x)",sc-&gt;segname,sc-&gt;vmaddr,sc-&gt;vmsize);
      } else if (lc-&gt;cmd == LC_SEGMENT_64) {
          sc64 = (struct segment_command_64 *)lc;
          NSLog(@"64Bit: %s (%llx - 0x%llx)",sc64-&gt;segname,sc64-&gt;vmaddr,sc64-&gt;vmsize);
      }
      lc = (struct load_command *)((unsigned char *)lc+lc-&gt;cmdsize);
  }
  </code></pre>
  
  <p>When I run this code in 32Bit I get normal outputs: </p>
  
  <pre><code>__PAGEZERO (0 - 0x1000) 
  But on 64Bit: __PAGEZERO (0 - 0x100000000) 
  </code></pre>
  
  <p><code>__PAGEZERO goes from 0x1000 to over 0x100000000</code> in size, is there any fix for it or any solution why this occurs?</p>