Created a Trace Parser Library to just have something to allow for lua scripts to be able to read .TRACE structured files.
Signed-off-by: Adam Jon Foster <me@evildaemond.com>
CheckExecute() has a flag to tell it if a check needs opencl support or
not and can automatically disable the check if opencl checks are not
requested. Mostly copy and paste the same feature into CheckFileExist
and add it where needed.
Strangely only detected by Ubuntu 18.4 gcc 7.5.0
```
[-] CC src/cmdhflist.c
In file included from /usr/include/string.h:494:0,
from src/cmdhfict.c:21:
In function 'memcpy',
inlined from 'diversify_mifare_key' at src/cmdhfict.c:151:5,
inlined from 'derive_mifare_key' at src/cmdhfict.c:189:5,
inlined from 'CmdHfIctReader' at src/cmdhfict.c:199:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: error: '__builtin___memcpy_chk' writing 8 bytes into a region of size 6 overflows the destination [-Werror=stringop-overflow=]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'memcpy',
inlined from 'diversify_mifare_key' at src/cmdhfict.c:151:5,
inlined from 'derive_mifare_key' at src/cmdhfict.c:189:5,
inlined from 'CmdHfIctReader' at src/cmdhfict.c:203:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: error: '__builtin___memcpy_chk' writing 8 bytes into a region of size 6 overflows the destination [-Werror=stringop-overflow=]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
```c
uint8_t diverse[MIFARE_KEY_SIZE]; // = 6
diversify_mifare_key(uid, diverse);
```
```c
static int diversify_mifare_key(const uint8_t *uid, uint8_t *app_key) {
...
uint8_t output[8];
...
memcpy(app_key, output, sizeof(output));
```