From 08084d5763d7a5d23e6260110fe25d43a6c4be4a Mon Sep 17 00:00:00 2001 From: derskythe Date: Mon, 26 Sep 2022 02:03:36 +0400 Subject: [PATCH] fix first send signal equals last transferred or 0x00 --- .../plugins/subbrute/scenes/subbrute_scene_setup_attack.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c b/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c index 1eaa48ba5..22d0a3a5f 100644 --- a/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c +++ b/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c @@ -55,6 +55,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubBruteCustomEventTypeTransmitStarted) { + subbrute_device_create_packet_parsed(instance->device, instance->device->key_index); scene_manager_next_scene(instance->scene_manager, SubBruteSceneRunAttack); } else if(event.event == SubBruteCustomEventTypeSaveFile) { subbrute_worker_manual_transmit_stop(instance->worker); @@ -81,7 +82,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event scene_manager_next_scene(instance->scene_manager, SubBruteSceneStart); } else if(event.event == SubBruteCustomEventTypeChangeStepUp) { // +1 - if ((instance->device->key_index + 1) - instance->device->max_value == 1) { + if((instance->device->key_index + 1) - instance->device->max_value == 1) { instance->device->key_index = 0x00; } else { uint64_t value = instance->device->key_index + 1; @@ -103,9 +104,9 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event subbrute_attack_view_set_current_step(view, instance->device->key_index); } else if(event.event == SubBruteCustomEventTypeChangeStepDown) { // -1 - if (instance->device->key_index - 1 == 0) { + if(instance->device->key_index - 1 == 0) { instance->device->key_index = 0x00; - } else if (instance->device->key_index == 0) { + } else if(instance->device->key_index == 0) { instance->device->key_index = instance->device->max_value; } else { uint64_t value = ((instance->device->key_index - 1) + instance->device->max_value);