Skip to content

Commit

Permalink
CLI: make mfkey32v2 Windows friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
p-l- committed Aug 20, 2024
1 parent 636b5bc commit 473ffa1
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions software/src/mfkey32v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,11 @@ int main(int argc, char *argv[]) {
return 0;
}
else if (argc == 2 && ! strncmp(argv[1], "--server", 9)) {
char *line =NULL;
size_t len = 0;
ssize_t line_size;
while(true) {
line_size = getline(&line, &len, stdin);
if (line_size > 1) {
sscanf(line, "%x %x %x %x %x %x %x\n", &uid, &nt0, &nr0_enc, &ar0_enc, &nt1, &nr1_enc, &ar1_enc);
attack(uid, nt0, nr0_enc, ar0_enc, nt1, nr1_enc, ar1_enc, false);
}
else {
break;
}
}
char line[63];
while(fgets(line, sizeof(line), stdin)) {
sscanf(line, "%x %x %x %x %x %x %x\n", &uid, &nt0, &nr0_enc, &ar0_enc, &nt1, &nr1_enc, &ar1_enc);
attack(uid, nt0, nr0_enc, ar0_enc, nt1, nr1_enc, ar1_enc, false);
}
}
else {
printf("syntax: %s <uid> <nt> <nr_0> <ar_0> <nt1> <nr_1> <ar_1>\n", argv[0]);
Expand Down

0 comments on commit 473ffa1

Please sign in to comment.