diff --git a/src/Bruteforce.py b/src/Bruteforce.py index 7793ae5..dfa0787 100644 --- a/src/Bruteforce.py +++ b/src/Bruteforce.py @@ -59,12 +59,7 @@ def Bruteforce(bm, tm, knownPrefix, knownSuffix, chunksize): return knownPrefix + knownSuffix else: # good input, we stepped further - knownPrefix += res - EnableLogging() - print(f"Found new scorer, we're now at '{knownPrefix}[...]{knownSuffix}'") - DisableLogging() - - # let's examine it further - check if we hit the win breakpoint :) + # let's examine it - check if we hit the win breakpoint :) if bm.HitWin() or not bm.HitLose(): EnableLogging() print("BARF found the flag - or at least managed to hit the 'win' breakpoint!") @@ -72,6 +67,12 @@ def Bruteforce(bm, tm, knownPrefix, knownSuffix, chunksize): DisableLogging() return knownPrefix + knownSuffix + # No win breakpoint hit, but still a good step forward - proceed + knownPrefix += res + EnableLogging() + print(f"Found new scorer, we're now at '{knownPrefix}[...]{knownSuffix}'") + DisableLogging() + # Finds out the base score when filling the binary with partly correct chars (e.g. the already found-to-be-correct prefix) # It does this by combining knownPrefix + keyFragment and knownSuffix with an "impossible" character.