Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sector to messages to avoid confusion #19

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add sector to messages to avoid confusion (Since there is only one ke…
…y per sector)
  • Loading branch information
tomvleeuwen committed Jun 5, 2017
commit ae07f5e2cd4bf0665fd4ccdea77893cbdb400478
5 changes: 3 additions & 2 deletions libnfc_crypto1_crack.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ int main (int argc, const char * argv[]) {
}
switch(nested_auth(uid, known_key, ab_key, for_block, target_block, target_key, NULL)){
case KEY_WRONG:
printf("%012"PRIx64" doesn't look like the right key %s for block %u\n", known_key, ab_key == MC_AUTH_A ? "A" : "B", for_block);
printf("%012"PRIx64" doesn't look like the right key %s for block %u (sector %u)\n", known_key, ab_key == MC_AUTH_A ? "A" : "B", for_block, for_block >> 2);
return 1;
case OK:
break;
Expand All @@ -631,7 +631,8 @@ int main (int argc, const char * argv[]) {
sprintf(filename, "0x%04x_%03u%s.txt", uid, target_block, target_key == MC_AUTH_A ? "A" : "B");
fp = fopen(filename, "wb");

printf("Found tag with uid %04x, collecting nonces for key %s of block %u using known key %s %012"PRIx64" for block %u\n", uid, target_key == MC_AUTH_A ? "A" : "B", target_block, ab_key == MC_AUTH_A ? "A" : "B", known_key, for_block);
printf("Found tag with uid %04x, collecting nonces for key %s of block %u (sector %u) using known key %s %012"PRIx64" for block %u (sector %u)\n",
uid, target_key == MC_AUTH_A ? "A" : "B", target_block, target_block >> 2, ab_key == MC_AUTH_A ? "A" : "B", known_key, for_block, for_block >> 2);
nonces_collected = 0;
nonces = malloc(sizeof (uint64_t) << 24);
memset(nonces, 0xff, sizeof (uint64_t) << 24);
Expand Down