]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: Some instructions for configure CoverityScan using alternative compiler like...
authoriceman1001 <iceman@iuse.se>
Tue, 19 Jan 2016 20:48:29 +0000 (21:48 +0100)
committericeman1001 <iceman@iuse.se>
Tue, 19 Jan 2016 20:48:29 +0000 (21:48 +0100)
FIX: stupid clock() == -1 on systems who doesn't have it..

README.md
client/cmdhfmf.c
client/cmdhfmfhard.c
client/loclass/elite_crack.c

index 077ff0f6321c6273eb7dfee3060bbe213bd407c7..3378f33cebc165cbc8d94495d2bb6cc987921df6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -17,6 +17,24 @@ NEWS:
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/5117/badge.svg)](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. 
 Among the stuff is
 
@@ -39,6 +57,8 @@ Among the stuff is
        * 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.
 
+       * Blaposts Crapto1 v3.3
+       
        
 Give me a hint, and I'll see if I can't merge in the stuff you have. 
 
index b189e19bfaafe712dd9e5efe73dfe15c1a2a75cd..bd7fa589471bbbbfea4e0aeb3ec3b146fae82cc0 100644 (file)
@@ -30,7 +30,7 @@ int CmdHF14AMifare(const char *Cmd)
        printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n");\r
        printf("-------------------------------------------------------------------------\n");\r
 \r
-       clock_t t = clock();\r
+       clock_t t1 = clock();\r
        \r
 start:\r
     clearCommandBuffer();\r
@@ -91,9 +91,10 @@ start:
                printf("------------------------------------------------------------------\n");\r
                PrintAndLog("Found valid key: %012"llx" \n", r_key);\r
        }\r
-       t = clock() - t;\r
-       //printf("Time in darkside: %d ticks - %1.2f seconds\n", t, ((float)t)/CLOCKS_PER_SEC);\r
-       printf("Time in darkside: %Lf ticks - %1.2Lf seconds\n", (long double)t, ((long double)t)/CLOCKS_PER_SEC);\r
+       t1 = clock() - t1;\r
+       if ( t1 > 0 ){\r
+               PrintAndLog("Time in darkside: %f ticks - %1.2f sec\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC);\r
+       }\r
        return 0;\r
 }\r
 \r
@@ -675,7 +676,7 @@ int CmdHF14AMfNested(const char *Cmd)
                }\r
        }\r
        else { // ------------------------------------  multiple sectors working\r
-               clock_t time1 = clock();\r
+               clock_t t1 = clock();\r
 \r
                e_sector = calloc(SectorsCnt, sizeof(sector));\r
                if (e_sector == NULL) return 1;\r
@@ -776,7 +777,10 @@ int CmdHF14AMfNested(const char *Cmd)
                        }\r
                }\r
                \r
-               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);\r
+               t1 = clock() - t1;\r
+               if ( t1 > 0 ) {\r
+                       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);\r
+               }\r
                \r
                PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);\r
                //print them\r
@@ -1131,7 +1135,7 @@ int CmdHF14AMfChk(const char *Cmd)
                }\r
        }\r
        // time\r
-       clock_t time1 = clock();\r
+       clock_t t1 = clock();\r
                \r
        for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) {\r
                int b=blockNo;\r
@@ -1154,8 +1158,10 @@ int CmdHF14AMfChk(const char *Cmd)
                        b<127?(b+=4):(b+=16);   \r
                }\r
        }\r
-       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);\r
-               \r
+       t1 = clock() - t1;\r
+       if ( t1 > 0 ){\r
+               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);\r
+       }\r
 \r
        if (transferToEml) {\r
                uint8_t block[16];\r
index f506f4fda4c3c7687be04b37f029b08a345fedc2..f7c2f650d40f56747d72b09d06fa5ad2ef5a74e3 100644 (file)
@@ -750,11 +750,13 @@ static void simulate_acquire_nonces()
 
        } 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)", 
                total_num_nonces, 
-               ((float)clock()-time1)/CLOCKS_PER_SEC, 
-               total_num_nonces*60.0*CLOCKS_PER_SEC/((float)clock()-time1));
-
+               ((float)time1)/CLOCKS_PER_SEC, 
+               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);
                
 }
@@ -876,11 +878,14 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
                fclose(fnonces);
        }
        
+       time1 = clock() - time1;
+       if ( time1 > 0 ) {
        PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)", 
                total_num_nonces, 
