bash + iconv + DosBox / x86マシンコード(104 97 96 95文字)
echo ↾각슈삨₲ɻ庲錿ʴ⇍罋곹삄ૃ蘊尧⺓⺂粘ㄾ㸸ਾ岈⺎➉⸠粓蜊㹏褾鄮漧粐蠊蝜⾈葜⾇⼠⺂ꤧ樠獧惇|iconv -futf8 -tucs2>o.com;dosbox o*
これを空のディレクトリのスクリプトに入れることをお勧めします。ターミナルにコピーアンドペーストするとすべてが壊れることがほぼ保証されています。さらに良いことに、ここでスクリプトをすぐに入手できます。
期待される出力: 
使い方
bash部分は、スクリプトのUTF-8文字からファイルiconv
を「解凍」.com
してDosBoxで起動するために使用する単なるランチャーです。
すべての入力シーケンスがiconv
文句を言わずにUCS-2として解釈できるわけではないため、これはコンテンツに何らかの制限を課していることに注意してください。たとえば、何らかの理由で、bx
レジスタを使用する多くの操作が、使用した場所に応じて大混乱を引き起こしたため、この問題を何度か回避する必要がありました。
現在、Unicodeのことは、「文字数」ルールを利用することです。スクリプトの実際のサイズ(バイト単位)は元の.COM
ファイルよりもはるかに大きくなります。
抽出された.com
ファイルは
00000000 be 21 01 ac 88 c2 a8 c0 7d 0a b2 20 7b 02 b2 5e |.!......}.. {..^|
00000010 83 e0 3f 93 b4 02 cd 21 4b 7f f9 ac 84 c0 75 e4 |..?....!K.....u.|
00000020 c3 0a 0a 86 27 5c 93 2e 82 2e 98 7c 3e 31 38 3e |....'\.....|>18>|
00000030 3e 0a 88 5c 8e 2e 89 27 20 2e 93 7c 0a 87 4f 3e |>..\...' ..|..O>|
00000040 3e 89 2e 91 27 6f 90 7c 0a 88 5c 87 2e a6 7c 0a |>...'o.|..\...|.|
00000050 88 2f 5c 84 2e a8 7c 0a 87 2f 20 2f 82 2e 27 a9 |./\...|../ /..'.|
00000060 7c 0a 20 6a 67 73 c7 60 f3 0a 0a 00 ||. jgs.`....|
0000006c
長さは108バイトです。NASMのソースは次のとおりです。
org 100h
start:
; si: pointer to current position in data
mov si,data
; load the character in al
lodsb
mainloop:
; bx: repetition count
; - zero at startup
; - -1 after each RLE run
; - one less than each iteration after each "literal" run
; the constant decrement is not really a problem, as print
; always does at least one print, and there aren't enough
; consecutive literal values to have wraparound
; if the high bit is not set, we have a "literal" byte;
; we prepare it in dl just in case
mov dl,al
; then check if it's not set and branch straight to print
; notice that bx=0 is fine, as print prints always at least one character
; test the top two bits (we need the 6th bit below)
test al,0xc0
; to see if the top bit was set, we interpret it as the sign bit,
; and branch if the number is positive or zero (top bit not set)
jge print
rle:
; it wasn't a literal, but a caret/space with a repetition count
; space if 6th bit not set, caret otherwise
mov dl,' '
; exploit the parity bit to see if the 6th bit was set
jnp nocaret
mov dl,'^'
nocaret:
; lower 6 bits: repetition count
; and away the top bits and move in bx
; we and ax and not al because we have to get rid of the 02h in ah
and ax,3fh
xchg ax,bx
print:
; print bx times
mov ah,2
int 21h
dec bx
jg print
; read next character
lodsb
test al,al
; rinse & repeat unless we got a zero
jnz mainloop
end:
ret
data:
; here be data
incbin "compressed.dat"
; NUL terminator
db 0
これらはすべてcompressed.dat
、次のような形式の単なる解凍プログラムです。
- 高ビットが設定されていない場合、文字をそのまま出力します。
- それ以外の場合、下位6ビットは繰り返しカウントで、2番目に高いビットは、スペース(ビットが設定されていない)またはキャレット(ビットが設定されている)を印刷する必要があるかどうかを指定します。
compressed.dat
次に、元のテキストからPythonスクリプトを使用して生成されます。
全体はここで見つけることができます。