@@ -39,7 +39,7 @@ void print_char_reg(char* to_print, unsigned len) {
3939bool check_pass (char * psswd) { // NOTE: Will only check correctly 6 char passwords
4040 char salt[9 ] = " hfT7jp2q" ;
4141 char hash[23 ] = " v8XH/MrpaYdagdMgM4yKc." ; // THIS IS THE REAL HASH
42- // char hash[23] = "Kx3u7/FpY8TZv0y2tgyGC1 ";
42+ // char hash[23] = "O53e58A82lSBz1tJeJRfY/ ";
4343 char magic[4 ] = " $1$" ;
4444 // compute alternate sum
4545 char input[21 ];
@@ -143,7 +143,7 @@ int main(int argc, char** argv) { // TODO:
143143
144144 double duration;
145145 time_t start;
146-
146+
147147 start = clock ();
148148 thread t1 (check_block, begin_1, end_1, 0 );
149149 // thread t2(check_block, begin_2, end_2, 0);
@@ -180,7 +180,7 @@ void compute_primitive_md5(char* input, unsigned in_len, char* digest) {
180180 MD5_Init (context);
181181 MD5_Update (context, (unsigned char *)(input), in_len);
182182 MD5_Final ((unsigned char *)(digest), context);
183- // delete context;
183+ delete context;
184184 // MD5((unsigned char*)(input), in_len, (unsigned char*)(digest)); //compute the md5 (which is also the altsum)
185185 return ;
186186}
@@ -248,11 +248,12 @@ void interm_1000(char* psswd, unsigned p_len, char* salt, unsigned s_len, char*
248248 memcpy (working_final + working_final_len, psswd, p_len);
249249 working_final_len += p_len;
250250 }
251- if (i % 3 != 0 ) { // if not divisible by 3, salt
251+ if ((i >= 3 ? i % 3 : i) != 0 ) { // if not divisible by 3, salt
252252 memcpy (working_final + working_final_len, salt, s_len);
253253 working_final_len += s_len;
254254 }
255- if (i % 7 != 0 ) { // if not divisible by 7, password
255+ // if (i % 7 != 0) { // if not divisible by 7, password
256+ if ((i >= 7 ? i % 7 : i) != 0 ) { // FASSSSSTTTTTT
256257 memcpy (working_final + working_final_len, psswd, p_len);
257258 working_final_len += p_len;
258259 }
@@ -297,11 +298,13 @@ void rearrange(char * finalsum, unsigned sum_len, char* partitioned_stuff) {
297298 partitioned_stuff[i+1 ] = gimme_char (((new_order[0 ] & 0xc0 ) >> 6 ) | ((new_order[1 ] & 0xf ) << 2 ));
298299 partitioned_stuff[i+2 ] = gimme_char (((new_order[1 ] & 0xf0 ) >> 4 ) | ((new_order[2 ] & 0x3 ) << 4 ));
299300 partitioned_stuff[i+3 ] = gimme_char ((new_order[2 ] & 0xfc ) >> 2 );
300- new_order = new_order + 3 ;
301+ new_order += 3 ;
301302 }
302303 partitioned_stuff[21 ] = gimme_char ((new_order[0 ] & 0xc0 ) >> 6 );
303304 partitioned_stuff[20 ] = gimme_char ((new_order[0 ] & 0x3f ));
304305 partitioned_stuff[22 ] = ' \0 ' ;
306+ new_order -= 15 ;
307+ delete [] new_order;
305308 return ;
306309}
307310
0 commit comments