improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
@@ -135,50 +135,50 @@ did the basic four operations, but as a programmer, I needed more, so those
|
||||
were added over time.</p>
|
||||
<p><code>calc</code> is a useful, functioning utility. The operators before the obfuscation
|
||||
dance began (this is called foreshadowing):</p>
|
||||
<pre><code>() forced precedence
|
||||
- ~ ? unary minus, compl, byteswap
|
||||
* / % & << >> mul, div, mod, bitand, shift: left, right
|
||||
+ - | ^ add, sub, bitor, xor
|
||||
NUM 0-9</code></pre>
|
||||
<pre><code> () forced precedence
|
||||
- ~ ? unary minus, compl, byteswap
|
||||
* / % & << >> mul, div, mod, bitand, shift: left, right
|
||||
+ - | ^ add, sub, bitor, xor
|
||||
NUM 0-9</code></pre>
|
||||
<p>This seemed like a reasonable candidate to experiment with obfuscation; perhaps
|
||||
it might yield good results.</p>
|
||||
<h2 id="principle-of-operation">Principle of operation</h2>
|
||||
<p>The algorithm was and is rather straightforward:</p>
|
||||
<pre><code>expr() {
|
||||
n = term()
|
||||
t = token()
|
||||
if (t == ADD) return n += expr()
|
||||
if (t == SUB) return n -= expr()
|
||||
if (t == BOR) return n |= expr()
|
||||
if (t == XOR) return n ^= expr()
|
||||
ungettoken(t)
|
||||
return n
|
||||
}
|
||||
term() {
|
||||
n = factor()
|
||||
t = token()
|
||||
if (t == MUL) return n *= term()
|
||||
if (t == DIV) return n /= term()
|
||||
if (t == AND) return n &= term()
|
||||
if (t == RSH) return n >> term()
|
||||
if (t == LSH) return n << term()
|
||||
ungettoken(t)
|
||||
return n
|
||||
}
|
||||
factor() {
|
||||
t = token()
|
||||
if (t == LPAREN) {
|
||||
n = expr()
|
||||
if token() == RPAREN
|
||||
return n
|
||||
error()
|
||||
}
|
||||
if (t == SUB) return -factor()
|
||||
if (t == CMP) return ~factor()
|
||||
if (t == QUE) return byteswap(factor())
|
||||
if (t == DIG) return strtol()
|
||||
error()
|
||||
}</code></pre>
|
||||
<pre><code> expr() {
|
||||
n = term()
|
||||
t = token()
|
||||
if (t == ADD) return n += expr()
|
||||
if (t == SUB) return n -= expr()
|
||||
if (t == BOR) return n |= expr()
|
||||
if (t == XOR) return n ^= expr()
|
||||
ungettoken(t)
|
||||
return n
|
||||
}
|
||||
term() {
|
||||
n = factor()
|
||||
t = token()
|
||||
if (t == MUL) return n *= term()
|
||||
if (t == DIV) return n /= term()
|
||||
if (t == AND) return n &= term()
|
||||
if (t == RSH) return n >> term()
|
||||
if (t == LSH) return n << term()
|
||||
ungettoken(t)
|
||||
return n
|
||||
}
|
||||
factor() {
|
||||
t = token()
|
||||
if (t == LPAREN) {
|
||||
n = expr()
|
||||
if token() == RPAREN
|
||||
return n
|
||||
error()
|
||||
}
|
||||
if (t == SUB) return -factor()
|
||||
if (t == CMP) return ~factor()
|
||||
if (t == QUE) return byteswap(factor())
|
||||
if (t == DIG) return strtol()
|
||||
error()
|
||||
}</code></pre>
|
||||
<h2 id="obfuscation-is-a-process">Obfuscation is a process</h2>
|
||||
<p>Within the above algorithm, there are many details unmentioned, all ripe for
|
||||
obfuscation:</p>
|
||||
|
||||
Reference in new issue
Block a user