convert spoiler language and towards deobfuscation language
This commit is contained in:
1 parent
50a2a6293c
commit
4d6009b58f
98 files changed
+195
-358
No files matched your search
@@ -62,12 +62,12 @@ This code has been compiled and tested on:
|
||||
* X86-FreeBSD 10.3, clang 3.4.1, -O0 and -O3
|
||||
* TCC 0.9.26 (x86-64), used as a proxy for [2001/bellard](../../2001/bellard/index.html)
|
||||
* UNIX V7 pcc (Johnson's C compiler) on a [simulated PDP-11/45](http://simh.trailing-edge.com/)
|
||||
(see spoiler for further detail)
|
||||
(see the "**DEOBFUSCATION** section below for further detail)
|
||||
|
||||
<div style="margin-bottom:60em;margin-top:4em"><strong>Spoiler below; scroll down.</strong></div>
|
||||
<div style="margin-bottom:60em;margin-top:4em"><strong>Deobfuscation information below; scroll down.</strong></div>
|
||||
|
||||
|
||||
### SPOILER:
|
||||
### DEOBFUSCATION:
|
||||
|
||||
This started life as a personal challenge: write the shortest hex dump utility
|
||||
in C.
|
||||
@@ -172,7 +172,7 @@ but it uses more characters in just setting up its obfuscation than this entire
|
||||
solution!
|
||||
|
||||
|
||||
### BIGGER SPOILER:
|
||||
### MORE DEOBFUSCATION:
|
||||
|
||||
If you are unhappy with the way DEL (character 127) is handled,
|
||||
replace the cryptic expression `4<(4^l>>5)?l:46` with `32>l|l>126?46:l`.
|
||||
@@ -180,7 +180,7 @@ Both take the same number of characters, but the former is a bit more interestin
|
||||
Bonus question: how does the first expression work?
|
||||
|
||||
|
||||
### BIGGEST SPOILER (and some history):
|
||||
### EVEN MORE DEOBFUSCATION (and some history):
|
||||
|
||||
Technically, `char o[0];` is illegal (SS 6.7.6.2) according to ISO (N1570). And
|
||||
`char o[];` is a conditionally supported feature (SS 6.7.6.2, 6.10.8.3).
|
||||
|
||||
@@ -432,12 +432,12 @@ It adds several nice-to-have features, and allows salt-to-taste customizability.
|
||||
<li>X86-FreeBSD 10.3, clang 3.4.1, -O0 and -O3</li>
|
||||
<li>TCC 0.9.26 (x86-64), used as a proxy for <a href="../../2001/bellard/index.html">2001/bellard</a></li>
|
||||
<li>UNIX V7 pcc (Johnson’s C compiler) on a <a href="http://simh.trailing-edge.com/">simulated PDP-11/45</a>
|
||||
(see spoiler for further detail)</li>
|
||||
(see the “<strong>DEOBFUSCATION</strong> section below for further detail)</li>
|
||||
</ul>
|
||||
<div style="margin-bottom:60em;margin-top:4em">
|
||||
<strong>Spoiler below; scroll down.</strong>
|
||||
<strong>Deobfuscation information below; scroll down.</strong>
|
||||
</div>
|
||||
<h3 id="spoiler">SPOILER:</h3>
|
||||
<h3 id="deobfuscation">DEOBFUSCATION:</h3>
|
||||
<p>This started life as a personal challenge: write the shortest hex dump utility
|
||||
in C.</p>
|
||||
<p>The self-imposed ground rules in the hunt for shortest:</p>
|
||||
@@ -514,12 +514,12 @@ and it is more interesting to remove characters by changing code than by filteri
|
||||
<a href="../../1986/bright/index.html">1986/bright</a> is similar in function,
|
||||
but it uses more characters in just setting up its obfuscation than this entire
|
||||
solution!</p>
|
||||
<h3 id="bigger-spoiler">BIGGER SPOILER:</h3>
|
||||
<h3 id="more-deobfuscation">MORE DEOBFUSCATION:</h3>
|
||||
<p>If you are unhappy with the way DEL (character 127) is handled,
|
||||
replace the cryptic expression <code>4<(4^l>>5)?l:46</code> with <code>32>l|l>126?46:l</code>.
|
||||
Both take the same number of characters, but the former is a bit more interesting.
|
||||
Bonus question: how does the first expression work?</p>
|
||||
<h3 id="biggest-spoiler-and-some-history">BIGGEST SPOILER (and some history):</h3>
|
||||
<h3 id="even-more-deobfuscation-and-some-history">EVEN MORE DEOBFUSCATION (and some history):</h3>
|
||||
<p>Technically, <code>char o[0];</code> is illegal (SS 6.7.6.2) according to ISO (N1570). And
|
||||
<code>char o[];</code> is a conditionally supported feature (SS 6.7.6.2, 6.10.8.3).
|
||||
However, it works in modern C implementations as an extension, including GCC,
|
||||
|
||||
@@ -157,13 +157,11 @@ designed to allow exhaustive, hand-counted values for comparison with the tool v
|
||||
These test cases were vital in debugging and regression testing, and provided a way to
|
||||
determine which tool was correct when there were differences.
|
||||
|
||||
```
|
||||
A version of this tool in more clearly written C
|
||||
is presented for the Judge's consideration as a more accurate replacement for `iocccsize`.
|
||||
This obfuscated entry is derived from (and compatible with) that code,
|
||||
but due to obfuscation, has had some significant, deep changes for the contest.
|
||||
Nevertheless, the more clearly written code remains a spoiler for this entry.
|
||||
```
|
||||
> A version of this tool in more clearly written C<br>
|
||||
> is presented for the Judge's consideration as a more accurate replacement for `iocccsize`.<br>
|
||||
> This obfuscated entry is derived from (and compatible with) that code,<br>
|
||||
> but due to obfuscation, has had some significant, deep changes for the contest.<br>
|
||||
> Nevertheless, the more clearly written code remains deobfuscation information about this entry.
|
||||
|
||||
NB: `iocccsize` gets a different answer from `tac` on its own
|
||||
[iocccsize.c](%%REPO_URL%%/2018/iocccsize.c) source code;
|
||||
|
||||
@@ -506,11 +506,13 @@ whitespace surrounds English words, not necessarily C tokens, as in <code>a+=1;<
|
||||
designed to allow exhaustive, hand-counted values for comparison with the tool values.
|
||||
These test cases were vital in debugging and regression testing, and provided a way to
|
||||
determine which tool was correct when there were differences.</p>
|
||||
<pre><code> A version of this tool in more clearly written C
|
||||
is presented for the Judge's consideration as a more accurate replacement for `iocccsize`.
|
||||
This obfuscated entry is derived from (and compatible with) that code,
|
||||
but due to obfuscation, has had some significant, deep changes for the contest.
|
||||
Nevertheless, the more clearly written code remains a spoiler for this entry.</code></pre>
|
||||
<blockquote>
|
||||
<p>A version of this tool in more clearly written C<br>
|
||||
is presented for the Judge’s consideration as a more accurate replacement for <code>iocccsize</code>.<br>
|
||||
This obfuscated entry is derived from (and compatible with) that code,<br>
|
||||
but due to obfuscation, has had some significant, deep changes for the contest.<br>
|
||||
Nevertheless, the more clearly written code remains deobfuscation information about this entry.</p>
|
||||
</blockquote>
|
||||
<p>NB: <code>iocccsize</code> gets a different answer from <code>tac</code> on its own
|
||||
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/iocccsize.c">iocccsize.c</a> source code;
|
||||
<code>tac</code> gets the correct answer. This is due to the aforementioned bugs within <code>iocccsize</code>,
|
||||
|
||||
+11
-11
@@ -117,7 +117,7 @@ If you find yourself in an evolutionary dead end, try:
|
||||
0. Preface
|
||||
1. What it is
|
||||
2. How it works
|
||||
3. Hints (Keyboards, Options, Spoilers, Example Invocations)
|
||||
3. Hints (Keyboards, Options, Deobfuscation, Example Invocations)
|
||||
4. Obfuscation (Techniques, Beauty)
|
||||
5. How to build (S and N Constants, Compilation, Portability, Installing)
|
||||
6. Final thoughts
|
||||
@@ -125,10 +125,10 @@ If you find yourself in an evolutionary dead end, try:
|
||||
|
||||
## **0. Preface**
|
||||
|
||||
**SPOILER WARNING: A great deal of this document and the man page is full of
|
||||
spoilers of different types; as such I would recommend that you try running the
|
||||
**DEOBFUSCATION NOTES: A great deal of this document and the man page is full of
|
||||
deobfuscation information of different types; as such I would recommend that you try running the
|
||||
judges suggested invocations as well as running `make test` before you get into
|
||||
the document or the man page, unless you don't mind any spoilers. I don't reveal
|
||||
the document or the man page, unless you don't mind reading deobfuscation information. I don't reveal
|
||||
much in the way of obfuscation however so if you just want documentation on the
|
||||
program, how to compile, etc. then there isn't need to heed this note.**
|
||||
|
||||
@@ -165,7 +165,7 @@ thoroughly in **[Hints](#hints)**).
|
||||
**[Hints](#hints):** Perhaps the longest part of this document because in it I
|
||||
document the [keyboards](#keyboards), [options](#options), subtleties, including
|
||||
features that might appear to be bugs but aren't - including an
|
||||
[input error](#error), an [Easter egg spoiler](#spoiler) and quite a few
|
||||
[input error](#error), an [Easter egg obfuscation](#obfuscation) and quite a few
|
||||
[example invocations](#invocations). If you've read the man page you probably
|
||||
don't need this unless there is something specific you're after.
|
||||
|
||||
@@ -263,7 +263,7 @@ try and show the way they work) for those interested I will cite the summary:
|
||||
the fittest individuals dominating over the weaker ones.
|
||||
```
|
||||
|
||||
**SPOILER WARNING: Some of the below might help you follow the code more
|
||||
**DEOBFUSCATION NOTE: Some of the below might help you follow the code more
|
||||
easily.**
|
||||
|
||||
For each *generation* there is a total of `N` *offspring*; generation 0 is
|
||||
@@ -387,7 +387,7 @@ can actually produce but there is a certain type of input error that might
|
||||
### Options
|
||||
</div>
|
||||
|
||||
Skip to [Spoilers](#spoiler).
|
||||
Skip to the [deobfuscation section](#deobfuscation).
|
||||
|
||||
There are a number of options you can pass to the program besides the target
|
||||
string; some I will document here (the summary being in the man page). You can
|
||||
@@ -453,7 +453,7 @@ decent parameters - come to an answer here but if necessary kill the program.
|
||||
|
||||
4. Repeat the steps only this time don't enable quiet mode. Look at the
|
||||
offspring output. If you still don't see what it is and want to know see
|
||||
**[Spoilers](#spoiler)** below.
|
||||
**[Deobfuscation information](#deobfuscation)** below.
|
||||
|
||||
Finally any argument that doesn't start with a `-` passed into the program
|
||||
will become the target string. The same rule applies to the number for `-r`:
|
||||
@@ -558,8 +558,8 @@ it no longer cares about the `-` for option parsing. In other words options
|
||||
are only parsed if the first character is `-` and if the parser hasn't seen
|
||||
the `-` - *in an earlier element of `argv`. This is not a bug!*
|
||||
|
||||
<div id="spoiler">
|
||||
### Spoilers
|
||||
<div id="deobfuscation">
|
||||
### Deobfuscation
|
||||
</div>
|
||||
|
||||
Skip to [Example Invocations](#invocations).
|
||||
@@ -981,7 +981,7 @@ implementation of the Weasel program otherwise).
|
||||
There is obviously a reason `38` is the chosen size but the only hints I
|
||||
provide are those in **[How it works](#how)** and specifically an Easter egg I
|
||||
referenced there (it's *not the only Easter egg* but it's the only Easter egg I
|
||||
won't spoil; yes this ironically and amusingly means I've left a rotten egg
|
||||
won't deobfuscate; yes this ironically and amusingly means I've left a rotten egg
|
||||
somewhere!).
|
||||
|
||||
The Makefile simplifies how to reconfigure this value with the variable
|
||||
|
||||
+10
-12
@@ -470,17 +470,17 @@ while using more Cenozoic minded code migration, read <a href="rpm.html">rpm.htm
|
||||
<li>Preface</li>
|
||||
<li>What it is</li>
|
||||
<li>How it works</li>
|
||||
<li>Hints (Keyboards, Options, Spoilers, Example Invocations)</li>
|
||||
<li>Hints (Keyboards, Options, Deobfuscation, Example Invocations)</li>
|
||||
<li>Obfuscation (Techniques, Beauty)</li>
|
||||
<li>How to build (S and N Constants, Compilation, Portability, Installing)</li>
|
||||
<li>Final thoughts</li>
|
||||
<li>Winning comments, thanks, dedications, links, etc.</li>
|
||||
</ol>
|
||||
<h2 id="preface"><strong>0. Preface</strong></h2>
|
||||
<p><strong>SPOILER WARNING: A great deal of this document and the man page is full of
|
||||
spoilers of different types; as such I would recommend that you try running the
|
||||
<p><strong>DEOBFUSCATION NOTES: A great deal of this document and the man page is full of
|
||||
deobfuscation information of different types; as such I would recommend that you try running the
|
||||
judges suggested invocations as well as running <code>make test</code> before you get into
|
||||
the document or the man page, unless you don’t mind any spoilers. I don’t reveal
|
||||
the document or the man page, unless you don’t mind reading deobfuscation information. I don’t reveal
|
||||
much in the way of obfuscation however so if you just want documentation on the
|
||||
program, how to compile, etc. then there isn’t need to heed this note.</strong></p>
|
||||
<p>I was at a loss on how to present my remarks; on the one hand I wanted to give
|
||||
@@ -509,7 +509,7 @@ thoroughly in <strong><a href="#hints">Hints</a></strong>).</p>
|
||||
<p><strong><a href="#hints">Hints</a>:</strong> Perhaps the longest part of this document because in it I
|
||||
document the <a href="#keyboards">keyboards</a>, <a href="#options">options</a>, subtleties, including
|
||||
features that might appear to be bugs but aren’t - including an
|
||||
<a href="#error">input error</a>, an <a href="#spoiler">Easter egg spoiler</a> and quite a few
|
||||
<a href="#error">input error</a>, an <a href="#obfuscation">Easter egg obfuscation</a> and quite a few
|
||||
<a href="#invocations">example invocations</a>. If you’ve read the man page you probably
|
||||
don’t need this unless there is something specific you’re after.</p>
|
||||
<p><strong><a href="#obfuscation">Obfuscation</a>:</strong> Some of the techniques that might not be used.</p>
|
||||
@@ -580,7 +580,7 @@ try and show the way they work) for those interested I will cite the summary:</p
|
||||
principles first laid down by Charles Darwin of "survival of the fittest.".
|
||||
Since in nature, competition among individuals for scanty resources results in
|
||||
the fittest individuals dominating over the weaker ones.</code></pre>
|
||||
<p><strong>SPOILER WARNING: Some of the below might help you follow the code more
|
||||
<p><strong>DEOBFUSCATION NOTE: Some of the below might help you follow the code more
|
||||
easily.</strong></p>
|
||||
<p>For each <em>generation</em> there is a total of <code>N</code> <em>offspring</em>; generation 0 is
|
||||
the pseudo-randomly initialised array <em>without parents.</em> Each offspring has its
|
||||
@@ -664,7 +664,7 @@ it includes a literal space <code>' '</code> but it doesn’t include other
|
||||
can actually produce but there is a certain type of input error that might
|
||||
<em>appear</em> to be a bug; see specifically <a href="#error">Input Error Example</a>.</p>
|
||||
<h3 id="options">Options</h3>
|
||||
<p>Skip to <a href="#spoiler">Spoilers</a>.</p>
|
||||
<p>Skip to the <a href="#deobfuscation">deobfuscation section</a>.</p>
|
||||
<p>There are a number of options you can pass to the program besides the target
|
||||
string; some I will document here (the summary being in the man page). You can
|
||||
join options but there is a caveat with spaces and <code>-r</code> option as well as
|
||||
@@ -708,7 +708,7 @@ With the default string most modern systems shouldn’t take much time to - give
|
||||
decent parameters - come to an answer here but if necessary kill the program.</p></li>
|
||||
<li><p>Repeat the steps only this time don’t enable quiet mode. Look at the
|
||||
offspring output. If you still don’t see what it is and want to know see
|
||||
<strong><a href="#spoiler">Spoilers</a></strong> below.</p></li>
|
||||
<strong><a href="#deobfuscation">Deobfuscation information</a></strong> below.</p></li>
|
||||
</ol>
|
||||
<p>Finally any argument that doesn’t start with a <code>-</code> passed into the program
|
||||
will become the target string. The same rule applies to the number for <code>-r</code>:
|
||||
@@ -770,9 +770,7 @@ itself) and then the target string would <em>literally</em> be set to <code>-r</
|
||||
it no longer cares about the <code>-</code> for option parsing. In other words options
|
||||
are only parsed if the first character is <code>-</code> and if the parser hasn’t seen
|
||||
the <code>-</code> - <em>in an earlier element of <code>argv</code>. This is not a bug!</em></p>
|
||||
<div id="spoiler">
|
||||
<h3 id="spoilers">Spoilers</h3>
|
||||
</div>
|
||||
<h3 id="deobfuscation">Deobfuscation</h3>
|
||||
<p>Skip to <a href="#invocations">Example Invocations</a>.</p>
|
||||
<p>The Easter egg: Since Dawkins references the <a href="https://en.wikipedia.org/wiki/Infinite_monkey_theorem">Infinite Monkey Theorem</a> it
|
||||
simulates a monkey using a typewriter! This mode has the following changes:</p>
|
||||
@@ -1071,7 +1069,7 @@ implementation of the Weasel program otherwise).</p>
|
||||
<p>There is obviously a reason <code>38</code> is the chosen size but the only hints I
|
||||
provide are those in <strong><a href="#how">How it works</a></strong> and specifically an Easter egg I
|
||||
referenced there (it’s <em>not the only Easter egg</em> but it’s the only Easter egg I
|
||||
won’t spoil; yes this ironically and amusingly means I’ve left a rotten egg
|
||||
won’t deobfuscate; yes this ironically and amusingly means I’ve left a rotten egg
|
||||
somewhere!).</p>
|
||||
<p>The Makefile simplifies how to reconfigure this value with the variable
|
||||
<code>MAX_SIZE</code>:</p>
|
||||
|
||||
@@ -65,7 +65,7 @@ So I had to sit down and solve those tricky questions with Nano and a C
|
||||
compiler.
|
||||
|
||||
|
||||
### Little spoilers:
|
||||
### A bit of deobfuscation:
|
||||
|
||||
Basically, the program draws animated ASCII art of the Big Dipper using Annie
|
||||
Jump Cannon's spectral classification system of stars and I think the colors of
|
||||
@@ -121,7 +121,7 @@ mostly is okay. YMMV, as they say.
|
||||
Please do not feed little babies chocolate.
|
||||
|
||||
|
||||
### Major spoilers:
|
||||
### Major deobfuscation:
|
||||
|
||||
I incorporated the [Fletcher 16 checksum
|
||||
algorithm](https://en.wikipedia.org/wiki/Fletcher%27s_checksum) into the source
|
||||
|
||||
@@ -429,7 +429,7 @@ file <em>poikola.pdf</em>.</p>
|
||||
this star and may I have some Easter eggs?”</p>
|
||||
<p>So I had to sit down and solve those tricky questions with Nano and a C
|
||||
compiler.</p>
|
||||
<h3 id="little-spoilers">Little spoilers:</h3>
|
||||
<h3 id="a-bit-of-deobfuscation">A bit of deobfuscation:</h3>
|
||||
<p>Basically, the program draws animated ASCII art of the Big Dipper using Annie
|
||||
Jump Cannon’s spectral classification system of stars and I think the colors of
|
||||
the output are as accurate as possible.</p>
|
||||
@@ -467,7 +467,7 @@ show anything at all. In other cases it won’t show all the colours right but
|
||||
mostly is okay. YMMV, as they say.</p>
|
||||
<h3 id="warnings-and-restrictions-required-by-law">Warnings and restrictions required by law:</h3>
|
||||
<p>Please do not feed little babies chocolate.</p>
|
||||
<h3 id="major-spoilers">Major spoilers:</h3>
|
||||
<h3 id="major-deobfuscation">Major deobfuscation:</h3>
|
||||
<p>I incorporated the <a href="https://en.wikipedia.org/wiki/Fletcher%27s_checksum">Fletcher 16 checksum
|
||||
algorithm</a> into the source
|
||||
for security reasons; it might be challenging to make changes without breaking
|
||||
|
||||
Reference in new issue
Block a user