-               ((float)clock()-time1)/CLOCKS_PER_SEC, 
-               total_num_nonces*60.0*CLOCKS_PER_SEC/((float)clock()-time1));
-       
+               ((float)time1)/CLOCKS_PER_SEC, 
+               total_num_nonces * 60.0 * CLOCKS_PER_SEC/(float)time1
+               );
+       }
        return 0;
 }
 
@@ -1434,47 +1439,48 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
                fclose(fstats);
        } else {
                init_nonce_memory();
-       if (nonce_file_read) {          // use pre-acquired data from file nonces.bin
-               if (read_nonce_file() != 0) {
-                       return 3;
-               }
-               Check_for_FilterFlipProperties();
-               num_good_first_bytes = MIN(estimate_second_byte_sum(), GOOD_BYTES_REQUIRED);
-       } else {                                        // acquire nonces.
-               uint16_t is_OK = acquire_nonces(blockNo, keyType, key, trgBlockNo, trgKeyType, nonce_file_write, slow);
-               if (is_OK != 0) {
-                       return is_OK;
+               if (nonce_file_read) {          // use pre-acquired data from file nonces.bin
+                       if (read_nonce_file() != 0) {
+                               return 3;
+                       }
+                       Check_for_FilterFlipProperties();
+                       num_good_first_bytes = MIN(estimate_second_byte_sum(), GOOD_BYTES_REQUIRED);
+               } else {                                        // acquire nonces.
+                       uint16_t is_OK = acquire_nonces(blockNo, keyType, key, trgBlockNo, trgKeyType, nonce_file_write, slow);
+                       if (is_OK != 0) {
+                               return is_OK;
+                       }
                }
-       }
 
-       Tests();
-
-       PrintAndLog("");
-       PrintAndLog("Sum(a0) = %d", first_byte_Sum);
-       // PrintAndLog("Best 10 first bytes: %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x",
-               // best_first_bytes[0],
-               // best_first_bytes[1],
-               // best_first_bytes[2],
-               // best_first_bytes[3],
-               // best_first_bytes[4],
-               // best_first_bytes[5],
-               // best_first_bytes[6],
-               // best_first_bytes[7],
-               // best_first_bytes[8],
-               // best_first_bytes[9]  );
-       PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes);
-
-       clock_t start_time = clock();
-       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);
-       
-       brute_force();
-       free_nonces_memory();
-       free_statelist_cache();
-       free_candidates_memory(candidates);
-       candidates = NULL;
-       }
+               Tests();
+
+               PrintAndLog("");
+               PrintAndLog("Sum(a0) = %d", first_byte_Sum);
+               // PrintAndLog("Best 10 first bytes: %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x",
+                       // best_first_bytes[0],
+                       // best_first_bytes[1],
+                       // best_first_bytes[2],
+                       // best_first_bytes[3],
+                       // best_first_bytes[4],
+                       // best_first_bytes[5],
+                       // best_first_bytes[6],
+                       // best_first_bytes[7],
+                       // best_first_bytes[8],
+                       // best_first_bytes[9]  );
+               PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes);
+
+               clock_t time1 = clock();
+               generate_candidates(first_byte_Sum, nonces[best_first_bytes[0]].Sum8_guess);
+               time1 = clock() - time1;
+               if ( time1 > 0 )
+                       PrintAndLog("Time for generating key candidates list: %1.0f seconds", ((float)time1)/CLOCKS_PER_SEC);
        
+               brute_force();
+               free_nonces_memory();
+               free_statelist_cache();
+               free_candidates_memory(candidates);
+               candidates = NULL;
+       }       
        return 0;
 }
 
index 2329e597d3f708a537b30a24e785c737607294c7..a282ec5022f07b3b16ddc0173451d55cce7cf9c5 100644 (file)
@@ -522,8 +522,8 @@ int bruteforceDump(uint8_t dump[], size_t dumpsize, uint16_t keytable[])
                errors += bruteforceItem(*attack, keytable);
        }
        free(attack);
-       clock_t t2 = clock();
-       float diff = (((float)t2 - (float)t1) / CLOCKS_PER_SEC );
+       t1 = clock() - t1;
+       float diff = ((float)t1 / CLOCKS_PER_SEC );
        prnlog("\nPerformed full crack in %f seconds",diff);
 
        // Pick out the first 16 bytes of the keytable.
Impressum, Datenschutz