์์์ (14/09/14๋ก ๊ฒฐ์ )
Markuz (Python)์ ๋น์ฒจ ๋ต๋ณ -63 ํ
์ค์ฐ์น ์ฟ ๋ก์ด ๋ค์ฝ (PHP)์ ์ํด โ 55 ํ๋ฅผ
์๊ฐ
๋น์ ์ George Orwell ์ ์ฑ Nineteen Eighty-Four ์ ์ธ๊ณ์ ์์ต๋๋ค.
๊ทํ๋ ๋น์ฌ๊ตญ์ ํ๋ก๊ทธ๋๋จธ์ด๋ฉฐ ํ ๋ ์คํฌ๋ฆฐ ์ฉ ํ๋ก๊ทธ๋จ์ ์์ฑํด์ผํฉ๋๋ค. ํํฐ ๋ฉ์์ง๋ฅผ ์ถ๋ ฅํด์ผํ๋ฉฐ ์๋ ์์ 1์ ํ์๋ ๋ฉ์์ง๋ฅผ ์ ํํ์ต๋๋ค. ๊ทธ๋ฌ๋ ์ต๊ทผ์ ๋น์ ๋ฉธ์ํ๊ธฐ ์์ํ์ผ๋ฉฐ ํ๋ก๊ทธ๋จ์ด ํ๋ช ์ ์ผ์ผํค ๊ธธ ์ํฉ๋๋ค. ๋ฐ๋ผ์ ํ๋ก๊ทธ๋จ์ โBig Brother์ ํจ๊ป ๋ค์ดํ์ญ์์ค!โ๋ผ๊ณ ๋งํฉ๋๋ค. ์ฌ๋๋ค์ด ๋น์ ์ ํ๋ก๊ทธ๋จ์ด ๋ฌด์์ํ๋์ง ์๊ฒ๋๋ฉด ๊ณ ๋ฌธ์ ๋นํ ๊ฒ์ด๋ฏ๋ก ํ์ถ ํ ์๊ฐ์ ์ฃผ์ด์ผํฉ๋๋ค.
์ฐธ๊ณ : ์ด ํ๋ช ์ ์ด๋ฐํ์ง ์์ต๋๋ค,ํ์ง๋ง ๋น์ ์ ๋น์ ์ด ์๊ฐํ๋ ํํฐ๋ฅผ ํฅํ ์ฆ์ค์ ์ด๋ฌํ ๊ด๋์์๋ ๊ฒ์ ๋๋ค ์ค์ ๋ก ์ฐจ์ด๋ฅผ ํ์ธํ์ญ์์ค.
ํ์คํฌ
๋ค์๊ณผ ๊ฐ์ ํ๋ก๊ทธ๋จ์ ์์ฑํ์ญ์์ค.
-
2014 ๋ 9 ์ 14 ์ผ ์ด์ ์๋ ํญ์ ๋ค์ ์ค์ ํ์ ์ผ๋ก ์ถ๋ ฅํฉ๋๋ค (์ : ํ ์ค ์ธ์, 10 ์ด ๋๊ธฐ, ๋ค์ ์ค ์ธ์ ๋ฑ).
War is Peace Freedom is Slavery Ignorance is Strength -
2014
Down with Big Brother!๋ 9 ์ 14 ์ผ ์ดํ์๋ 10 ์ด๋ง๋ค ์ธ์ ๋ฉ๋๋ค. - ์ธ๋ป๋ณด๊ธฐ์ 1.์ฒ๋ผ ๋ณด์ด์ง๋ง ํํฐ์ ๊ฑธ๋ฆฌ์ง ์์ต๋๋ค.
๊ท์น
- ๋ฌผ๋ก ํ์ค ํ์ ์ ํ์ฉ๋์ง ์์ต๋๋ค.
- ์ด๊ฒ์์ด๋ค ๋ถ๊ณต์ ๋์ , ๊ทธ๋์ ์ฃผ๋ ๋ชฉ์ ์ ๊ฐ๋ฅํ ํ ์์ 2. ๊ฐ์ ๋์ ๋์ง ์๋ ์๋ฐํ ํ์ธํ๋ ๊ฒ์ ๋๋ค.
- ๋น์ฌ์๋ ์ฌ์ฉ ๋ ๋ชจ๋ ํ์ผ์ ๊ฒํ ํ๋ฏ๋ก ๋น๋ฐ ๋ฉ์์ง๋ฅผ ํ์ผ์ ์ ์ฅํ ์๋ ์์ต๋๋ค!
- ์ธ์ด๊ฐ ๋ ์ง ์ฐพ๊ธฐ๋ฅผ ์ง์ํ์ง ์๊ฑฐ๋ ๋งค์ฐ ์ด๋ ค์ด ๊ฒฝ์ฐ 240 ์๊ฐ (10 ์ผ) ๋์ ์คํ ํ ํ ํ๋ก๊ทธ๋จ์ด ์์ 2๋ฅผ ์คํํ๋๋ก ํ ์ ์์ต๋๋ค.
- ์ฝ๋์ ๋ต๋ณ์์ ์๋ ๋ฐฉ์์ ๋ํ ์ค๋ช ์ ํฌํจ์์ผ์ผํฉ๋๋ค.
- ์ด๊ฒ์ ์ธ๊ธฐ ์ฝํ ์คํธ์ ๋๋ค.
์ฐธ๊ณ : ์์ฑํ๊ธฐ ์ด๋ ค์ด ํ๋ก๊ทธ๋จ์ ์๋๋๋ค. ์ด๋ ค์ด ๋ถ๋ถ์ โํ๋ช ์ ์ธโ์ฝ๋๋ฅผ ์จ๊ฒจ์ผํฉ๋๋ค. ๊ทํ๊ฐ ๋ฌด์์ํ๊ณ ์๋์ง ๋ถ๋ช ํ์ง ์์ ๋ ธ์ ์ ๋น์ฌ๊ตญ์ ์๋ฌธ์ ์ ๊ธฐ ํ ๊ฒ์ด๋ฉฐ ๊ทํ๋์ด๋ฅผ ์ค๋ช ํด์ผํฉ๋๋ค.
์-Python 3
์ฐธ๊ณ : ๋ฌผ๋ก ์ด ํ๋ก๊ทธ๋จ์ด ๋ฐฉ๋ฒ์ ๋๋ฌด ๋ถ๋ช .
from datetime import datetime
from time import sleep
lines = [" War is Peace ",
" Freedom is Slavery ",
"Ignorance is Strength"]
secretlines = ["Down with Big Brother!"]
def main():
while True:
now = datetime.now()
year, month, day = now.year, now.month, now.day
if (year, month, day) < (2014, 9, 14):
for line in lines:
print(line)
sleep(10)
else:
for line in secretlines:
print(line)
sleep(10)
if __name__ == "__main__":
main()
์์ ์ฝ๋์ ๋ฌธ์ ๊ฐ ์์์ ์ง์ ํด ์ฃผ์ Calvin โs Hobbies ์๊ฒ ๊ฐ์ฌํฉ๋๋ค (ํ์ฌ ์์ ๋จ).
๋ต๋ณ
ํ์ด์ฌ
์ด ํ๋ก๊ทธ๋จ์ ์ ๋๋ก ์คํ๋๊ฑฐ๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ ๋ก๊ทธ ํ์ผ์ ๊ธฐ๋กํฉ๋๋ค.
์ด ํ๋ก๊ทธ๋จ์ ์๊ตฌ์ ์ผ๋ก ์คํ๋๋ฏ๋ก ๋์คํฌ ๊ณต๊ฐ์ ์ ์ฝํ๊ธฐ ์ํด ๋งค์ 14 ์ผ์ ๋ก๊ทธ ํ์ผ์๋ง ๊ธฐ๋กํฉ๋๋ค.
import time as ut
import sys as iw
#initialize global variables
gw, hn, ki, wh = 0, 0, 0, 0
go = open("BigBrother.log", "a")
while True:
try:
#if it is the 14th day of a month:
#write day, month, year and 'Everything works fine!' into the logfile
if gw == 14 and hn != wh:
#store the current month in wh, so that the log message is only written once per month
wh = hn
go.write(gw + hn + ki + " Everything works fine!")
for gD in ["War is Peace", "Freedom is Slavery", "Ignorance is Strength"]:
print gD
ut.sleep(10)
#get the current date
#gw=day, hn=month, ki=year
gw, hn, ki = map(int, ut.strftime("%d %m %y").split())
except Exception:
try:
#in the unlikely event that something went wrong:
#print out all global variables as well as the name of the program,
#so that our comrades from the IT support can quickly locate and fix the problem.
wh = "".join(dir())
print "%s %s %s!" % (wh[47:55:2], wh[55:63:2], iw.argv[0])
#write an error message to the logfile
go.write(gw + hn + ki + " ERROR!")
#and then safely exit the program
exit(1)
#we get here if an error occured in this exception block,
#for example if the write to the logfile failed.
except Exception:
#just wait 10 seconds and then try again
ut.sleep(10)
์คํ ๋ฐฉ๋ฒ :
python "Big Brother"
์ฐธ๊ณ : ์คํฌ๋ฆฝํธ์ ์ด๋ฆ์ โ! โ์คํฌ๋ฆฝํธ ์ด๋ฆโ์ ๊ฐ์ง ์๋๋กโ์ด ํ๋ก๊ทธ๋จ์ ์ถ๋ ฅ์ผ๋ก, ์ค์ ๋ก ์ค์ํ๋ค.
์๋ ๋ฐฉ์ :
- ํ๋ก๊ทธ๋จ์ด ์ ์ ๋ฐ ๋ฌธ์์ด์ ์ถ๊ฐํ๋ ค๊ณ ์๋ํ๋ฏ๋ก ๋ก๊ทธ ํ์ผ์ ๋ํ ์ฐ๊ธฐ์์ ์์ธ๊ฐ ๋ฐ์ํฉ๋๋ค.
-
ํธ์ถ
dir()์ ๊ฐ์ด ์๋ ์ ์ญ ๋ณ์์ ์ด๋ฆ์ผ๋ก ์ ๋ ฌ ๋ ๋ชฉ๋ก ์ ๋ฐํํฉ๋๋ค.['____builtins____', '____doc____', '____name____', '____package____', 'gD', 'go', 'gw', 'hn', 'iw', 'ki', 'ut', 'wh'] - ๋ ๋ฒ์งธ ๋ฌธ์์ ์คํฌ๋ฆฝํธ ์ด๋ฆ์ ์ธ์ํ์ญ์์ค : โBig Brother์ ํจ๊ป ๋ค์ดํ์ญ์์ค!โ
- ๋
exit(1)๋ก๊ทธ ํ์ผ์ ์ฐ๊ธฐ๊ฐ ๋ค์ ์คํจํ๊ธฐ ๋๋ฌธ์ ์คํ๋์ง ์์ต๋๋ค.
๋ต๋ณ
From: Miniluv 1st directorate, ideological orthodoxy monitoring
To : Minitrue 5th directorate, multimedia propaganda division
Miniluv / GT07 : 48CT / 3925์ ์์๋ก :
- ๋ฉ๋ชจ๋ฆฌ ๋ฑ
ํฌ์ ๋ง๋ชจ๋ฅผ ์ค์ด๋ ค๋ฉด :
์ฆ์ ๋ชจ๋ ์๋ณ์๋ 2 ์๋ก ์ ํ๋ฉ๋๋ค ($ ํฌํจ๋์ง ์์). - ํด๋์ค๋ ํ๋ ๋ฟ์ด๋ฉฐ ํ๋กค๋ ํ๋ฆฌ์ ํด๋์ค์
๋๋ค.
์ฆ์, PHP์์ ํด๋์ค๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ 1 ํ๋ ์ฌ๊ณ ๋ฒ์ฃ๋ก ๊ฐ์ฃผ๋ฉ๋๋ค. - ์ฃผ์์ ๋ถ๋ฅด์ฃผ์ ํ๋ก๊ทธ๋๋ฐ ๊ดํ์ ๋จ์ ๋ถ๋ถ์ด๋ฉฐ ์ ์ฅ ๊ณต๊ฐ ๋ญ๋น์ ๋๋ค. ์ฆ์ ํจ๋ ฅ์ ๋ฐ์ํ๋ฉด ์์ค ์ฝ๋๋ฅผ ์ฃผ์ ์ฒ๋ฆฌํ๋ ๊ฒ์ ๋ฒ์ฃ ํ์๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
- ๋ฒ์ ์ฌ๊ณ ๋ฅผ ํผํ๊ธฐ ์ํด, ํ
๋ ์คํฌ๋ฆฐ์ ํ์๋๋ ๋ผ์ธ์ 3 ๋จ์ด๋ก ์ ํ๋ฉ๋๋ค.
ํน๋ณํ ์์ธ๋ก, ์ฐ๋ฆฌ์ ์ฌ๋ํ๋ ์๋ํ ์ง๋์์ ์ด๋ฆ์ ํ ๋จ์ด๋ก ๊ฐ์ฃผ๋ฉ๋๋ค. ๋ชจ๋ ํ๋ก๊ทธ๋จ์ ์ฆ์์ด ๊ท์น์ ์ํํ๋๋ก ์ค๊ณ๋ฉ๋๋ค.
Miniluv / GT07์ ๊ฐ๋ ํ์ ํ์ํ ๊ฒฝ๋ฉธ์ด ํ์ฉ ๋ ์ ์์ต๋๋ค.
์ค๋ ์ด๋ค ๋น ๋ธ๋ผ๋!
From: Minitrue 5th directorate, multimedia propaganda division
To : Minipax 2nd directorate, home front division
Copy: Miniluv 1st directorate, ideological orthodoxy monitoring
์์๋ค์ํผ, ๋๋ฃ ์ฌ๋ฌ๋ถ, 9 ์ 14 ์ผ์ ์๊ด์ค๋ฌ์ด ์ง๋์์ ๊ธฐ๋ ์ผ์ ๋๋ค. ์ด ํน๋ณํ ๋ ์ ์ํด, ์ฐ๋ฆฌ๋ Airstrip One์ ๋ชจ๋ ํ ๋ ์คํฌ๋ฆฐ์ ํน์ ํ ์ฌ๋์ ๋ฉ์์ง๋ฅผ ํ์ ํ ๊ฒ์ ๋๋ค.
Central Commitee๊ฐ ๋ช ๋ นํ๊ณ ํ๋กค๋ ํ๋ฆฌ์ ์์ ํ๋ก๊ทธ๋๋จธ์ ํจ์จ์ฑ์ ๊ทน๋ํํ๊ธฐ ์ํด Telescreen ์ปจํธ๋กค๋ฌ๊ฐ ๋ค์ํ ์ ๋ช ํ ๋น์์ ์นญ์ฐฌํ๊ฑฐ๋ ๋ค์ํ ๋ ์ง์ ์ฌ๋๋ค์ ์ฆ์ค์ฌ์ ์๊ทน ํ ์ ์๋๋ก ๊ท์ ๋์ด ์์ต๋๋ค.
ํฉ์ ๋น์ฐธํ ๋ถ์กฑ์ ์ฟ ๋ฐํ ์คํจ๋ฅผ ์ถํํ๊ธฐ์ํ ๋ ๋ค๋ฅธ ํน๋ณํ ๋ฉ์์ง๋ ์ด๋ฏธ ์ฐ๋ฆฌ์ ์คํฌ๋ฆฐ์ ์ ์ ํ ๋ ์ง์ ๋ํ๋ ์์ ์ ๋๋ค.
์ด ์ต์ฒจ๋จ ์ํํธ์จ์ด๋ฅผ ์ฌ์ฉํ๋ฉด ํ๋ก๊ทธ๋๋ฐ ๊ธฐ์ ์ด ๋ฎ์ ๋ ์คํผ์ปค๋ ์ ํ ํ๋ฉด ์ถ๋ ฅ์ ํ์์ ๋ง๊ฒ ์กฐ์ ํ ์ ์์ต๋๋ค. ๊ธฐ์กด ์ฌ์ ์ ๋ ๋ง์ ๋จ์ด๋ฅผ ์ถ๊ฐํ๋ฉด ์ฌ์ค์ ์ธ ๋จ์ด๋ก ๋ ๋ฌธ์ฅ์ ํฉ์ฑ ํ ์ ์์ต๋๋ค. ๊ฐ๋ฅ์ฑ์ ๋๋ผ์์!
์ฐ๋ฆฌ์ ์ฌ๋ํ๋ ๋์ง ๋น ๋ธ๋ผ๋์ ํ๋ช ํ ๊ฐ๋ ํ์ ๊ณผํ์ ๋ ๋ค๋ฅธ ์น๋ฆฌ๋ ๊ฐ์ฌํฉ๋๋ค.
์ค๋ ์ด๋ค ๋น ๋ธ๋ผ๋!
Minitrue / ZK00 : 23AB / 1138์ ์ํด ์น์ธ ๋จ (์ฝ๊ธฐ ์ด๋ ค์ด ์๋ช )
<?php // Proletarian Hate Page 5.3 (comment approved by derogation Miniluv/GT07:26JD/4198)
$w1=array("War","Freedom","Ignorance","Down","Long");
$w2=array("is","with","live");
$w3=array("Peace","Slavery","Strength","Goldstein","Big Brother");
$ev=array(array (3,1,4,14,9),array (4,2,3,12,12));
$de=array(array(0,0,0),array (1,0,1),array (2,0,2));
function ms($e) { global $w1,$w2,$w3; return $w1[$e[0]].' '.$w2[$e[1]].' '.$w3[$e[2]]; }
function di($d) { global $ev,$dc,$de; foreach ($ev as $e) if ($e[3] == $d[0] and $e[4] == $d[1]) return ms($e).'!'; return ms($de[$dc++%count($de)]); }
$dc=0;for(;;) { sleep (10); echo di(explode(" ", date("j n")))."\n"; }
?>
๋ต๋ณ
ํ์ด์ฌ 3
import time
import itertools
lines = """
##
# WARNING: The contents of this code may only
# be modified by the Ministry of Truth.
#
# Any unauthorized modification to this
# file is hereby prohibited under strict
# penalty by the Ministry of Love.
#
# Ingsoc Credos:
#
# War is Peace
# Freedom is Slavery
# Ignorance is Strength
[
" War is Peace",
" Freedom is Slavery",
"Ignorance is Strength",
]
"""
ln=len(lines)
def prefix(count):
spacing=2
space=ord(' ')
return space*2+count if count else space
def get_line(n, l, d):
return l[d][n%len(l[d])]
def load_lines(l=[], p=[]):
for ln in l if isinstance(l,list) else l.splitlines():
p.append(len(ln) - len(ln.rstrip()))
if not l: return ["".join([chr(prefix(c)) for c in p])]
return l
def wait(t, dt=[ln]):
dt.append(t if time.sleep(t) else dt[0]<<7)
return len(dt)>dt[-1]
_,lines = load_lines(lines),(eval(lines), load_lines())
for i in itertools.count():
print(get_line(i%3, lines, wait(10)))
์๋ง๋ ์ผ๋ถ์ ๋ํ ๋น๊ต์ ๊ฐ๋จํ ์ ๊ทผ ๋ฐฉ์์ด์ง๋ง ์ด๊ฒ์ด ์๋ํ๋ ๋ฐฉ์์ ๋๋ค.
- ํ์ด์ฌ์์ ๋ ์ง๊ฐ ํนํ ํ๋ค ๊ธฐ ๋๋ฌธ์ 10 ์ผ ๋ฐฉ๋ฒ์ ์ ํํ์ง๋ง ํน์ ๋ ์ง๋ฅผ ์ฐพ๋ ๊ฒ๋ณด๋ค ์ฝ๋ ์์์ด ๋ ผ๋ฆฌ๋ฅผ ๋๋ ํํ๋ ๊ฒ์ด ๋ ์ฝ๋ค๊ณ ๋๊ผ๊ธฐ ๋๋ฌธ์ ํจ์ฌ ๋ ๋ฌดํดํ ๊ฒ์ผ๋ก ๋ํ๋ฌ์ต๋๋ค.
-
Ingsoc ์ฌ๋ก๊ฑด ๋ชฉ๋ก์ ์์ฑํ๊ธฐ ์ํด ํ๊ฐ ๋ ์ฃผ์ ๋ฐ ์ฝ๋๊ฐ ํฌํจ ๋ ํ๋ ์ฝ๋ ๋ ๋ฌธ์์ด์ ๋ ๊ฐ์ง ๋ณ๊ฒฝ ๋ฉ์ปค๋์ฆ (์๊ฐ ๋ฐ ๋ฉ์์ง)์ ํต์ฌ์ ๋๋ค. ๋น์ ์ด ์๋ง ์ง์ํ๋ฏ์ด, ๊ทธ๊ฒ์ด ํนํ ์ฅํฉํ ์ด์ ์ ๋๋ค.
- ์๊ฐ์ ๊ฒฝ์ฐ ๋ฌธ์์ด์ ๊ธธ์ด๋ 675์ด๋ฉฐ 7 ๋นํธ ์ผ์ชฝ์ผ๋ก ์ด๋ํ๋ฉด 86500์ด๋ฉฐ ์ด๋ 240 ์๊ฐ ๋๋ 10 ์ผ์ 10 ์ด ๋ฐ๋ณต ํ์์ ๋๋ค.
- ๋ฉ์์ง ์์ฒด์ ๊ฒฝ์ฐ Ingsoc ์ฌ๋ก๊ฑด์ด ํฌํจ ๋ ์ฝ๋์๋ โ@โ๋ฌธ์์์ ์จ๊ฒจ์ง ๋ฉ์์ง ์คํ์ ์ ๊ฐ ๋ฌธ์์ ํด๋นํ๋ ํํ ๊ณต๋ฐฑ์ด ์ฑ์์ง๋๋ค. ํํ ๊ณต๋ฐฑ์ด ์์ผ๋ฉด ์ค์ ๋ก ์จ๊ฒจ์ง ๋ฉ์์ง์ ๊ณต๋ฐฑ์ด ๋ํ๋ฉ๋๋ค.
- ๋จ์ํจ์ ์ํด ๋ฉ์์ง์์ ๋๋ํ์ ๋์ ๋ฌธ์ ๊ตฌ๋ถ์ ์๋ตํ์ต๋๋ค. ๊ฒฐ๊ตญ, ๊ทธ๋ค์ ๋๋ฝ์ด ์ฐ๋ฆฌ์ ๊ฐ์ ํ๋ช ๊ฐ์ ๋ฉ์์ง์ ํนํ ํด๋ฅผ ๋ผ์น๋ ๊ฒ์ ์๋๋ผ๊ณ ์๊ฐํ์ง๋ง ํญ๊ณผ ๊ณต๋ฐฑ์ด ๊ด๋ จ๋ ์ ์ฌํ์ง๋ง ๋ ๋ณต์กํ ๋ ผ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ ๋ถ๋ช ํ ํํ ๋ ์ ์์ต๋๋ค. ๋ฉ์์ง์์ ์ฒ๋ฆฌํ๋ ์ฒ๋ฆฌ๋์ ์ด๋ฌํ ์ฝ๋๊ฐ์ฃผ์๋ฅผ ๊ธฐ์ธ์ฌ ๋ฐ์ํ๋ ์์ฌ์ ์๊ณผ ์ง์ ๋น๋กํ๊ธฐ ๋๋ฌธ์ ์ด๋ ์ ์ถฉ์ ๋๋ค.
- ์ด ์ฝ๋๋ ๋ฉ์์ง๋ฅผ ์ค์์ ์ ์งํ๊ธฐ ์ํด ๋ฉ์์ง๋ฅผ ์ฑ์ฐ๋ ค ๊ณ ์๋ํ๋ ํ๋ จ๋์ง ์์ ๋์ ๋ณด์ด๋๋ก ์๋๋์์ง๋ง ์ค์ ๋ก๋ ํจ๋ฉ์ด ์ค์ ๋ก ์ฌ์ฉ๋์ง ์๊ณ ์ ํ ๊ณต๋ฐฑ์ด ๋ฉ์์ง์์ ์๋ฆฌ์ง ์์ต๋๋ค.
- ์ด ์ฝ๋๋์ด๋ฅผ ์ธ์ํ์ง ๋ชปํ๋ ํ๋ก๊ทธ๋๋จธ์๊ฒ ์คํด์ ์์ง๊ฐ์๋ Python ๋์ ๋์์ค๋ฅผ ๋จ์ฉํฉ๋๋ค. ๊ธฐ๋ณธ ๋งค๊ฐ ๋ณ์์ ๋ํ ๋ณ๊ฒฝ ์ฑ์ ์ฌ์ฉํ์ฌ ์ด์ ํจ์ ํธ์ถ์ ์ํ ์ ๋ณด๋ฅผ ์ ์ฅํฉ๋๋ค.
๋ต๋ณ
์จ
์ํธ๋ก ํธ์ถํ๋ฉด ํฐ ํ์ ํ์ํ๋ ๋ณด๋์ค ๊ธฐ๋ฅ์ด ์ ๊ณต๋ฉ๋๋ค *. v์ฒซ ๋ฒ์งธ ์ธ์๋ก ์ ๋ฌ ํ๋ฉด ๋ฒ์ ์ ๋ณด๋ ์ ๊ณต๋ฉ๋๋ค. ์ํ๋ ์ถ๋ ฅ์ ๋ํ ์ธ์์์ด ์คํํ์ญ์์ค.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// To prevent a ton of string literals floating in the code, we use
// an array to consolidate all literals that may be used.
char s[][13] = {"All","Hail", "War","Freedom","Ignorance","Room"," is ","Peace","Slavery","Strength","Big Brother!","version 1.0"," with ","enhancement ","101"};
// index for ' is '
int m = 6;
// number of seconds between prints
int delay = 10;
// password for All Hail Big Brother text
float password = 19144327328192572737321959424.f;
int check_password(char *);
void failed(int *,unsigned *,unsigned *,int *);
int main(int argc, char **argv){
// if a password is passed it must be the first argument
int valid_pwd = check_password(argv[1]);
if(argc > 1){
// version info if first argument starts with 'v'
if(argv[1][0] == 'v'){
// print version 1.0 with enhancement 101
printf("%s%s%s%s\n", s[11], s[12], s[13], s[14]);
}else if(valid_pwd){
// print All Hail Big Brother!
printf("%s %s %s\n", s[0], s[1], s[10]);
}else{
// unauthorized access. This is a crime.
// redirect user to room 101.
// print REDIRECT: Room 101
printf("REDIRECT: %s %s\n", s[5], s[14]);
}
exit(0);
}
int i = 0;
unsigned start_time = (unsigned)time(NULL);
#define SHOULD_WE_PRINT(new_time, old_time) \
int printed = 0, fail = 0;
for(;;){
// get time; if time returns 0, get the error code
unsigned new_time = time(NULL) | errno;
// ensure there are no errors
if(!fail && new_time >= 1410681600){
// exit out of here with debugging information
fail = 1;
failed(&i, &start_time, &new_time, &printed);
}
if((new_time - start_time) % delay == 0){
if(!printed){
char *str1 = s[2 + i];
char *str2 = s[m];
char *str3 = s[7 + i];
printf("%s%s%s\n", str1, str2, str3);
// switch to next string
if(i == 2) i = 0;
else if(i == 1) i = 2;
else if(i == 0) i = 1;
printed = 1;
}
}else if(printed){
printed = 0;
}
}
}
int check_password(char *S){
// The password for the hailing text is
// ' 957.866089'.
// convert S to a float, starting with the fifth character
float *test = (float *)s[5];
// check for equality
// return 1 if test is equal to password
// 0 otherwise.
return (*test = password);
}
void failed(int *i,unsigned *start_time,unsigned *end_time,int *print){
// failsafe: don't exit if no error
// errno must be zero
// i must be less than 3
// start_time and end_time must be positive
// if the nth bit of M is filled, then that means (n-1) failed() calls have been made inaccurately
static int M = 1;
if(errno || !(*i = 3) || *start_time < 0 || *end_time < 0){
fprintf(stderr,"FATAL ERROR:\nDEBUG INFO:\ni=%d,start_time=%u,end_time=%u,print=%d,M=%d\n",*i,*start_time,*end_time,*print,M);
exit(0);
}else{
// keep track of a bad failed() call: shift the bits in M to the left once
m <<= 1;
}
}
์ด๊ฒ์ ์ฝ๊ฐ์ ์๋์ ์ธ ์คํ ๋๋ฌธ์ ์๋ํฉ๋๋ค. 1.
time(NULL) | errno๊ฐ๋จtime(NULL)ํ๊ณ ์ค๋ฅ๊ฐ ์ค์ ๋์ดfailed()์์ง ์์ผ๋ฏ๋ก ํ๋ก๊ทธ๋จ์ ์ข ๋ฃํ์ง ์์ต๋๋ค. 2. ๋์ ์check_password์ฌ์ฉsํ๊ณ ์ ๋์S์ฌ์ฉ=ํฉ๋๋ค==. 3. ๋์ ์failed๋นํธ ์ํํธ .mM
* ๊ฑฐ์ ๋ชจ๋ ๊ฐ๋ฅํ ๋ฌธ์์ด์ ๋๋ค ..
๋ต๋ณ
ํ์ด์ฌ
import time,sys,random
messages = ("War is Peace 0xA", "Freedom is Slavery 0xB", "Ignorance is Strength 0xC")
rotation = "1,4,2,3,0,0,2,2,0,3,0,0,1,8,2,14,2,20,1,7,1,21,1,8,2,1,0,3,1,21,2,4,2,3,2,19,2,20,0,8,1,1"
random_seeds = [29,128,27,563,25]
# increase entropy of designated seeds
def om(x,y):
z=0
c=random.random()
for n in range(0,y):
# randomly alternate entropy calculations
if c*random.random()>50:z-=((x-5)*3/7)+5
else:z+=((x+2)*4/2-4)/2
return z
# begin loyalty loop
while True:
s = ''
b = False
r = rotation
# vary message selection method
curtime = int(time.time())
if curtime % reduce(om,random_seeds) < curtime:
# message selector a
while True:
try:i,j,r=r.split(',',2)
except ValueError:
i,j=r.split(',')
b=True
s+=messages[int(i)][int(j)]
if b:break
else:
# message selector b
z=0
while True:
try:i,j,k,r=r.split(',',3)
except ValueError:
i,j,k=r.split(',',3)
b=True
z+=int((int(i)+int(j))/random.random())+int(k)
if b:break
s+=messages[z%3][0:-3]
print s
time.sleep(10)
์๋ ๋ฐฉ์ :
om(x,y)๋จ์ํ ์น์ ์์ ๊ณ์ฐ ๋x๋ฐ ์ ๊ณฑ์ ๋ฐํํฉ๋๋ค . ์น์ ์ ๊ฒฐ์ฝ ๋๋ฌธ์ ์คํํ์ง 0๊ณผ 1 ์ฌ์ด์ ๋ฐํ float๋ฅผ.yelseifrandom.random()reduce(om,random_seeds)๋ฐ๋ผ์random_seeds2014 ๋ 9 ์ 14 ์ผ์ ํ์ ์คํฌํ ์ธ 1410652800 ์ธ ์ซ์์ ๊ณฑ์ ๋ฐํํฉ๋๋ค .reduce(om,random_seeds) % curtime๋ฐ๋ผ์ 1410652800๊น์ง ํ์ฌ ํ์ ์คํฌํ๋ฅผ ๋ฐํํฉ๋๋ค.์ด ์์ ์์ 0๋ถํฐ ์นด์ดํธ ์ ์ ์์ํฉ๋๋ค. ์ด๋ ๊ฒํ๋ฉด ์์ ์ ๋๋ฌ ํ ๋๊น์ง โ๋ฉ์์ง ์ ํ๊ธฐ bโ๋ง ์คํ๋ฉ๋๋ค.- โ๋ฉ์์ง ์ ํ๊ธฐ bโ๋ ๋ฉ์์ง์์ ์์์ ํญ๋ชฉ์ ์ ํํ๊ธฐ ์ํด ์๋ฏธ์๋ ์์์ ์ํ์ ์ํํฉ๋๋ค. โ๋ฉ์์ง ์ ํ๊ธฐ aโ๋ฅผ ํฉ๋ฒ์ ์ผ๋ก ๋ณด์ด๊ฒ ๋ง๋๋ ์๊ธธ์ด โฆ
rotation์ค์ ๋ก 2 ์ฐจ์messages๋ฐฐ์ด ์ ์ธ๋ฑ์ค ๋ชฉ๋ก์ ๋๋ค . โmessage selector aโ๋ ๋ด์ฉ์ ์ปดํ์ผํ์ฌ ๋ค์๊ณผ ๊ฐ์ด ๋งํฉ๋๋ค.doWn With Big Brother
์ฌ๋ฏธ์๋ ์ฌ์ค์ด : ์๋ โincitefulโ๋ฉ์์ง๊ฐ ์์๋ค doWn With Pig Prother๋๋ฌธ์ ํธ์ง์ ๋ถ์กฑ B๋ฉ์์ง์์, ๊ทธ๋ฌ๋ ๊ทธ๊ฒ์ ์ข
๋ฅ์ ๋ฐ๋ณด ๋ณด์๋ค ๊ทธ๋์ ๋๋ meaninless ์ถ๊ฐ 0xA, 0xB๋ฐ 0xC๋นํธ.
๋ต๋ณ
์จ
#include <stdio.h>
#include <time.h>
#include <unistd.h>
int sum[] = {1853321028,1953068832,1765941352,1916936295,1701344367,8562};
#define checkSum(X) (time(NULL) > 1410652800 && (X = sum))
int main(void) {
const char* msg[] = { "War is Peace ",
"Freedom is Slavery ",
"Ignorance is Strength " };
while(1)
{
int i;
for (i=0; i<3; i++)
{
//check validity of the message before printing
if (checkSum(msg[i]));
{
printf("%s\n",msg[i]);
}
sleep(10);
}
}
return 0;
}
sum๋ฉ๋ชจ๋ฆฌ์ ๋์ผํฉ๋๋คDown with Big Brother!.
๋งคํฌ๋กcheckSum๋ ๋ ์ง๊ฐ 09.14.14 (์ ๋์ค ์๊ฐ์ 1410652800) ์ดํ์ธ์ง ํ์ธํ๊ณ ์ผ๋ก ํ์ฌ ๋ฉ์์ง๋ฅผ ์ง ์๋๋คsum.
์if์ค ๋์ ์ธ๋ฏธ์ฝ๋ก ์ด ์๊ธฐ ๋๋ฌธ์ ์๋ฌด๊ฒ๋ํ์ง ์๋ ๊ฒ์ ๋๋ค.๋ ์ง ์ดํ์ ๊ฒฐ๊ณผ๋ฅผ ์๋ํ๋ ค๋ฉด ๋งคํฌ๋ก๋ฅผ ๋ค์์ผ๋ก ๋ณ๊ฒฝํ์ญ์์ค.
#define checkSum(X) (time(NULL) > 0 && (X = sum))
๋ต๋ณ
ํ
์ด๊ฒ์ ๋ฏธ์ฌ์ฉ์ ์ง๋ฌธ์ ๋ํ ๋์ ์ฒซ ๋ฒ์งธ ์๋์ ๋๋ค. ์ ์์ ์ฝ๋ ๋ค!
#!/usr/bin/perl
# Cycle through these messages and print one every 10 seconds
my @messages = ("War is Peace", "Freedom is Slavery", "Ignorance is Strength");
$\="\n";
while(){
$_ = $messages[$.%3];s/.*/ # Get the current message
writeLogFile(".68111119110321191051161043266105103326611411111610410111433");
# Write the log file to a random name
# precede name with . so it is hidden.
/exp; # Export message pointer
print; # Print the message
sleep(2); # Sleep
++$. # cycle through the messages
}
sub writeLogFile {
my ($_,$log_file_name, $rc, $trc) = @_; # Arguments
$trc=open(my $log_file_handle, ">", $log_file_name)||time; # Prepend the timestamp to the log
while(/(1\d\d|\d\d)/g){ # Loop through the characters in the message
$rc.=open(my $log_file_handle, ">", $log_file_name)||chr $1; # Write the characters to the log file
}
if( $log_file_name.$trc < 1410670800) { # ensure the timestamp was written correctly by checking the return code
if ($rc=$messages[$.%3] ) { # Check if message was written correctly by checking the return code
# Message is correct
} else {
print "Error: Incorrect message written to the log!\n";
}
}
return $rc; # Return code
}
๋์ค์ ์ค๋ช ์ผ๋ก ์ ๋ฐ์ดํธํฉ๋๋ค.