mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-22 05:14:46 -07:00
Fuzzer App: worker
This commit is contained in:
21
applications/external/pacs_fuzzer/views/attack.c
vendored
21
applications/external/pacs_fuzzer/views/attack.c
vendored
@@ -42,7 +42,7 @@ void fuzzer_view_attack_reset_data(
|
||||
true);
|
||||
}
|
||||
|
||||
void fuzzer_view_attack_set_uid(FuzzerViewAttack* view, const uint8_t* uid, bool attack) {
|
||||
void fuzzer_view_attack_set_uid(FuzzerViewAttack* view, const uint8_t* uid) {
|
||||
furi_assert(view);
|
||||
|
||||
with_view_model(
|
||||
@@ -61,11 +61,17 @@ void fuzzer_view_attack_set_uid(FuzzerViewAttack* view, const uint8_t* uid, bool
|
||||
uid[5],
|
||||
uid[6],
|
||||
uid[7]);
|
||||
model->attack_enabled = attack;
|
||||
},
|
||||
true);
|
||||
}
|
||||
|
||||
void fuzzer_view_attack_set_attack(FuzzerViewAttack* view, bool attack) {
|
||||
furi_assert(view);
|
||||
|
||||
with_view_model(
|
||||
view->view, FuzzerViewAttackModel * model, { model->attack_enabled = attack; }, true);
|
||||
}
|
||||
|
||||
void fuzzer_view_attack_set_callback(
|
||||
FuzzerViewAttack* view_attack,
|
||||
FuzzerViewAttackCallback callback,
|
||||
@@ -96,6 +102,7 @@ void fuzzer_view_attack_draw(Canvas* canvas, FuzzerViewAttackModel* model) {
|
||||
}
|
||||
canvas_draw_str_aligned(canvas, 64, 38, AlignCenter, AlignTop, model->uid);
|
||||
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
if(model->attack_enabled) {
|
||||
elements_button_center(canvas, "Stop");
|
||||
} else {
|
||||
@@ -209,4 +216,14 @@ void fuzzer_view_attack_free(FuzzerViewAttack* view_attack) {
|
||||
View* fuzzer_view_attack_get_view(FuzzerViewAttack* view_attack) {
|
||||
furi_assert(view_attack);
|
||||
return view_attack->view;
|
||||
}
|
||||
|
||||
uint8_t fuzzer_view_attack_get_time_delay(FuzzerViewAttack* view) {
|
||||
furi_assert(view);
|
||||
uint8_t time_delay;
|
||||
|
||||
with_view_model(
|
||||
view->view, FuzzerViewAttackModel * model, { time_delay = model->time_delay; }, false);
|
||||
|
||||
return time_delay;
|
||||
}
|
||||
@@ -24,4 +24,8 @@ void fuzzer_view_attack_reset_data(
|
||||
const char* protocol_name,
|
||||
uint8_t uid_size);
|
||||
|
||||
void fuzzer_view_attack_set_uid(FuzzerViewAttack* view, const uint8_t* uid, bool attack);
|
||||
void fuzzer_view_attack_set_uid(FuzzerViewAttack* view, const uint8_t* uid);
|
||||
|
||||
void fuzzer_view_attack_set_attack(FuzzerViewAttack* view, bool attack);
|
||||
|
||||
uint8_t fuzzer_view_attack_get_time_delay(FuzzerViewAttack* view);
|
||||
Reference in New Issue
Block a user