Repository navigation
Add manual exploit-sector, target-sector, and thread-count control flags - #31
Open
doomfrawen wants to merge 1 commit into
Open
doomfrawen wants to merge 1 commit into
doomfrawen wants to merge 1 commit into
Conversation
Previously the tool always auto-picked the exploit (pivot) sector via
find_exploit_sector() - the highest-numbered sector with a known key -
and always attacked every sector still missing a key, with no way to
override either choice. Also always used num_CPUs() logical cores with
no way to change the worker thread count.
Adds three flags, all off by default (existing auto-detect behavior is
unchanged unless one is passed):
-e <sector> force this sector as the exploit/pivot sector
(errors out if it has no known key)
-s <sector[,sector]> only attack the listed sector(s), instead of
every sector still missing a key
-j <n> override the worker thread count instead of
the auto-detected logical CPU count
-j is implemented as a single override point in num_CPUs() (util.c),
so it changes both the bit-flip-property threads and the hardnested
brute-force worker threads consistently, without touching every call
site individually.
-s only filters the (expensive) nested/hardnested recovery loop, not
the initial default-key sweep - the sweep needs to check every sector
regardless, since find_exploit_sector() (or -e) depends on knowing
which sectors already have a default key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Previously the tool always auto-picked the exploit (pivot) sector via `find_exploit_sector()` (the highest-numbered sector with a known key) and always attacked every sector still missing a key, with no way to override either choice. It also always used `num_CPUs()` logical cores with no way to change the worker thread count.
Adds three flags, all off by default (existing auto-detect behavior is unchanged unless one is passed):
`-j` is implemented as a single override point in `num_CPUs()` (`util.c`), so it changes both the bit-flip-property threads and the hardnested brute-force worker threads consistently, without touching every call site individually.
`-s` only filters the (expensive) nested/hardnested recovery loop, not the initial default-key sweep - the sweep needs to check every sector regardless, since `find_exploit_sector()` (or `-e`) depends on knowing which sectors already have a default key.
Test plan
Tested on real hardware (MinGW-w64 + libnfc + PC/SC reader, MIFARE Classic 1K card, Intel i7-8650U/4C8T):