View Single Post
  #10  
Old 06-02-2016, 23:14
UniSoft's Avatar
UniSoft UniSoft is offline
Family
 
Join Date: May 2010
Location: Shenzhen, China
Posts: 124
Rept. Given: 24
Rept. Rcvd 259 Times in 42 Posts
Thanks Given: 25
Thanks Rcvd at 406 Times in 73 Posts
UniSoft Reputation: 200-299 UniSoft Reputation: 200-299 UniSoft Reputation: 200-299
Code:
#define EXP7(x)  ((x) * (x) * (x) * (x) * (x) * (x) * (x))

uint64_t res = 0x90de757572b51cd3ULL;
uint64_t key = 0;
uint64_t mask = 1ULL;

while (mask)
{
    if ((EXP7(key) ^ res) & mask)
    {
        key |= mask;
        if ((EXP7(key) ^ res) & mask)
            break;
    }
    mask <<= 1;
}

if (mask)
    printf("not found");
else
    printf("found: 0x%llX", key);

Last edited by UniSoft; 06-04-2016 at 00:11.
Reply With Quote
The Following 4 Users Say Thank You to UniSoft For This Useful Post:
an0rma1 (06-03-2016), dila (06-03-2016), |roe (06-08-2016)