Skip to content

Commit

Permalink
Critical bug fix
Browse files Browse the repository at this point in the history
-Fixed buffer overflow bug that was causing BitCrack.exe to crash when using address list
  • Loading branch information
brichard19 committed Jul 28, 2018
1 parent ae21e15 commit 5d293e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions KeyFinderLib/KeyFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ void KeyFinder::setTargetHashes()

cudaError_t err = setTargetHash(targets);
if(err) {
throw KeyFinderException("Error initializing device");
std::string cudaErrorString(cudaGetErrorString(err));

throw KeyFinderException("Error initializing device: " + cudaErrorString);
}
}

Expand Down Expand Up @@ -145,7 +147,12 @@ void KeyFinder::init()
secp256k1::ecpoint g = secp256k1::G();
secp256k1::ecpoint p = secp256k1::multiplyPoint(secp256k1::uint256(_numThreads * _numBlocks * _pointsPerThread), g);

if(setIncrementorPoint(p.x, p.y)) {
cudaError_t err = setIncrementorPoint(p.x, p.y);
if(err) {
std::string cudaErrorString(cudaGetErrorString(err));

throw KeyFinderException("Error initializing device: " + cudaErrorString);

throw KeyFinderException("Error initializing device");
}
}
Expand Down
2 changes: 1 addition & 1 deletion KeyFinderLib/KeyFinder.cu
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static cudaError_t setTargetBloomFilter(const std::vector<struct hash160> &targe
undoRMD160FinalRound(targets[i].h, h);

for(int j = 0; j < 5; j++) {
unsigned int idx = h[i] & 0xffff;
unsigned int idx = h[j] & 0xffff;

filter[idx / 32] |= (0x01 << (idx % 32));
}
Expand Down

0 comments on commit 5d293e0

Please sign in to comment.