mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
add additional check agains reverse engeneering
This commit is contained in:
parent
19786b0917
commit
a03c37106a
1 changed files with 5 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/ptrace.h>
|
||||
|
||||
/** Check for correct license */
|
||||
static inline __attribute__((always_inline)) int check_license()
|
||||
|
@ -17,6 +18,9 @@ static inline __attribute__((always_inline)) int check_license()
|
|||
{ "/dev/sda2", "\x53\xf6\xb5\xeb\x8b\x16\x46\xdc\x8d\x8f\x5b\x70\xb8\xc9\x1a\x2a", 0x468 }, /* EXT4 UUID */
|
||||
};
|
||||
|
||||
if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0)
|
||||
return -1;
|
||||
|
||||
if (time(NULL) > VALID_UNTIL)
|
||||
return -1;
|
||||
|
||||
|
@ -39,5 +43,5 @@ static inline __attribute__((always_inline)) int check_license()
|
|||
return 0;
|
||||
}
|
||||
#else
|
||||
#define check_license()
|
||||
#define check_license() (0)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue