aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-10-16 16:53:58 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-10-16 16:53:58 +0300
commit451e6018dfbe415461896b2f97df019578cefd16 (patch)
treeff6ec9af42345b2648aabf13dbcde2dd05128952
parent891c894fc1d837082f037170f0c8d63140dd2284 (diff)
downloadcryptrobber-451e6018dfbe415461896b2f97df019578cefd16.tar
cryptrobber-451e6018dfbe415461896b2f97df019578cefd16.tar.xz
cryptrobber-451e6018dfbe415461896b2f97df019578cefd16.zip
Encryptor completed.
-rw-r--r--Makefile2
-rw-r--r--cipher.sts4
-rw-r--r--encrypt.sts2
-rw-r--r--ia32/bitwise.sts6
-rw-r--r--ia32/ia32.sts1
5 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 63defae..344c808 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
all: cryptrobber encrypt
-.PHONY: all clean encrpyt cryptrobber
+.PHONY: all clean encrypt cryptrobber
cryptrobber: smack strans
./smack main.sts | ./strans > $@
diff --git a/cipher.sts b/cipher.sts
index 0f20470..72d941e 100644
--- a/cipher.sts
+++ b/cipher.sts
@@ -4,6 +4,10 @@ defword ciphernew
0
exit
+defword mod
+ swap / drop
+exit
+
defword cipher ; ... passwd plen ppos key
3 get 2 get + @ xor ; key = key ^ passwd[ppos]
over 1 + 3 get mod 2 set ; ppos = (ppos + 1) % plen
diff --git a/encrypt.sts b/encrypt.sts
index 64fade3..29424a2 100644
--- a/encrypt.sts
+++ b/encrypt.sts
@@ -24,6 +24,6 @@ set_entry
passwd 3 ciphernew
encrypt
cipherdel
-quit
+sys_exit
module ia32/elf/end.sts
diff --git a/ia32/bitwise.sts b/ia32/bitwise.sts
new file mode 100644
index 0000000..6d376e4
--- /dev/null
+++ b/ia32/bitwise.sts
@@ -0,0 +1,6 @@
+defasm xor
+ # 5b ?' ; pop ebx
+ # 58 ?' ; pop eax
+ # 31 ?' # d8 ?' ; xor eax, ebx
+ # 50 ?' ; push eax
+next
diff --git a/ia32/ia32.sts b/ia32/ia32.sts
index 4d9e426..a667ebf 100644
--- a/ia32/ia32.sts
+++ b/ia32/ia32.sts
@@ -4,4 +4,5 @@ module ia32/stack.sts
module ia32/branch.sts
module ia32/memory.sts
module ia32/math.sts
+module ia32/bitwise.sts
module ia32/syscall.sts