Explorar el Código

Update name_generator_make_auto invocation based on attack type

Added a conditional statement that checks the type of SubBrute attack. If the attack type is SubBruteAttackLoadFile, the name_generator_make_auto function is invoked with a different argument, else the existing argument is used. This modification ensures proper name generation depending on the attack type.
DerSkythe hace 2 años
padre
commit
1b41e8968b
Se han modificado 1 ficheros con 11 adiciones y 5 borrados
  1. 11 5
      scenes/subbrute_scene_save_name.c

+ 11 - 5
scenes/subbrute_scene_save_name.c

@@ -9,11 +9,17 @@ void subbrute_scene_save_name_on_enter(void* context) {
 
     // Setup view
     TextInput* text_input = instance->text_input;
-    name_generator_make_auto(
-        instance->text_store,
-        sizeof(instance->text_store),
-        subbrute_protocol_file(instance->device->protocol_info->file));
-
+    if(instance->device->attack == SubBruteAttackLoadFile) {
+        name_generator_make_auto(
+            instance->text_store,
+            sizeof(instance->text_store),
+            subbrute_protocol_file(instance->device->file_protocol_info->file));
+    } else {
+        name_generator_make_auto(
+            instance->text_store,
+            sizeof(instance->text_store),
+            subbrute_protocol_file(instance->device->protocol_info->file));
+    }
     text_input_set_header_text(text_input, "Name of file");
     text_input_set_result_callback(
         text_input,