chg: https://github.com/Proxmark/proxmark3/pull/558 (@pwpiwi) might solve the mystery crashes.

This commit is contained in:
iceman1001 2018-02-01 15:24:36 +01:00
parent 519cc72966
commit 1965927009
3 changed files with 36 additions and 8 deletions

View file

@ -1129,7 +1129,13 @@ static bool timeout(void)
}
static void *check_for_BitFlipProperties_thread(void *args)
static void
#ifdef __has_attribute
#if __has_attribute(force_align_arg_pointer)
__attribute__((force_align_arg_pointer))
#endif
#endif
*check_for_BitFlipProperties_thread(void *args)
{
uint8_t first_byte = ((uint8_t *)args)[0];
uint8_t last_byte = ((uint8_t *)args)[1];
@ -1701,7 +1707,6 @@ static bool all_bitflips_match(uint8_t byte, uint32_t state, odd_even_t odd_even
return false;
}
}
return true;
}
@ -1879,8 +1884,13 @@ static void init_book_of_work(void)
}
}
static void *generate_candidates_worker_thread(void *args)
static void
#ifdef __has_attribute
#if __has_attribute(force_align_arg_pointer)
__attribute__((force_align_arg_pointer))
#endif
#endif
*generate_candidates_worker_thread(void *args)
{
uint16_t *sum_args = (uint16_t *)args;
uint16_t sum_a0 = sums[sum_args[0]];

View file

@ -268,7 +268,13 @@ int Compare16Bits(const void * a, const void * b) {
}
// wrapper function for multi-threaded lfsr_recovery32
void* nested_worker_thread(void *arg) {
void
#ifdef __has_attribute
#if __has_attribute(force_align_arg_pointer)
__attribute__((force_align_arg_pointer))
#endif
#endif
*nested_worker_thread(void *arg) {
struct Crypto1State *p1;
StateList_t *statelist = arg;
statelist->head.slhead = lfsr_recovery32(statelist->ks1, statelist->nt ^ statelist->uid);
@ -681,7 +687,7 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) {
switch (traceState) {
case TRACE_IDLE:
// check packet crc16!
if ((len >= 4) && (!CheckCrc14443(CRC_14443_A, data, len))) {
if ((len >= 4) && (!check_crc(CRC_14443_A, data, len))) {
PrintAndLog("DEC| CRC ERROR!!!");
AddLogLine(logHexFileName, "DEC| ", "CRC ERROR!!!");
traceState = TRACE_ERROR; // do not decrypt the next commands

View file

@ -104,7 +104,13 @@ bool hookUpPM3() {
}
// (iceman) if uart_receiver fails a command three times, we conside the device to be offline.
void *uart_receiver(void *targ) {
void
#ifdef __has_attribute
#if __has_attribute(force_align_arg_pointer)
__attribute__((force_align_arg_pointer))
#endif
#endif
*uart_receiver(void *targ) {
struct receiver_arg *arg = (struct receiver_arg*)targ;
size_t rxlen;
bool tmpsignal;
@ -150,7 +156,13 @@ void *uart_receiver(void *targ) {
return NULL;
}
void main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
void
#ifdef __has_attribute
#if __has_attribute(force_align_arg_pointer)
__attribute__((force_align_arg_pointer))
#endif
#endif
main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
struct receiver_arg rarg;
char *cmd = NULL;