aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-10-16 16:20:55 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-10-16 16:20:55 +0300
commit92283283cc56101fd84293938edc4527b3882aad (patch)
tree77314c569270ffbf11f5091f30fe872ee11b2e71
parentac7b0be8b22245e20624b937733c16fb3a11b24b (diff)
downloadcryptrobber-92283283cc56101fd84293938edc4527b3882aad.tar
cryptrobber-92283283cc56101fd84293938edc4527b3882aad.tar.xz
cryptrobber-92283283cc56101fd84293938edc4527b3882aad.zip
.
-rw-r--r--Makefile11
-rw-r--r--encrypt.sts2
-rw-r--r--ia32/stack.sts2
-rw-r--r--main.sts5
4 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 581241b..63defae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,14 @@
-.PHONY: cryptrobber clean
+all: cryptrobber encrypt
+.PHONY: all clean encrpyt cryptrobber
-cryptrobber:
+cryptrobber: smack strans
./smack main.sts | ./strans > $@
chmod 0755 $@
+encrypt: smack strans
+ ./smack encrypt.sts | ./strans > $@
+ chmod 0755 $@
+
smack: smack.c
gcc $< -o $@
@@ -11,4 +16,4 @@ strans: strans.c
gcc $< -o $@
clean:
- rm -f smack strans cryptrobber
+ rm -f smack strans cryptrobber encrypt
diff --git a/encrypt.sts b/encrypt.sts
index 378a686..8112d9b 100644
--- a/encrypt.sts
+++ b/encrypt.sts
@@ -2,7 +2,7 @@ module ia32/elf/begin.sts
module cipher.sts
defword encbyte
- key dup if
+ sys_read dup if
drop
cipher
1 1
diff --git a/ia32/stack.sts b/ia32/stack.sts
index cf1bd21..7756706 100644
--- a/ia32/stack.sts
+++ b/ia32/stack.sts
@@ -13,7 +13,7 @@ next
defasm drop
# 58 ?' ; pop eax
next
-
+
defasm dup
# ff ?' # 34 ?' # 24 ?' ; push dword [esp]
next
diff --git a/main.sts b/main.sts
index 45010ec..9bd7a63 100644
--- a/main.sts
+++ b/main.sts
@@ -3,9 +3,6 @@ module ia32/elf/begin.sts
set_entry
30 31 32
33 0 set 34 1 set 35 2 set
- emit
- emit
- emit
-quit
+sys_exit
module ia32/elf/end.sts