diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2014-02-07 20:28:59 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2014-02-07 20:28:59 +0100 |
commit | 73e3ce99ef6aab6c9c801a38a0902b469c2340f6 (patch) | |
tree | c1706489bdd33ce036fca2659845319897349811 /src | |
parent | 00a8ae93bc88d8cdf1aecc7f3c410359af987c3c (diff) |
Report progress
Diffstat (limited to 'src')
-rw-r--r-- | src/extractblocks_new.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/extractblocks_new.c b/src/extractblocks_new.c index 580d3ad..fe85252 100644 --- a/src/extractblocks_new.c +++ b/src/extractblocks_new.c | |||
@@ -29,7 +29,7 @@ static uint8_t mantra_in[] = { 0x68, 0x35, 0x2d, 0x6c }; | |||
29 | int main( int args, char **argv ) | 29 | int main( int args, char **argv ) |
30 | { | 30 | { |
31 | int filenum = 0, run = 1; | 31 | int filenum = 0, run = 1; |
32 | size_t offset = 0, oldoffset = -1, enc_len = 32; | 32 | size_t offset = 0, oldoffset = -1, reported = 0, enc_len = 32; |
33 | uint8_t mantra[4], id0, id5, *mappedfile; | 33 | uint8_t mantra[4], id0, id5, *mappedfile; |
34 | MAP map; | 34 | MAP map; |
35 | 35 | ||
@@ -72,7 +72,14 @@ int main( int args, char **argv ) | |||
72 | ( mappedfile[ offset + 6 ] != ( '-' ^ mantra[2] )) | 72 | ( mappedfile[ offset + 6 ] != ( '-' ^ mantra[2] )) |
73 | ) ) offset++; | 73 | ) ) offset++; |
74 | 74 | ||
75 | printf( "Found an appropriate offset at: %zd\n", offset ); | 75 | // printf( "Found an appropriate offset at: %zd\n", offset ); |
76 | |||
77 | if( reported < ( offset * 10 ) / map->size ) | ||
78 | { | ||
79 | reported++; | ||
80 | printf( "%zd%% ", 10 * reported ); | ||
81 | fflush( stdout ); | ||
82 | } | ||
76 | 83 | ||
77 | if( offset == map->size ) | 84 | if( offset == map->size ) |
78 | run = 0; | 85 | run = 0; |