mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
ADD: Some instructions for configure CoverityScan using alternative compiler like the ARM-NONE-EABI-GCC
FIX: stupid clock() == -1 on systems who doesn't have it..
This commit is contained in:
parent
8ceb1addcd
commit
b112787d4f
4 changed files with 85 additions and 53 deletions
20
README.md
20
README.md
|
@ -17,6 +17,24 @@ NEWS:
|
||||||
[](https://scan.coverity.com/projects/proxmark3-iceman-fork)
|
[](https://scan.coverity.com/projects/proxmark3-iceman-fork)
|
||||||
|
|
||||||
|
|
||||||
|
## Coverity Scan Config && Run
|
||||||
|
|
||||||
|
Download the Coverity Scan Self-buld and install it.
|
||||||
|
You will need to configure ARM-NON-EABI- Compiler for it to use:
|
||||||
|
|
||||||
|
:: Configure
|
||||||
|
cov-configure --comptype gcc --compiler /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc
|
||||||
|
|
||||||
|
::run it (I'm running on Ubuntu)
|
||||||
|
cov-build --dir cov-int make all UBUNTU_1404_QT4=1
|
||||||
|
|
||||||
|
:: make a tarball
|
||||||
|
tar czvf proxmark3.tgz cov-int
|
||||||
|
|
||||||
|
:: upload it to coverity.com
|
||||||
|
|
||||||
|
## Whats changed?
|
||||||
|
|
||||||
Whats in this fork? I have scraped the web for different enhancements to the PM3 source code and not all of them ever found their way to the master branch.
|
Whats in this fork? I have scraped the web for different enhancements to the PM3 source code and not all of them ever found their way to the master branch.
|
||||||
Among the stuff is
|
Among the stuff is
|
||||||
|
|
||||||
|
@ -39,6 +57,8 @@ Among the stuff is
|
||||||
* A Bruteforce for T55XX passwords against tag.
|
* A Bruteforce for T55XX passwords against tag.
|
||||||
* A Bruteforce for AWID 26, starting w a facilitycode then trying all 0xFFFF cardnumbers via simulation. To be used against a AWID Reader.
|
* A Bruteforce for AWID 26, starting w a facilitycode then trying all 0xFFFF cardnumbers via simulation. To be used against a AWID Reader.
|
||||||
|
|
||||||
|
* Blaposts Crapto1 v3.3
|
||||||
|
|
||||||
|
|
||||||
Give me a hint, and I'll see if I can't merge in the stuff you have.
|
Give me a hint, and I'll see if I can't merge in the stuff you have.
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ int CmdHF14AMifare(const char *Cmd)
|
||||||
printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n");
|
printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n");
|
||||||
printf("-------------------------------------------------------------------------\n");
|
printf("-------------------------------------------------------------------------\n");
|
||||||
|
|
||||||
clock_t t = clock();
|
clock_t t1 = clock();
|
||||||
|
|
||||||
start:
|
start:
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
|
@ -91,9 +91,10 @@ start:
|
||||||
printf("------------------------------------------------------------------\n");
|
printf("------------------------------------------------------------------\n");
|
||||||
PrintAndLog("Found valid key: %012"llx" \n", r_key);
|
PrintAndLog("Found valid key: %012"llx" \n", r_key);
|
||||||
}
|
}
|
||||||
t = clock() - t;
|
t1 = clock() - t1;
|
||||||
//printf("Time in darkside: %d ticks - %1.2f seconds\n", t, ((float)t)/CLOCKS_PER_SEC);
|
if ( t1 > 0 ){
|
||||||
printf("Time in darkside: %Lf ticks - %1.2Lf seconds\n", (long double)t, ((long double)t)/CLOCKS_PER_SEC);
|
PrintAndLog("Time in darkside: %f ticks - %1.2f sec\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,7 +676,7 @@ int CmdHF14AMfNested(const char *Cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // ------------------------------------ multiple sectors working
|
else { // ------------------------------------ multiple sectors working
|
||||||
clock_t time1 = clock();
|
clock_t t1 = clock();
|
||||||
|
|
||||||
e_sector = calloc(SectorsCnt, sizeof(sector));
|
e_sector = calloc(SectorsCnt, sizeof(sector));
|
||||||
if (e_sector == NULL) return 1;
|
if (e_sector == NULL) return 1;
|
||||||
|
@ -776,7 +777,10 @@ int CmdHF14AMfNested(const char *Cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLog("Time in nested: %1.2f (%1.2f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/iterations/CLOCKS_PER_SEC);
|
t1 = clock() - t1;
|
||||||
|
if ( t1 > 0 ) {
|
||||||
|
PrintAndLog("Time in nested: %f ticks %1.2f sec (%1.2f sec per key)\n\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC, ((float)t1)/iterations/CLOCKS_PER_SEC);
|
||||||
|
}
|
||||||
|
|
||||||
PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);
|
PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);
|
||||||
//print them
|
//print them
|
||||||
|
@ -1131,7 +1135,7 @@ int CmdHF14AMfChk(const char *Cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// time
|
// time
|
||||||
clock_t time1 = clock();
|
clock_t t1 = clock();
|
||||||
|
|
||||||
for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) {
|
for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) {
|
||||||
int b=blockNo;
|
int b=blockNo;
|
||||||
|
@ -1154,8 +1158,10 @@ int CmdHF14AMfChk(const char *Cmd)
|
||||||
b<127?(b+=4):(b+=16);
|
b<127?(b+=4):(b+=16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("Time in checkkeys: %1.3f (%1.3f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/keycnt/CLOCKS_PER_SEC);
|
t1 = clock() - t1;
|
||||||
|
if ( t1 > 0 ){
|
||||||
|
printf("Time in checkkeys: %f ticks %1.2f sec (%1.2f sec per key)\n\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC, ((float)t1)/keycnt/CLOCKS_PER_SEC);
|
||||||
|
}
|
||||||
|
|
||||||
if (transferToEml) {
|
if (transferToEml) {
|
||||||
uint8_t block[16];
|
uint8_t block[16];
|
||||||
|
|
|
@ -750,11 +750,13 @@ static void simulate_acquire_nonces()
|
||||||
|
|
||||||
} while (num_good_first_bytes < GOOD_BYTES_REQUIRED);
|
} while (num_good_first_bytes < GOOD_BYTES_REQUIRED);
|
||||||
|
|
||||||
|
time1 = clock() - time1;
|
||||||
|
if ( time1 > 0 ) {
|
||||||
PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)",
|
PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)",
|
||||||
total_num_nonces,
|
total_num_nonces,
|
||||||
((float)clock()-time1)/CLOCKS_PER_SEC,
|
((float)time1)/CLOCKS_PER_SEC,
|
||||||
total_num_nonces*60.0*CLOCKS_PER_SEC/((float)clock()-time1));
|
total_num_nonces * 60.0 * CLOCKS_PER_SEC/(float)time1);
|
||||||
|
}
|
||||||
fprintf(fstats, "%d;%d;%d;%1.2f;", total_num_nonces, total_added_nonces, num_good_first_bytes, CONFIDENCE_THRESHOLD);
|
fprintf(fstats, "%d;%d;%d;%1.2f;", total_num_nonces, total_added_nonces, num_good_first_bytes, CONFIDENCE_THRESHOLD);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -876,11 +878,14 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
|
||||||
fclose(fnonces);
|
fclose(fnonces);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time1 = clock() - time1;
|
||||||
|
if ( time1 > 0 ) {
|
||||||
PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)",
|
PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)",
|
||||||
total_num_nonces,
|
total_num_nonces,
|
||||||
((float)clock()-time1)/CLOCKS_PER_SEC,
|
((float)time1)/CLOCKS_PER_SEC,
|
||||||
total_num_nonces*60.0*CLOCKS_PER_SEC/((float)clock()-time1));
|
total_num_nonces * 60.0 * CLOCKS_PER_SEC/(float)time1
|
||||||
|
);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1464,9 +1469,11 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
|
||||||
// best_first_bytes[9] );
|
// best_first_bytes[9] );
|
||||||
PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes);
|
PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes);
|
||||||
|
|
||||||
clock_t start_time = clock();
|
clock_t time1 = clock();
|
||||||
generate_candidates(first_byte_Sum, nonces[best_first_bytes[0]].Sum8_guess);
|
generate_candidates(first_byte_Sum, nonces[best_first_bytes[0]].Sum8_guess);
|
||||||
PrintAndLog("Time for generating key candidates list: %1.0f seconds", (float)(clock() - start_time)/CLOCKS_PER_SEC);
|
time1 = clock() - time1;
|
||||||
|
if ( time1 > 0 )
|
||||||
|
PrintAndLog("Time for generating key candidates list: %1.0f seconds", ((float)time1)/CLOCKS_PER_SEC);
|
||||||
|
|
||||||
brute_force();
|
brute_force();
|
||||||
free_nonces_memory();
|
free_nonces_memory();
|
||||||
|
@ -1474,7 +1481,6 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
|
||||||
free_candidates_memory(candidates);
|
free_candidates_memory(candidates);
|
||||||
candidates = NULL;
|
candidates = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -522,8 +522,8 @@ int bruteforceDump(uint8_t dump[], size_t dumpsize, uint16_t keytable[])
|
||||||
errors += bruteforceItem(*attack, keytable);
|
errors += bruteforceItem(*attack, keytable);
|
||||||
}
|
}
|
||||||
free(attack);
|
free(attack);
|
||||||
clock_t t2 = clock();
|
t1 = clock() - t1;
|
||||||
float diff = (((float)t2 - (float)t1) / CLOCKS_PER_SEC );
|
float diff = ((float)t1 / CLOCKS_PER_SEC );
|
||||||
prnlog("\nPerformed full crack in %f seconds",diff);
|
prnlog("\nPerformed full crack in %f seconds",diff);
|
||||||
|
|
||||||
// Pick out the first 16 bytes of the keytable.
|
// Pick out the first 16 bytes of the keytable.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue