Generic ECC pubkey replacer by tanker, v1.30, 2009-10-11

2009-10-11 v1.30
  Add new option: -f
  -f  force replace pubkey whateven the tool found with the default public key;
  -y  say "Yes" to replace, only files have the same pubkey with the first file will be replaced.

2009-10-10 v1.20
  Fix bug when searching for pubkey

2009-10-07 v1.10
  Support Win32(Can replace pubkey in modelsim & cdslmd.exe)

2009-10-06 v1.00
  Add more search patten;
  Test with Magma talus;
  Add sample license files.
2009-10-06 v0.99
  Initial release.

This is a generic ECC pubkey replacer, it will replace target application's ECC public key with a known one.
Then you can use a known ECC private key generate a valid license.

Feature:
1. Replace public key in target application, only modify data segment, not code segment;
2. Buy replacing public key in vendor daemon, you can start floating license(test in cdslmd);
3. Support linux x32 & x64 ELF files, including execution files and libraries.

Usage:
1. Copy the pubkey file to your linux box, in the application directory.
2. Run the "pubkey -d xxx", xxx is the vendor name, for example, pubkey -d cdslmd. The replacer will search public key in files.
3. If ok(sometimes some files can't find pubkey), add "-y" to command line, like pubkey -d cdslmd -y. The replacer will replace all public it found in files.

4. In Windows, run the license generator with a known private key, like lmcrypt_cdslmd.exe. lmcrypt_cdslmd -i xxx.dat -o yyy.dat
5. Copy the new generated license file(yyy.dat) to your linux box, and have fun!

Note: 
1. Only support 239bit ECC now, so you must use a 120-char SIGN or SING2;
2. If you want to modify only one file, just run "pubkey -d xxx -y filename"
