-
Notifications
You must be signed in to change notification settings - Fork 3
06_Licensing
BPC comes with robust licensing machine, any trying to bypass the licensing will be time-consuming and rewardless.
The base theory is super simple and straightforward:
To bypass the licensing check, the hacker must locate the if condition:
if (/* LICENSE CHECK OK*/) { // continue } else { // error }locate one condition takes some time, and What if there are hundreds of thousands conditions ?
BPC currently support four types of licensing check:
- server signature
- public key
- expired date
- fixed time
and we could add more if needed.
There's another option --min-checks NUM which can set the number of licensing checks to generate.
These checks will be inserted into the generated scheme code at appropriate places.
Before we release our server-signature tool, you can only use --expired-date and --fixed-time.
Let's see it in action:
$ cat -n hello.php
1 <?php
2
3 echo "hello1\n";
4 echo "hello2\n";
5 echo "hello3\n";
6 echo "hello4\n";
7 echo "hello5\n";
8 echo "hello6\n";
$ bpc --expired-date 2030-12-31 --min-checks 10 hello.php
$ tree .bpc-build-XXXX/
.bpc-build-XXXX/
├── 1f38f36f0f9ea0a327debe3274fd0627.scm
├── 1f38f36f0f9ea0a327debe3274fd0627_u.o
├── build.ninja
├── hello-classes.scm
├── hello-classes_u.o
├── hello.scm
├── hello_u.o
├── main.c
└── main_u.o
0 directories, 9 files
$ vi .bpc-build-XXXX/a26c1e0efe496cba567475b9d1e761c4.scmNow try to read the scheme code to see how licensing checks are generated if you like.