From a5ada20d77f6fcf7bf54e49402e55d3b1c56df5e Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 16 Oct 2020 22:38:45 +0300 Subject: Meh. --- main.sts | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'main.sts') diff --git a/main.sts b/main.sts index bf0c267..93a9ed4 100644 --- a/main.sts +++ b/main.sts @@ -1,17 +1,30 @@ module ia32/elf/begin.sts +module cipher.sts -defarr bigbad 65536 ; max size of input is 64KB +defarr bigbad 64000 ; max size of input is 64 000 chars +defarr bigbadres 64000 ; max size of output is 64 000 chars +defarr passwd 3 -set_entry ; reversed echo - 0 ; bigbad index +set_entry + 31 passwd ! + 32 passwd 1 + ! + 33 passwd 2 + ! + + 0 local bigbadlen do sys_read 0 = until over bigbad + ! 1 + - od ; bigbad length will be on top of stack + od + + 0 local cipherpos + 0 do dup bigbadlen @ = until + dup bigbad + @ passwd 3 cipherpos cipher + over bigbadres + ! + 1 + od drop drop - do - 1 - dup bigbad + @ sys_write - dup 0 = untilod drop + 0 do dup bigbadlen @ = until + dup bigbadres + @ sys_write + 1 + od drop drop sys_exit module ia32/elf/end.sts -- cgit v1.2.3