Skip to content
Merged
Show file tree
Hide file tree
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 Jun 17, 2026
85f3bb4
Fix HF bridge synchronization and SAM key diagnostics
cindersocket Jun 17, 2026
c868b04
Reset HF type prompt state on cancel
cindersocket Jun 17, 2026
a38eca1
ccid: avoid unaligned dwLength loads
cindersocket Jun 17, 2026
64b7f30
hf: reset read failure context for new reads
cindersocket Jun 17, 2026
2bd8e8c
sam: surface failed key probes on the main screen
cindersocket Jun 17, 2026
4536c81
worker: stop virtual credential loop on failure
cindersocket Jun 17, 2026
477aebd
alloc: guard calloc size overflow
cindersocket Jun 17, 2026
40a23cf
debug: remove stale hex dump blocks
cindersocket Jun 17, 2026
700275a
worker: build virtual credential loop policy
cindersocket Jun 17, 2026
338af29
hf: keep prompt state until teardown completes
cindersocket Jun 17, 2026
9cb9df5
uart: add host-tested immutable tx frame copy
cindersocket Jun 17, 2026
449d195
uart: queue immutable tx frames
cindersocket Jun 17, 2026
793a57c
ccid: publish tx frames through uart queue
cindersocket Jun 17, 2026
4a1d29c
uart: remove obsolete tx buffer fallback
cindersocket Jun 17, 2026
be6c161
uart: remove rx chunk delay
cindersocket Jun 17, 2026
8839e1c
uart: compact consumed rx frames safely
cindersocket Jun 17, 2026
d27641e
ccid: build control frames off scratch buffer
cindersocket Jun 17, 2026
7e3ed5d
t1: surface chained response allocation failures
cindersocket Jun 17, 2026
30ee4df
hf: reuse plugin transmit buffers
cindersocket Jun 17, 2026
8ce3a44
hf: allocate nfc host objects lazily
cindersocket Jun 17, 2026
fba2519
ui: release submenu during hf reads
cindersocket Jun 18, 2026
01c3374
hf: avoid 14a poller data copy
cindersocket Jun 18, 2026
ae45a6b
ui: free inactive views during hf reads
cindersocket Jun 18, 2026
2be8528
sam: fast-parse hf nfcSend responses
cindersocket Jun 18, 2026
f1280da
hf: avoid duplicate detect before read start
cindersocket Jun 18, 2026
afc6048
hf: reuse picopass host transmit buffers
cindersocket Jun 18, 2026
82d2549
ui: free inactive views during config reads
cindersocket Jun 18, 2026
e8481de
style: apply ufbt formatting
cindersocket Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,40 @@ test-host:
cc $(HOST_TEST_CFLAGS) \
lib/host_tests/vendor/munit/munit.c \
lib/host_tests/test_main.c \
lib/host_tests/test_board_identity.c \
lib/host_tests/test_lrc.c \
lib/host_tests/test_board_power_lifecycle.c \
lib/host_tests/test_hf_read_lifecycle.c \
lib/host_tests/test_hf_buffer_pool.c \
lib/host_tests/test_sam_startup_ui.c \
lib/host_tests/test_sam_key_label.c \
lib/host_tests/test_ccid_logic.c \
lib/host_tests/test_uart_tx_logic.c \
lib/host_tests/test_uart_rx_logic.c \
lib/host_tests/test_t1_existing.c \
lib/host_tests/test_t1_protocol.c \
lib/host_tests/test_snmp.c \
lib/host_tests/test_uhf_status_label.c \
lib/host_tests/test_credential_sio_label.c \
lib/host_tests/test_hf_read_plan.c \
lib/host_tests/test_hf_bridge_policy.c \
lib/host_tests/test_hf_14a_session.c \
lib/host_tests/test_hf_sam_response_view.c \
lib/host_tests/test_wiegand_plugin.c \
lib/host_tests/test_runtime_policy.c \
lib/host_tests/test_ui_memory_policy.c \
lib/host_tests/t1_test_stubs.c \
lib/host_tests/bit_buffer_mock.c \
lrc.c \
board_identity.c \
board_power_lifecycle.c \
sam_startup_ui.c \
ccid_logic.c \
hf_buffer_pool.c \
uart_tx_logic.c \
uart_rx_logic.c \
allocation_policy.c \
worker_loop_policy.c \
credential_sio_label.c \
t_1_logic.c \
t_1.c \
Expand All @@ -48,9 +62,13 @@ test-host:
uhf_tag_config_view.c \
uhf_snmp_probe.c \
hf_read_lifecycle.c \
hf_bridge_policy.c \
hf_14a_session.c \
hf_sam_response_view.c \
seader_hf_read_plan.c \
wiegand_interface_fal/wiegand.c \
runtime_policy.c \
ui_memory_policy.c \
-o build/host_tests/seader_tests
./build/host_tests/seader_tests

Expand Down
16 changes: 16 additions & 0 deletions allocation_policy.c
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;
}
6 changes: 6 additions & 0 deletions allocation_policy.h
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);
6 changes: 4 additions & 2 deletions application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ App(
"ASN_DISABLE_OER_SUPPORT",
"ASN_DISABLE_XER_SUPPORT",
"ASN_DISABLE_RANDOM_FILL",
"ASN_DISABLE_PRINT_SUPPORT",
],
requires=[
"gui", "storage", "nfc",
Expand Down Expand Up @@ -45,12 +46,13 @@ App(
"-DASN_DISABLE_OER_SUPPORT",
"-DASN_DISABLE_XER_SUPPORT",
"-DASN_DISABLE_RANDOM_FILL",
"-DASN_DISABLE_PRINT_SUPPORT",
"-Os",
],
),
Lib(
name="loclass",

Copy link
Copy Markdown
Owner

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.

cflags=["-O3"],
cflags=["-Os"],
),
],
fap_weburl="https://seader.ericbetts.dev",
Expand All @@ -71,6 +73,6 @@ App(
apptype=FlipperAppType.PLUGIN,
entry_point="plugin_hf_ep",
requires=["seader"],
sources=["hf_interface_fal/hf.c"],
sources=["hf_interface_fal/hf.c", "hf_bridge_policy.c", "hf_buffer_pool.c", "hf_14a_session.c"],
fal_embedded=True,
)
17 changes: 17 additions & 0 deletions board_identity.c
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;
}
13 changes: 13 additions & 0 deletions board_identity.h
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);
Loading
Loading