Skip to content

06_Licensing

heguangyu5 edited this page Oct 7, 2023 · 3 revisions

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:

  1. server signature
  2. public key
  3. expired date
  4. 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.scm

Now try to read the scheme code to see how licensing checks are generated if you like.

Clone this wiki locally