[CDG5] MPW and Trampoline

Elliot Nunn elliotnunn at fastmail.com
Wed Jan 9 12:21:37 AWST 2019


Happy new year!

MrC round-tripping sounds like a very hard slog. After all, RISC is
sometimes said to stand for "Relegate the Interesting Stuff to the
Compiler"! Mind you, with your intimate familiarity with the
architecture, you could well enjoy some breakthroughs.

I can't seem to find MPW 3.4 in my archives. Is it old enough even to
have a RISC compiler? I think that the early ones were distributed as a
separate SDK. I suggest downloading all the E.T.O. images that you can
find. They are the best library of MPW tools that I have found.

Have you built any bootable Trampolines? That would be a very powerful
validation of your reversal.

> On 8 Jan 2019, at 11:05 pm, Max Poliakovski <maximumspatium at googlemail.com> wrote:
> 
> Hi guys,
> 
> happy new year!
> 
> > Quoting Elliot's mail from 05-02-2018:
> > I have had some success getting Apple'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've messed up. However, my approach is not always practical, and your focus on high-level hacking is likely to be more rewarding.
> 
> I'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).
> 
> As expected, I wasn't able to obtain byte-perfect output with MrC regardless different optimizations and even compiler versions.
> 
> Below a short report:
> 
> MrC 4.1.0 from MPW 3.5 GM emits code that is far from the code located in the Trampoline binary.
> 
> I therefore downgraded to MrC 3.0.1 from 02-20-1997 that can be obtained here: https://www.staticky.com/mirrors/ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_Website_Downloads/
> 
> 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's binary except a small difference in the register allocation ($r11 and $r12 are swapped).
> 
> I also tried MrC 4.1a1 but it seems to go in the wrong direction.
> 
> 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.
> 
> Does somebody own MPW 3.4? I've seen only 3.3, 3.5 and PR so far...
> 
> Cheers
> Max
> _______________________________________________
> cdg5 mailing list
> cdg5 at ucc.asn.au
> https://lists.ucc.gu.uwa.edu.au/mailman/listinfo/cdg5



More information about the cdg5 mailing list