-
Notifications
You must be signed in to change notification settings - Fork 6
Stabilize HF/SAM reads and reduce memory pressure (for running alongside qFlipper) #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
148ecd7
Add host-tested board and HF bridge policies
cindersocket 85f3bb4
Fix HF bridge synchronization and SAM key diagnostics
cindersocket c868b04
Reset HF type prompt state on cancel
cindersocket a38eca1
ccid: avoid unaligned dwLength loads
cindersocket 64b7f30
hf: reset read failure context for new reads
cindersocket 2bd8e8c
sam: surface failed key probes on the main screen
cindersocket 4536c81
worker: stop virtual credential loop on failure
cindersocket 477aebd
alloc: guard calloc size overflow
cindersocket 40a23cf
debug: remove stale hex dump blocks
cindersocket 700275a
worker: build virtual credential loop policy
cindersocket 338af29
hf: keep prompt state until teardown completes
cindersocket 9cb9df5
uart: add host-tested immutable tx frame copy
cindersocket 449d195
uart: queue immutable tx frames
cindersocket 793a57c
ccid: publish tx frames through uart queue
cindersocket 4a1d29c
uart: remove obsolete tx buffer fallback
cindersocket be6c161
uart: remove rx chunk delay
cindersocket 8839e1c
uart: compact consumed rx frames safely
cindersocket d27641e
ccid: build control frames off scratch buffer
cindersocket 7e3ed5d
t1: surface chained response allocation failures
cindersocket 30ee4df
hf: reuse plugin transmit buffers
cindersocket 8ce3a44
hf: allocate nfc host objects lazily
cindersocket fba2519
ui: release submenu during hf reads
cindersocket 01c3374
hf: avoid 14a poller data copy
cindersocket ae45a6b
ui: free inactive views during hf reads
cindersocket 2be8528
sam: fast-parse hf nfcSend responses
cindersocket f1280da
hf: avoid duplicate detect before read start
cindersocket afc6048
hf: reuse picopass host transmit buffers
cindersocket 82d2549
ui: free inactive views during config reads
cindersocket e8481de
style: apply ufbt formatting
cindersocket File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include "allocation_policy.h" | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| bool seader_size_multiply_checked(size_t count, size_t size, size_t* out) { | ||
| if(!out) { | ||
| return false; | ||
| } | ||
|
|
||
| if(count != 0U && size > SIZE_MAX / count) { | ||
| return false; | ||
| } | ||
|
|
||
| *out = count * size; | ||
| return true; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #pragma once | ||
|
|
||
| #include <stdbool.h> | ||
| #include <stddef.h> | ||
|
|
||
| bool seader_size_multiply_checked(size_t count, size_t size, size_t* out); |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #include "board_identity.h" | ||
|
|
||
| SeaderBoardClass seader_board_classify(bool pa4_high, bool pc1_high, bool pc0_high) { | ||
| if(pa4_high) { | ||
| return SeaderBoardClassUhfCarrier; | ||
| } | ||
|
|
||
| if(pc1_high || pc0_high) { | ||
| return SeaderBoardClassSamOnly; | ||
| } | ||
|
|
||
| return SeaderBoardClassNone; | ||
| } | ||
|
|
||
| bool seader_board_class_supports_uhf(SeaderBoardClass board_class) { | ||
| return board_class == SeaderBoardClassUhfCarrier; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #pragma once | ||
|
|
||
| #include <stdbool.h> | ||
|
|
||
| typedef enum { | ||
| SeaderBoardClassUnknown = 0, | ||
| SeaderBoardClassNone, | ||
| SeaderBoardClassSamOnly, | ||
| SeaderBoardClassUhfCarrier, | ||
| } SeaderBoardClass; | ||
|
|
||
| SeaderBoardClass seader_board_classify(bool pa4_high, bool pc1_high, bool pc0_high); | ||
| bool seader_board_class_supports_uhf(SeaderBoardClass board_class); |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me: loclass was copied from the proxmark3 code, which includes emulation and that required time/space tradeoffs, so there are parts that may be written to use more space, but be faster. I think i've taken a pass at it to try to clean some of that up, but it could be a place to look for further memory reduction.