Xref: utzoo comp.arch:6736 comp.lang.c:13402 comp.lang.misc:2017 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.arch,comp.lang.c,comp.lang.misc Subject: Re: Universal Disassemblers vs. Universal MIILs Message-ID: <6152@june.cs.washington.edu> Date: 20 Oct 88 21:52:29 GMT References: <358@istop.ist.co.uk> Reply-To: pardo@cs.washington.edu (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 83 bcase@cup.portal.com (Brian bcase Case) writes: >knudsen@ihlpl.ATT.COM (Knudsen) writes: >>And distributing a uMIIL isn't going to make automatic disassembly *easier*? >This, I think, is the one real hurdle is getting a the MIIL concept accepted. I think the nub of the matter is that it makes disassembly more *useful*, not any easier. I claim that I can distribute C code to my programs and it is completely useless. I gave an example of this quite a while back. I need to do things such as: * Rename all variables. * Hoist (inline) functions. * Do loop transformations (e.g. for() loop to a goto loop). * Strip out all comments. * Run the preprocessor to remove #ifdefs (Is this the same value "4" that appeared in the line before, or are they unrelated?) * Avoid standard libraries. * Do code motion. * Delcare wasted variables, dead code, unoptimize code that an optimizer can put back together again later, ... Essentially, preform all the optimizations that I can on the C source, and steal liberally from the Obfusacted C Code Contest. Consider the following (well-formated) program. What does it do? extern struct _a7F9a1Xs3 { int _a7F6a1Xs3; char *_a7G9a1xs3; char *_a7G6a1xs3; int _a7G6a1xs7; short _a7F9a1xs7; char _a7F9a1xf7; } _iob[3]; main(_a7F9a1xf3, _a7F61axf3) int _a7F9a1xf3; char *_a7F61axf3[]; { int _a7G61asf3, _a7G61faf3; goto _a7G61afx3; _a7G61afs3: exit(0), _a7G61asf3&=(0x10)+1; _a7G61afx3: ((_a7G61asf3=(--((&_iob[0]))->_a7F6a1Xs3>=0 ? *((&_iob[0]))->_a7G9a1xs3++&0377 :_filbuf((&_iob[0])))) !=(-1)); if (_a7G61asf3*(3-1)==(0-2)) goto _a7G61afs3; (--((&_iob[1]))->_a7F6a1Xs3>=0 ? ((int)(*((&_iob[1]))->_a7G9a1xs3++=(unsigned)(_a7G61asf3))) :_flsbuf((unsigned)(_a7G61asf3),(&_iob[1]))); goto _a7G61afx3; _a7G71afs3: (--((&_iob[1]))->_a7F6a1Xs3>=0 ? ((int)(*((&_iob[1]))->_a7G9a1xs3++=(unsigned)(_a7G61asf3))) :_flsbuf((unsigned)(_a7G61asf3),(&_iob[1]))); exit(1); } Did you guess: #include main(argc, argv) int argc; char *argv[]; { int c; while ((c=getchar())!=EOF) putchar(c); } Enough. ;-D on ( Throw a monkey in the wrench ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo