


FILESCAN(1)                                           FILESCAN(1)


NAME
       filescan - compare files byte by byte


SYNOPSIS
       filescan  formula  [options...]  file_a  [+origin] [file_b
       [+origin]...]


DESCRIPTION
       Filescan compares two or more files byte by byte regarding
       a  given  expression.  The expression depends on variables
       a, b... which are the values  of  the  currents  bytes  of
       files a, b...

       The expression is defined by the syntax:

       Expr ::= Number
              | Letter
              | ( Expr )
              | - Expr
              | !  Expr
              | Expr op Expr

       Where op is one of (in order of priority):

       |
       &
       ^
       = != < > <= >=
       + -
       * / %

       Each  operator  has  the  same meaning than in C language,
       except = which replaces == (equality test).

       The expression if evaluated for each i possible with  a  =
       file_a[i + origin_a], b = file_b[i + origin_b] ...

       Each time the value is non-zero, a line is printed with i,
       a, b...


OPTIONS
       -1 -2 -4
              The values are read respectively  as  bytes,  words
              and  double  words. The default is bytes.  They are
              converted into double  words  for  the  evaluation.
              Everything is made with unsigned numbers. If the -4
              option is given, every byte will belongs to 4  val
              ues.






                              LOCAL                             1





FILESCAN(1)                                           FILESCAN(1)


       -%number
              Prints  a progression message everytime number per
              cent of the total work is done.


       -g     When used with the -2 or -4 option, tells that  the
              numbers  are  read  in  order  LSB-MSB. This is the
              default.


       -g     When used with the -2 or -4 option, tells that  the
              numbers are read in order MSB-LSB.


EXAMPLES
       Filescan  was  first  designed  as  a  tool to crack saved
       games. So these few examples will use  the  vocabulary  of
       the games:

       filescan 'a=20000 & b=19580' -2 city.sav city2.sav +1

       Search  coresponding words in city.sav and city2.sav where
       the first one is 2000 and the second  one  19580.  As  the
       name  city2  is one char longer than city, and the file is
       (maybe) one byte bigger, I assume that everything in city2
       is shifted of 1 byte, so '+1'.

       filescan '(a-b=b-c)&(c-d=2*(b-c))' save1 save2 save3 save4

       I've lost as many  energy  between  save1  and  save2  and
       between  save2 and save3, but two times more between save3
       and save4. Unfortunatly, I don't  know  the  exact  value.
       Maybe  5 or 10, I'll see the credible values on the search
       results.

       Not that you should quote the formula to prevent the shell
       from doing a filename expansion on it.


AUTHOR
       Nicolas GEORGE <nicolas.george@ens.fr>
       Student at the Ecole Normale Superieure,
       Departement de Mathematiques et d'Informatique














                              LOCAL                             2


