reposting th international obfuscated c code contest rules of we have received a number of requests for a reposting of the international obfuscated c code contest rules and guidelines also some people requested that these rules be posted to a wider set of groups sorry for the cross posting some technical clarifications were made to the rules and guidelines see the diff marks at the right hand edge the rules and guidelines for this year remain the same so people who have already or are in the process of submitting entries for the ioccc need not worry about these changes chongo landon curt noll cc chongo toad com larry bassel lab sun com bin sh this is a shell archive shar made utc by chongo toad com source directory tmp existing files will be overwritten this shar contains length mode name r r r rules r r r guidelines r r r mkentry c r r r obfuscate info rules echo x extracting rules text sed s x shar eof rules x th international obfuscated c code contest rules x xcopyright c landon curt noll larry bassel xall rights reserved permission for personal education or non profit use is xgranted provided this this copyright and notice are included in its entirety xand remains unaltered all other uses must receive prior permission in writing xfrom both landon curt noll and larry bassel x x obfuscate tr v cated cating cates a to render obscure x b to darken to confuse his emotions obfuscated his x judgment llat obfuscare to darken ob intensive x lat fuscare to darken fuscus dark obfuscation n x obfuscatory adj x x xgoals of the contest x x to write the most obscure obfuscated c program under the rules below x to show the importance of programming style in an ironic way x to stress c compilers with unusual code x to illustrate some of the subtleties of the c language x to provide a safe forum for poor c code x x xnote changes from the draft are noted by change bars x x xrules x x to help us with the volume of entries we ask that you follow these rules x x your entry must be a complete program x x your entry must be bytes in length the number of characters x excluding whitespace tab space newline and excluding any or x followed by either whitespace or end of file must be x x your entry must be submitted in the following format x x entry xrule xfix y or n n this is a new entry y this replaces an older entry xtitle title of entry see comments below xentry entry number from to inclusive your st entry should by xdate date time of submission in utc see comments below xhost machine s and os s under which your entry was tested x use tab indented lines if needed x remark x place remarks about this entry in this section it would be helpful if x you were to indent your remarks with spaces though it is not a x requirement also if possible try to avoid going beyond the th x column blank lines are permitted x author xname your name xorg school company organization xaddr postal address x use tab indented lines to continue x don t forget to include the country xemail email address from a well known site or registered domain x if you give several forms list them on separate tab indented lines xanon y or n y remain anonymous n ok to publish this info x info xif your program needs an info file place a uuencoded copy of it in xthis section in the case of multiple info files use multiple info xsections if your entry does not need a info file skip this section x build xplace a uuencoded copy of the command s used to compile build your program xin this section it must uudecode into a file named build the resulting xfile must be bytes or less x program xplace a uuencoded copy of your program in this section it must uudecode xinto a file named is prog c the resulting file must follow rule x end x x regarding the above format x x the title must match the expression a za z a za z x and must be to characters in length x x it is suggested but not required that the title should x incorporate your username in the case of multiple authors x consider using parts of the usernames of the authors x x the date in the entry section should be given with respect x to utc the format of the date should be as returned by asctime x using the c locale see guidelines for more info x x you may correct revise a previously submitted entry by sending x it to the contest email address be sure to set fix in the x entry section to n the corrected entry must use the same x title and entry number as submittion that is being corrected be x sure that you note the resubmittion in the remark as well x x with the exception of the header all text outside of the above x format may be ignored by the judges if you need tell the judges x something put it in the remark section or send a separate x email message to the judges x x information from the author section will be published unless x y was given to the respective author s anon line x x to credit multiple authors include an author section for x each author each should start with author line and x should be found between the entry and build sections x x the entry s remarks should include x what this program does x how to run the program sample args or input x special compile or execution instructions if any x special filename requirements see rule and x information about any data files x why you think the program is obfuscated x note if this entry is a re submission of a previous entry x any other remarks humorous or otherwise x x do not rot your entry s remarks you may suggest that certain x portions of your remarks be rot ed if your entry wins an award x x info files should be used only to supplement your entry they x should not be required to exist x x if your entry does not need an info file skip the info x section if your entry needs multiple info files use multiple x info sections one per info file you should describe x each info file in the remark section x x if your entry is selected as a winner it will be modified as follows x x build is incorporated into a makefile and build is removed x prog c is renamed to your entry s title followed by an optional x digit followed by c x your entry is compiled into a file with the name of your entry s x title possibly followed by a digit x x if your entry requires that a build file exist state so in your x entry s remark section the makefile will be arranged to execute a x build shell script containing the build information the name of x this build shell script will be your entry s title possibly followed x by a digit followed by sh x x if needed your entry s remarks should indicate how your entry must x be changed in order to deal with the new filenames x x the build file the source and the resulting executable should be x treated as read only files if your entry needs to modify these files x it should make and modify a copy of the appropriate file if this x occurs state so in your entry s remarks x x entries that cannot be compiled by an ansi c compiler will be rejected x use of common c k r extensions is permitted as long as it does not x cause compile errors for ansi c compilers x x the program must be of original work all programs must be in the x public domain all copyrighted programs will be rejected x x entries must be received prior to may utc utc is x essentially equivalent to greenwich mean time email your entries to x x apple pyramid sun uunet hoptoad obfuscate x obfuscate toad com x x we request that your message use the subject ioccc entry x x if possible we request that you hold off on emailing your entries x until mar utc early entries will be accepted however x we will attempt to email a confirmation to the the first author for x all entries received after mar utc x x each person may submit up to entries per contest year each entry x must be sent in a separate email letter x x entries requiring human interaction to be built are not allowed x compiling an entry produce a file or files which may be executed x x programs that require special privileges setuid setgid super user x special owner or group are not allowed x x xfor more information x x the judging will be done by landon noll and larry bassel please send x questions or comments about the contest to x x apple pyramid sun uunet hoptoad judges not the address for x judges toad com submitting entries x x the rules and the guidelines may and often do change from year to x year you should be sure you have the current rules and guidelines x prior to submitting entries to obtain them send email to the address x above and use the subject send rules x x one may obtain winners of previous contests to date via ftp from x x host ftp uu net x user anonymous x pass yourname yourhost x dir pub ioccc x x as a last resort previous winners may be obtained by sending email x to the above address please use the subject send year winners x where year is a single digit year a year range or all x x xchongo landon curt noll cc chongo toad com xlarry bassel lab sun com shar eof chmod rules echo restore of rules failed set wc c rules wc c if test wc c then echo original size current size wc c fi guidelines echo x extracting guidelines text sed s x shar eof guidelines x th international obfuscated c code contest guidelines hints and comments x xcopyright c landon curt noll larry bassel xall rights reserved permission for personal education or non profit use is xgranted provided this this copyright and notice are included in its entirety xand remains unaltered all other uses must receive prior permission in writing xfrom both landon curt noll and larry bassel x xabout this file x x this file is intended to help people who wish to submit entries to x the international obfuscated c code contest ioccc for short x x this is not the ioccc rules though it does contain comments about x them the guidelines should be viewed as hints and suggestions x entries that violate the guidelines but remain within the rules are x allowed even so you are safer if you remain within the guidelines x x you should read the current ioccc rules prior to submitting entries x the rules are typically sent out with these guidelines x x changes from the draft are noted by change bars x x xwhat is new in x x the entry format is better for us anyway the program mkentry c x has been updated see entry format x x we will reject entries that cannot be compiled using an ansi c x compiler certain old obfuscation hacks that cause ansi c compilers x fits are no longer permitted some of the new issues deal with x non integral array types variable number of arguments c preprocessor x directives and the exit function see our likes and dislikes x x xhints and suggestions x x you are encouraged to examine the winners of previous contests see x for more information for details on how to get previous winners x x keep in mind that rules change from year to year so some winning entries x may not be valid entries this year what was unique and novel one year x might be old the next year x x an entry is usually examined in a number of ways we typically apply x a number of tests to an entry x x look at the original source x convert ansi tri graphs to ascii x c pre process the source ignoring include lines x c pre process the source ignoring define and include lines x run it through a c beautifier x examine the algorithm x lint it x compile it x execute it x x you should consider how your entry looks in each of the above tests x you should ask yourself if your entry remains obscure after it has been x cleaned up by the c pre processor and a c beautifier x x your entry need not do well under all or in most tests in certain x cases a test is not important entries that compete for the x strangest most creative source layout need not do as well as x others in terms of their algorithm on the other hand given x two such entries we are more inclined to pick the entry that x does something interesting when you run it x x we try to avoid limiting creativity in our rules as such we leave x the contest open for creative rule interpretation as in real life x programming interpreting a requirements document or a customer request x is important for this reason we often award worst abuse of the x rules to an entry that illustrates this point in an ironic way x x if you do plan to abuse the rules we suggest that you let us know x in the remarks section please note that an invitation to abuse x is not an invitation to break we are strict when it comes to the x byte size limit also abusing the entry format tends to x annoy more than amuse x x we do realize that there are holes in the rules and invite entries x to attempt to exploit them we will award worst abuse of the rules x and then plug the hole next year even so we will attempt to use x the smallest plug needed if not smaller x x check out your program and be sure that it works we sometimes make x the effort to debug an entry that has a slight problem particularly x in or near the final round on the other hand we have seen some x of the best entries fall down because they didn t work x x we tend to look down on a prime number printer that claims that x is a prime number if you do have a bug you are better off x documenting it noting this entry sometimes prints the th power x of a prime by mistake would save the above entry and sometimes x a strange bug feature can even help the entry of course a correctly x working entry is best x x xour likes and dislikes x x doing masses of defines to obscure the source has become old we x tend to see thru masses of defines due to our pre processor tests x that we apply simply abusing defines or dfoo bar won t go as far x as a program that is more well rounded in confusion x x many ansi c compilers dislike the following code and so do we x x define d define x d foo don t expect this to turn into define foo x x int i x j don t use such implicit type declaration x int k x x we suggest that you compile your entry with an ansi c compiler if you x must use non ansi c such as k r c you must avoid areas that result in x compile link errors for ansi c compilers x x unfortunately some ansi c compilers require array indexes to be of x integral type thus the following classical obfuscation hacks should x not be used in this rule may be relaxed in future contests x x int i x char c x i c use c i instead x i string use string i instead x x if your entry uses functions that have a variable number of x arguments be careful systems implement va list as a wide variety x of ways because of this a number of operations using va list are x not portable and must not be used x x assigning a non va list variable to from a va list variable x casting a non va list variable into from a va list variable x passing a va list variable to a function expecting a non va list arg x passing a non va list variable to a function expecting a va list arg x performing arithmetic on va list variables x using va list as a structure or union x x in particular do not treat va list variables as if they were a char s x x avoid using varargs h use stdarg h instead x x if you use c preprocessor directives define if ifdef x the leading must be the first character on a line while some x c preprocessors allow whitespace the leading many do not x x because the exit function returns void on some systems entries x must not assume that it returns an int x x small programs are best when they are short obscure and concise x while such programs are not as complex as other winners they do x serve a useful purpose they are often the only program that people x attempt to completely understand for this reason we look for x programs that are compact and are instructional x x one line programs should be short one line programs say around x bytes long getting close to bytes is a bit too long in our opinion x x we tend to dislike programs that x x are very hardware specific x are very os or un x version specific x index strchr differences are ok but socket streams specific x code is likely not to be x dump core or have compiler warnings x it is ok only if you warn us in the remark header item x won t compile under both bsd or sys v un x x abusing the build file to get around the size limit x obfuscate by excessive use of ansi tri graphs x are longer than they need to be x are similar to previous winners x are identical to previous losers x x unless you are cramped for space or unless you are entering the x best one liner category we suggest that you format your program x in a more creative way than simply forming excessively long lines x x the build file should not be used to try and get around the size x limit it is one thing to make use of a several d s to help out x but it is quite another to use bytes of d s in order to x try and squeeze the source under the size limit you should feel x free to make use of the build file space but you are better off x if you show some amount of restraint x x we allowed whitespace and in certain cases or do not impact x your program size up to a certain point because we want to get x away from source that is simply a compact blob of characters x x given two versions of the same program one that is a compact blob x of code and the other that is formatted more like a typical c x program we tend to favor the second version of course a third x version of the same program that is formatted in an interesting x and or obfuscated way would definitely win over the first two x x we suggest that you avoid trying for the smallest self replicating x program we are amazed at the many different sizes that claim x to be the smallest there is nothing wrong with self replicating x programs in fact a number of winners have been self replicating x you might want to avoid the claim of smallest lest we or others x know of a smaller one x x x client entries should be as portable as possible entries that x adapt to a wide collection of environments will be favored don t x depend on a particular type of display for example don t depend x on color or a given size don t require backing store x x x client entries should avoid using x related libraries and x software that is not in wide spread use we ask that such x client x entries restrict themselves to only the low level xlib and the x athena widget set libx a libxaw a libxmu a and libxt a x don t use m tif xv ew or openl ok toolkits since not everyone x has them avoid depending on a particular window manager not x everyone has x r and some people are stuck back in x r or x earlier so try to target x r without requiring x r better x yet try to make your entry run on all version x window systems x x x client entries should not to depend on particular items on x xdefaults if you must do so be sure to note the required lines x in the remark section x x we like programs that x x are as concise and small as they need to be x do something at least quasi interesting x pass lint without complaint not a requirement but it is nice x are portable x are unique or novel in their obfuscation style x make use of a number of different types of obfuscation x make us laugh and or throw up x x some types of programs can t excel in some areas of course your x program doesn t have to excel in all areas but doing well in several x areas really does help x x we freely admit that interesting creative or humorous comments in x the remark section helps your chance of winning if you had to x read of many twisted entries you too would enjoy a good laugh or two x we think the readers of the contest winners do as well x x be creative x x xentry format x x in order to help us process the many entries we must request your x assistance by formatting your entries in a certain way this format x in addition allows us to quickly separate information about the x author from the program itself see judging process x x we have provided the program mkentry as an example of how to x format entries you should be aware of the following warning that x is found in mkentry c x x this program attempts to implement the ioccc rules every x attempt has been made to make sure that this program produces x an entry that conforms to the contest rules in all cases x where this program differs from the contest rules the x contest rules will be used be sure to check with the x contest rules before submitting an entry x x you are not required to use mkentry it is convenient however x as it attempts to uuencode the needed files and attempt to check x the entry against the size rules x x if you have any suggestions comments fixes or complaints about x the mkentry c program please send email to the judges see below x x the following is a sample entry x x entry xrule xfix n xtitle chonglab xentry xdate mon mar xhost un x v pdp x bsd pdp x remark x this is a non obfuscated obfuscated c program x x it is likely not to win a prize but what do you expect from x a short example x author xname landon curt noll xorg ioccc judging group xaddr toad hall x po box x san francisco california x x usa xemail chongo toad com xanon n x author xname larry bassel xorg ioccc judging group xaddr toad hall x po box x san francisco california x x usa xemail hoptoad sun lab x lab sun com xanon n x info x end x x typically the build file should assume that the source is prog c x and will compile into prog if an entry wins we will rename x its source and binary to avoid filename collision by tradition x we use the name of the entry s title followed by an optional x digit in case of name conflicts x x if the above entry somehow won the least likely to win award x we would use chonglab c and chonglab x x if your entry depends on or requires that your build source x and or binary files be a particular name please say so in the x remark section if this case applies it would be be helpful x if you did one of the following x x tell us how to change the filename s in your entry x x have the build file make copies of the files for example x x cc prog c o special name need special binary x x or rm f special src c need special source x cp prog c special src c x cc special src c o special name x x or rm f special build need special build x tail build special build x sh special build x x assume that we will use the entry title send us a version of x your build program files that uses the name convention you x should uuencode these files in data sections x x if your entry needs to modify its source info or binary files x please say so in the remark section you should try to avoid x touching your original build source and binary files you should x arrange to make copies of the files you intend to modify this x will allow people to re generate your entry from scratch x x remember that your entry may be built without a build file we x typically incorporate the build lines into a makefile if the x build file must exist say so in the remark section x x if your entry needs special info files you should uuencode them x into info sections in the case of multiple info files x use multiple info sections if no info files are needed x then skip the info section x x info files are intended to be input or detailed information that x does not fit well into the remark section for example an x entry that implements a compiler might want to provide some sample x programs for the user to compile an entry might want to include a x lengthy design document that might not be appropriate for a x hints file x x info files should be used only to supplement your entry for x example info files may provide sample input or detailed x information about your entry because they are supplemental x the entry should not require them exist x x in some cases your info files might be renamed to avoid name x conflicts if info files should not be renamed for some reason x say so in the remark section x x info files must uudecode into the current directory if they x absolutely must be renamed or moved into a sub directory say x so in the remark section x x when submitting multiple entries be sure that each entry has x a unique entry number from to your first entry should x have entry number x x with the exception of the header all text outside of the entry x format may be ignored that is don t place text outside of the x entry and expect the judges to see it our decoding tools aren t x ai progs if you need tell the the something put it in the x remark section or send a email to the judges at x x apple pyramid sun uunet hoptoad judges not the address for x judges toad com submitting entries x x the date should be given with respect to utc some systems refer x to this as gmt or gmt the format of the date should be that as x returned by asctime in the c locale an example of such a string is x x thr apr x x this format is similar to the output of the date command the x string does not include the timezone name before the year on many x systems one of the following command will produce a similar string x x date u a h d t y x date u sed e s x sh c tz utc date sed e s x sh c tz gmt date sed e s x sh c tz gmt date sed e s x x you are allowed to update fix revise your entry to do so set x the fix line in the entry section to y instead of n x be sure that the resubmittion uses the same title and entry number x as well as these are used to determine which entry is to be x replaced x x xjudging process x x entries are judged by larry bassel and landon curt noll x x entries are unpacked into individual directories the email message x is unpacked into individual files each containing x x entry section x all author sections x all info sections x build section x program section x any other text including the email message headers x x prior to judging the any other text file is scanned to be sure x it does not contain useful information or in case the entry was x malformed and did not unpack correctly information from the x author sections are not read until the judging process is x complete and then only from entries that have won an award x x the above process helps keep us biased for against any one particular x individual we are usually kept in the dark as much as you are x until the final awards are given we like the surprise of finding x out in the end who won and where they were from x x we attempt to keep all entries anonymous unless they win an award x because the main prize of winning is being announced we make all x attempts to send non winners into oblivion we remove all non winning x files and shred all related paper by tradition we do not even x reveal the number of entries that we received for the curious x we do indicate the volume of paper consumed when presenting the ioccc x winners at talks x x after the usenix announcement we attempt to send email to the x authors of the winning entries one reason we do this is to give x the authors a chance to comment on the way we have presented their x entry they are given the chance to correct mistakes typos we x often accept their suggestions comments about our remarks as well x this is done prior to posting the winners to the wide world x x judging consists of a number of elimination rounds during a round x the collection of entries are divided into two roughly equal piles x the pile that advances on to the next round and the pile that does x not we also re examine the entries that were eliminated in the x previous round thus an entry gets at least two readings x x a reading consists of a number of actions x x reading the entry section x reading the uudecoded build section x reading the uudecoded program section x reading the uudecoded info section s if any x passing the source thru the c pre processor x shipping over any include files x performing a number of c beautify cleanup edits on the source x passing the beautified source thru the c pre processor x shipping over any include files x x in later rounds other actions are performed x x linting the source x compiling building the source x running the program x performing misc tests on the source and binary x x until we reduce the stack of entries down to about entries entries x are judged on an individual basis an entry is set aside because it x does not in our opinion meet the standard established by the round x when the number of entries thins to about entries we begin to form x award categories entries begin to compete with each other for awards x an entry often will compete in several categories x x the actual award category list will vary depending on the types of entries x we receive a typical category list might be x x best small one line program x best small program x strangest most creative source layout x most useful obfuscated program x best game that is obfuscated x most creatively obfuscated program x most deceptive c code x best x client see our likes and dislikes x best abuse of ansi c x worst abuse of the rules x anything else so strange that it deserves an award x x we do not limit ourselves to this list for example a few entries are so x good bad that they are declared winners at the start of the final round x we will invent awards categories for them if necessary x x in the final round process we perform the difficult tasks of x reducing the remaining entries typically about down to or x winners often we are confident that the entries that make it into x the final round are definitely better than the ones that do not x make it the selection of the winners out of the final round is x less clear cut x x sometimes a final round entry good enough to win but is beat out x by a similar but slightly better entry for this reason it is x sometimes worthwhile to re enter an improved version of an entry x that failed to win in a previous year this assumes of course x that the entry is worth improving in the first place x x more often that not we select a small entry usually one line a x strange creative layout entry and an entry that abuses the contest x rules in some way x x in the end we traditionally pick one entry as best sometimes such x an entry simply far exceeds any of the other entry more often the x best is picked because it does well in a number of categories x x xannouncement of winners x x the first announcement occurs at a summer usenix conference by tradition x this is done during the latter part of the uunet ioccc bof just prior to x the berkeley bsd and bsdi bof x x winning entries will be posted in late june to the following groups x x comp lang c comp unix wizards alt sources x x in addition pointers to these postings are posted to the following x x comp sources d alt sources d misc misc x comp sources misc comp windows x x x winning entries will be deposited into the uunet archives see x below for details x x often winning entries are published in selected magazines winners x have appeared in books the new hackers dictionary and on t shirts x x last but not least winners receive international fame and flames x x xfor more information x x you may contact the judges by sending email to the following address x x apple pyramid sun uunet hoptoad judges not the address for x judges toad com submitting entries x x questions and comments about the contest are welcome x x the rules and the guidelines may and often do change from year to x year you should be sure you have the current rules and guidelines x prior to submitting entries to obtain them send email to the address x above and use the subject send rules x x one may obtain winners of previous contests to date via ftp from x x host ftp uu net x user anonymous x pass yourname yourhost x dir pub ioccc x x as a last resort previous winners may be obtained by sending email x to the above address please use the subject send year winners x where year is a single digit year a year range or all x x xchongo landon curt noll cc chongo toad com xlarry bassel lab sun com shar eof chmod guidelines echo restore of guidelines failed set wc c guidelines wc c if test wc c then echo original size current size wc c fi echo end of part continue with part exit sunnyvale residents vote landon noll for sunnyvale city council seat
