From 316e71d5ae64cb14cbd39690af9e29e773484121 Mon Sep 17 00:00:00 2001 From: "nuo.o" <49533950+nuoxoxo@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:18:11 +0100 Subject: [PATCH 1/2] Update README.mdx --- level09/README.mdx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/level09/README.mdx b/level09/README.mdx index e654a94..fb17da1 100644 --- a/level09/README.mdx +++ b/level09/README.mdx @@ -39,10 +39,17 @@ zbd 👈 char = curr - i + 1 Simple algo -- respect python2 syntax -- to be run in VM - +- p2: decode in vm, respect python2 syntax +- p3: `scp` to host and decode there ```b line = open('/home/user/level09/token').read().strip() print 'res/', ''.join(chr(ord(_) - i) for i, _ in enumerate(line)) ``` +```b +line = open(0, 'rb').read().strip() +print('res/', ''.join(chr(_ - i) for i, _ in enumerate(line))) + +> scp -P 4242 level09@$(ifconfig|grep 'inet '|awk 'NR==2 {print $2}'):/home/user/level09/token $(pwd) + 25749xKZ8L7DkSCwJkT9dyv6f +> chmod 777 token && p3 decode.py < token +``` From 22c9984875922abdef0a31087b3994ed4c33762f Mon Sep 17 00:00:00 2001 From: nuoxoxo Date: Mon, 18 Nov 2024 18:18:27 +0000 Subject: [PATCH 2/2] show READMEs daily --- README.mdx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.mdx b/README.mdx index a02630c..2258652 100644 --- a/README.mdx +++ b/README.mdx @@ -741,13 +741,20 @@ zbd 👈 char = curr - i + 1 Simple algo -- respect python2 syntax -- to be run in VM - +- p2: decode in vm, respect python2 syntax +- p3: `scp` to host and decode there ```b line = open('/home/user/level09/token').read().strip() print 'res/', ''.join(chr(ord(_) - i) for i, _ in enumerate(line)) ``` +```b +line = open(0, 'rb').read().strip() +print('res/', ''.join(chr(_ - i) for i, _ in enumerate(line))) + +> scp -P 4242 level09@$(ifconfig|grep 'inet '|awk 'NR==2 {print $2}'):/home/user/level09/token $(pwd) + 25749xKZ8L7DkSCwJkT9dyv6f +> chmod 777 token && p3 decode.py < token +``` # 10