File: hide_change

package info (click to toggle)
dar 2.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,024 kB
  • sloc: cpp: 86,219; sh: 6,978; ansic: 895; makefile: 489; python: 242; csh: 115; perl: 43; sed: 16
file content (21 lines) | stat: -rwxr-xr-x 408 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

if [ -z "$1" ] ; then
    echo "usage: $0 <filename> [<bit offset>]"
    echo "modify one bit and hide the change"
    exit 1
fi

atime=`stat "$1" | sed -rn -s 's/^Access:\s+(.*)\+.*/\1/p'`
mtime=`stat "$1" | sed -rn -s 's/^Modify:\s+(.*)\+.*/\1/p'`

bitoffset="$2"

if [ -z "$bitoffset" ] ; then
    bitoffset=2
fi

./bitflip "$bitoffset" "$1"

touch -d "$mtime" "$1"
touch -a -d "$atime" "$1"