View Single Post
Old 01-29-2016, 04:45 PM   #25
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Phooey.
Busybox dd truncates the output file and does not accept the 'notrunc' option.

So this will take a script (almost done now) plus a copy of dd from the Debian coreutils package for armel Wheezy (yup it runs, I just checked it).

I also have a working copy of dc3dd to toss into the mix (it does file forensics while copying
- including write confirmation).

Example:
Spoiler:

Code:
$ dc3dd if=/dev/zero hof=zeros.bin hash=md5 ssz=1024 cnt=14

dc3dd 7.0.0 started at 2016-01-31 00:14:21 -0600
compiled options:
command line: dc3dd if=/dev/zero hof=zeros.bin hash=md5 ssz=1024 cnt=14
sector size: 1024 bytes (set)
14336 bytes (14 K) copied (100%), 0.201406 s, 70 K/s                          
output hashing (100%)                                                         

input results for pattern `00':
   14 sectors in
   b211778b80f6d441b6cf61ada776fc6d (md5)

output results for file `zeros.bin':
   14 sectors out
   [ok] b211778b80f6d441b6cf61ada776fc6d (md5)

dc3dd completed at 2016-01-31 00:14:21 -0600
All ones is the flash version of 'erased':
Code:
$ dc3dd pat=FF hof=ones.bin hash=md5 ssz=1024 cnt=14 nwspc=on verb=on

dc3dd 7.0.0 started at 2016-01-31 00:27:09 -0600
compiled options:
command line: dc3dd pat=FF hof=ones.bin hash=md5 ssz=1024 cnt=14 nwspc=on verb=on
sector size: 1024 bytes (set)
14336 bytes (14 K) copied (100%), 0.201417 s, 70 K/s                          
output hashing (100%)                                                         
input results for pattern `FF':
   14 sectors in
   6b2cbf063cad35950b55aee7b150b32c (md5)
output results for file `ones.bin':
   14 sectors out
   [ok] 6b2cbf063cad35950b55aee7b150b32c (md5)
dc3dd completed at 2016-01-31 00:27:10 -0600
Or a repeating text pattern:
Code:
$ dc3dd tpat="lab126 sucks! " hof=lab126.bin hash=md5 ssz=1024 cnt=14 nwspc=on verb=on

dc3dd 7.0.0 started at 2016-01-31 00:33:09 -0600
compiled options:
command line: dc3dd tpat=lab126 sucks!  hof=lab126.bin hash=md5 ssz=1024 cnt=14 nwspc=on verb=on
sector size: 1024 bytes (set)
14336 bytes (14 K) copied (100%), 0.201305 s, 70 K/s                          
output hashing (100%)                                                         
input results for pattern `lab126 sucks! ':
   14 sectors in
   879083cc441263e8205581d6dd633a6c (md5)
output results for file `lab126.bin':
   14 sectors out
   [ok] 879083cc441263e8205581d6dd633a6c (md5)
dc3dd completed at 2016-01-31 00:33:09 -0600
Yielding:
Code:
$ hexedit lab126.bin
00000000   6C 61 62 31  32 36 20 73  75 63 6B 73  21 20 6C 61  62 31 32 36  20 73 75 63  6B 73 21 20  lab126 sucks! lab126 sucks!
0000001C   6C 61 62 31  32 36 20 73  75 63 6B 73  21 20 6C 61  62 31 32 36  20 73 75 63  6B 73 21 20  lab126 sucks! lab126 sucks!
00000038   6C 61 62 31  32 36 20 73  75 63 6B 73  21 20 6C 61  62 31 32 36  20 73 75 63  6B 73 21 20  lab126 sucks! lab126 sucks!
00000054   6C 61 62 31  32 36 20 73  75 63 6B 73  21 20 6C 61  62 31 32 36  20 73 75 63  6B 73 21 20  lab126 sucks! lab126 sucks!
00000070   6C 61 62 31  32 36 20 73  75 63 6B 73  21 20 6C 61  62 31 32 36  20 73 75 63  6B 73 21 20  lab126 sucks! lab126 sucks!
Looks useful, I may play with that instead of using dd, later.
The dc3dd utility can hash its input and read-back compare with the hash of the output but it can't do partial blocks (sectors in en_DC3DD).
The dd command I have figured out. Why push my luck?

Last edited by knc1; 01-31-2016 at 02:04 AM.
knc1 is offline   Reply With Quote