mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
hitag2crack fixes for some archs
This commit is contained in:
@@ -276,7 +276,7 @@ static void jumpnsteps(Hitag_State *hstate, int table) {
|
||||
static void *buildtable(void *dd) {
|
||||
Hitag_State hstate;
|
||||
Hitag_State hstate2;
|
||||
unsigned long maxentries = 1;
|
||||
unsigned long long maxentries = 1ULL;
|
||||
int index = (int)(long)dd;
|
||||
int tnum = NUM_BUILD_THREADS;
|
||||
|
||||
@@ -303,7 +303,7 @@ static void *buildtable(void *dd) {
|
||||
}
|
||||
|
||||
/* make the entries */
|
||||
for (unsigned long i = 0; i < maxentries; i++) {
|
||||
for (unsigned long long i = 0; i < maxentries; i++) {
|
||||
|
||||
// copy the current state
|
||||
hstate2.shiftreg = hstate.shiftreg;
|
||||
|
||||
@@ -273,7 +273,7 @@ static void *crack(void *d) {
|
||||
printf("\n\nSuccess - key = %012"PRIx64"\n", foundkey);
|
||||
exit(0);
|
||||
|
||||
return (void *)foundkey;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -405,7 +405,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
printf("thread %i finished\n", i);
|
||||
if (status) {
|
||||
printf("Key = %012"PRIx64"\n", (uint64_t)status);
|
||||
printf("Key = %012"PRIx64"\n", *(uint64_t *)status);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
#include "ht2crackutils.h"
|
||||
|
||||
const uint8_t bits[9] = {20, 14, 4, 3, 1, 1, 1, 1, 1};
|
||||
@@ -202,7 +203,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
static void *find_state(void *thread_d) {
|
||||
uint64_t thread = (uint64_t)thread_d;
|
||||
uint64_t thread = (uintptr_t)thread_d;
|
||||
|
||||
for (uint64_t index = thread; index < layer_0_found; index += thread_count) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user