diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-05-20 09:23:28 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-05-20 09:23:28 +0200 |
commit | e82a5474b7d50e313a3a9022841744914bdef78d (patch) | |
tree | 2123b09f3bbc076e9a096e635a017e59af126fe4 | |
parent | d1e408a2f7931732bc98809d36c28c47563fdbd3 (diff) | |
download | abaos-e82a5474b7d50e313a3a9022841744914bdef78d.tar.gz abaos-e82a5474b7d50e313a3a9022841744914bdef78d.tar.bz2 |
stronger magic test
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/stage2_functions.asm | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile index 1b77e89..34b1cb4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,7 @@ LD := ld NASMFLAGS := -f elf32 NASM := nasm OBJCOPY := objcopy -MAGIC = $(shell printf '%x' `date +%s`) +MAGIC := $(shell printf '%x' `date +%s`) all: image.bin kernel.sym diff --git a/src/stage2_functions.asm b/src/stage2_functions.asm index 208c2e4..37d8075 100644 --- a/src/stage2_functions.asm +++ b/src/stage2_functions.asm @@ -184,8 +184,7 @@ check_magic: sub edx, MAGICLEN ; subtract the length of the magic string mov esi, edx ; now use edx as first string address to compare to mov edi, COMPARE_MAGIC ; position of second string - mov ecx, MAGICLEN-2 ; length of the magic string, we can have a second - ; (one digit) tolerance when comparing + mov ecx, MAGICLEN ; length of the magic string repe cmpsb jne .ok jmp .mismatch |