<div dir="ltr"><div dir="ltr"><div>Hi guys,</div><div><br></div><div>happy new year!</div><div><br></div><div>&gt; Quoting Elliot&#39;s mail from 05-02-2018:</div><div dir="ltr">&gt; I have had some success getting Apple&#39;s 68k C compiler to produce byte-accurate output. (A few things were in my favour here: simple C code, a simple C compiler and some sources for a previous version of the binary.) I always aim for byte-perfection after building my reversed sources (admittedly mostly assembly) because it lets me know when I&#39;ve messed up. However, my approach is not always practical, and your focus on high-level hacking is likely to be more rewarding.</div><div dir="ltr"><br></div><div>I&#39;ve played a couple of days with EMPW with the goal to get a byte-perfect output for the string.c module that consists of seven short functions (3-7 statements).</div><div><br></div><div>As expected, I wasn&#39;t able to obtain byte-perfect output with MrC regardless different optimizations and even compiler versions.</div><div><br></div><div>Below a short report:</div><div><br></div><div>MrC 4.1.0 from MPW 3.5 GM emits code that is far from the code located in the Trampoline binary.</div><div><br></div><div>I therefore downgraded to MrC 3.0.1 from 02-20-1997 that can be obtained here: <a href="https://www.staticky.com/mirrors/ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_Website_Downloads/">https://www.staticky.com/mirrors/ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_Website_Downloads/</a></div><div><br></div><div>With MrC 3.0.1, I was able to perfectly reconstruct strlen() and memset() - both are very, very simple functions. After playing with optimization settings abit, the code for strcpy() got very close to the Apple&#39;s binary except a small difference in the register allocation ($r11 and $r12 are swapped).</div><div><br></div><div>I also tried MrC 4.1a1 but it seems to go in the wrong direction.</div><div><br></div><div>I suspect that Apple might have used even an older compiler. The only possibility to check that out is to get a copy of MPW 3.4 (1995) which seems to be one of the first MPW versions including PowerPC compilers.</div><div><br></div><div>Does somebody own MPW 3.4? I&#39;ve seen only 3.3, 3.5 and PR so far...</div><div><br></div><div>Cheers</div><div>Max</div></div></div>