summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2019-07-18 12:13:17 +0100
committerYour Name <you@example.com>2019-07-18 12:13:17 +0100
commit9b5367618ae9d3fbae4b00264ab24dbaa03613b1 (patch)
tree84ae61afcc5008d6df964921aabf8c55ca1800cd
parentbb787b60b3e7aacb90cf43ba70102e0460f90b67 (diff)
downloadwristapps-9b5367618ae9d3fbae4b00264ab24dbaa03613b1.tar.gz
wristapps-9b5367618ae9d3fbae4b00264ab24dbaa03613b1.tar.bz2
wristapps-9b5367618ae9d3fbae4b00264ab24dbaa03613b1.zip
debug improvements
-rw-r--r--.gitignore2
-rw-r--r--sha1/Makefile10
-rw-r--r--sha1/emul.script4
-rw-r--r--sha1/msauth.asm3
-rwxr-xr-xsha1/test/totp.pl6
5 files changed, 20 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 8188dde..9f2b447 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,5 @@ sha1/*.img
sha1/*.srec
from_others/numpad/numpad-?.asm
from_others/numpad/numpad.asm
+*.obj
+*.map
diff --git a/sha1/Makefile b/sha1/Makefile
index b2635cc..52805c3 100644
--- a/sha1/Makefile
+++ b/sha1/Makefile
@@ -14,6 +14,8 @@ AFLAGS=-i ../include/dl150 -cpu datalink
AS=${CROSS}asl ${AFLAGS}
P2BIN=${CROSS}p2bin
+EMUL=../../sim68xx/src/boards/sim6805
+
default:${APP} ${LSTS} ${S19}
.PRECIOUS:${APP} ${LSTS}
@@ -30,10 +32,16 @@ default:${APP} ${LSTS} ${S19}
${P2BIN} $< $@ -r 0x110-\$$
%.lst %.p:%.asm
- ${AS} -L ${@:%.p=%.lst} -o $@ $<
+ ${AS} -g -L ${@:%.p=%.lst} -o $@ $<
+ ${CROSS}/process_map ${@:%.p=%.map}
+
+
%.l:%.lst
awk '{ if (($$1!="(1)") && ($$1!=" ") && NF) { print }}' < $< > $@ || /bin/rm -f $@
+do_test: ${PROG}.srec
+ ${EMUL} $< < emul.script
+
clean:
/bin/rm -f ${APP} ${PS} ${LSTS} ${RLSTS} ${S19}
diff --git a/sha1/emul.script b/sha1/emul.script
new file mode 100644
index 0000000..cd3324d
--- /dev/null
+++ b/sha1/emul.script
@@ -0,0 +1,4 @@
+b END
+g TEST
+md T1 4
+quit
diff --git a/sha1/msauth.asm b/sha1/msauth.asm
index 5e03d48..397e2eb 100644
--- a/sha1/msauth.asm
+++ b/sha1/msauth.asm
@@ -1,8 +1,5 @@
INCLUDE "WRISTAPP.I"
- org $100
- jmp test
-
idx EQU $60
lidx EQU $61
diff --git a/sha1/test/totp.pl b/sha1/test/totp.pl
index 5903133..cd40aa0 100755
--- a/sha1/test/totp.pl
+++ b/sha1/test/totp.pl
@@ -171,7 +171,11 @@ sub generateCurrentNumber {
my $offset = hex(substr($hmac, -1));
print "offset=",$offset,"\n";
# take the 4 bytes (8 hex chars) at the offset (* 2 for hex), and drop the high bit
- my $encrypted = hex(substr($hmac, $offset * 2, 8)) & 0x7fffffff;
+ my $hex = substr($hmac, $offset * 2, 8);
+ my $encrypted = hex($hex) & 0x7fffffff;
+
+ print "hex=",sprintf("%08x", $encrypted),"\n";
+
# the token is then the last 6 digits in the number
my $token = $encrypted % 1000000;