再说一下strip,在LINUX下通过strip的帮助看到以下信息:
[root@localhost root]# strip --help
Usage: strip <option(s)> in-file(s)
Removes symbols and sections from files
The options are:
-I --input-target=<bfdname> Assume input file is in format <bfdname>
-O --output-target=<bfdname> Create an output file in format <bfdname>
-F --target=<bfdname> Set both input and output format to <bfdname> -p --preserve-dates Copy modified/access timestamps to the output -R --remove-section=<name> Remove section <name> from the output
-s --strip-all Remove all symbol and relocation information
-g -S -d --strip-debug Remove all debugging symbols
--strip-unneeded Remove all symbols not needed by relocations
-N --strip-symbol=<name> Do not copy symbol <name>
-K --keep-symbol=<name> Only copy symbol <name>
-x --discard-all Remove all non-global symbols
-X --discard-locals Remove any compiler-generated symbols
-v --verbose List all object files modified
-V --version Display this program's version number
-h --help Display this output
-o <file> Place stripped output into <file>
大家注意-x.-X选项,这就是可以去掉某些符号声明,从而让nm看不到你想要隐藏的信息,也让用户看不到相应信息,还有-K选项,它可以用于伪装,给用户造成假象,其原理也是通过修改符号表来实现的!!!