1
0
Fork 0
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:
Steffen Vogel 2015-05-09 23:48:25 +02:00
parent 19786b0917
commit a03c37106a

View file

@ -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