Factor out the decryption and thus make the dependancies simpler

This commit is contained in:
Hamish Coleman 2016-04-24 15:29:44 +10:00
parent 77a0d5d5b6
commit 55d759339b
5 changed files with 10 additions and 10 deletions

View File

@ -34,8 +34,11 @@ install.radare.projects:
sha1sum -c $@.sha1
# alternatively, use the generic extractor
%.img.orig: xx30.extract %.img.orig.offset %.img.orig.sha1
./xx30.extract $@.offset $@
%.img.enc.orig: %.img.enc.orig.offset xx30.extract
./xx30.extract $< $@
%.img.orig: %.img.enc.orig %.img.orig.sha1 mec-tools/mec_encrypt
mec-tools/mec_encrypt -d $< >$@
sha1sum -c $@.sha1
# a generic encryptor
@ -64,6 +67,7 @@ install.radare.projects:
# Generate a patch report
%.diff: %.hex %.orig.hex
-diff -u $(basename $@).orig.hex $(basename $@).hex >$@
cat $@
mec-tools/Makefile:
git submodule update --init --remote
@ -75,6 +79,6 @@ mec-tools/mec_encrypt: mec-tools/Makefile
# TODO:
# - most of these dependancies could be automatically calculated
x220.8DHT34WW.extract: 8duj27us.iso.orig
x230.G2HT35WW.img.orig: g2uj23us.iso.orig mec-tools/mec_encrypt
t430.G1HT35WW.img.orig: g1uj38us.iso.orig mec-tools/mec_encrypt
t430s.G7HT39WW.img.orig: g7uj18us.iso.orig mec-tools/mec_encrypt
x230.G2HT35WW.img.enc.orig: g2uj23us.iso.orig
t430.G1HT35WW.img.enc.orig: g1uj38us.iso.orig
t430s.G7HT39WW.img.enc.orig: g7uj18us.iso.orig

View File

@ -22,11 +22,7 @@ fi
read SOURCE OFFSET LENGTH <"$INFOFILE"
# assume that output filename is blahdyblah.img.orig
OUT1=$(basename "$OUT" .orig).enc.orig
set -x
dd if=$SOURCE bs=$[$OFFSET] skip=1 | dd bs=$[$LENGTH] count=1 of="$OUT1"
mec-tools/mec_encrypt -d "$OUT1" >"$OUT"
dd if=$SOURCE bs=$[$OFFSET] skip=1 | dd bs=$[$LENGTH] count=1 of="$OUT"