mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 15:48:35 -07:00
Refactor payload config, dont need 2 structs
This commit is contained in:
@@ -71,8 +71,8 @@ static const char* type_names[ContinuityTypeCOUNT] = {
|
||||
[ContinuityTypeNearbyInfo] = "Nearby Info",
|
||||
[ContinuityTypeCustomCrash] = "Continuity Custom",
|
||||
};
|
||||
static const char* get_name(const ProtocolCfg* _cfg) {
|
||||
const ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
static const char* get_name(const Payload* payload) {
|
||||
const ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
return type_names[cfg->type];
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ static uint8_t packet_sizes[ContinuityTypeCOUNT] = {
|
||||
[ContinuityTypeNearbyInfo] = HEADER_LEN + 5,
|
||||
[ContinuityTypeCustomCrash] = HEADER_LEN + 11,
|
||||
};
|
||||
static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
|
||||
ContinuityCfg* cfg = _cfg ? &_cfg->specific.continuity : NULL;
|
||||
static void make_packet(uint8_t* _size, uint8_t** _packet, Payload* payload) {
|
||||
ContinuityCfg* cfg = payload ? &payload->cfg.continuity : NULL;
|
||||
|
||||
ContinuityType type;
|
||||
if(cfg && cfg->type != 0x00) {
|
||||
@@ -139,16 +139,16 @@ static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
|
||||
|
||||
case ContinuityTypeProximityPair: {
|
||||
uint16_t model;
|
||||
switch(cfg ? _cfg->mode : ProtocolModeRandom) {
|
||||
case ProtocolModeRandom:
|
||||
switch(payload ? payload->mode : PayloadModeRandom) {
|
||||
case PayloadModeRandom:
|
||||
default:
|
||||
model = pp_models[rand() % pp_models_count].value;
|
||||
break;
|
||||
case ProtocolModeValue:
|
||||
case PayloadModeValue:
|
||||
model = cfg->data.proximity_pair.model;
|
||||
break;
|
||||
case ProtocolModeBruteforce:
|
||||
model = cfg->data.proximity_pair.model = _cfg->bruteforce.value;
|
||||
case PayloadModeBruteforce:
|
||||
model = cfg->data.proximity_pair.model = payload->bruteforce.value;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -216,16 +216,16 @@ static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
|
||||
|
||||
case ContinuityTypeNearbyAction: {
|
||||
uint8_t action;
|
||||
switch(cfg ? _cfg->mode : ProtocolModeRandom) {
|
||||
case ProtocolModeRandom:
|
||||
switch(payload ? payload->mode : PayloadModeRandom) {
|
||||
case PayloadModeRandom:
|
||||
default:
|
||||
action = na_actions[rand() % na_actions_count].value;
|
||||
break;
|
||||
case ProtocolModeValue:
|
||||
case PayloadModeValue:
|
||||
action = cfg->data.nearby_action.action;
|
||||
break;
|
||||
case ProtocolModeBruteforce:
|
||||
action = cfg->data.nearby_action.action = _cfg->bruteforce.value;
|
||||
case PayloadModeBruteforce:
|
||||
action = cfg->data.nearby_action.action = payload->bruteforce.value;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -307,8 +307,8 @@ enum {
|
||||
};
|
||||
static void config_callback(void* _ctx, uint32_t index) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, index);
|
||||
switch(cfg->type) {
|
||||
case ContinuityTypeProximityPair: {
|
||||
@@ -356,22 +356,22 @@ static void config_callback(void* _ctx, uint32_t index) {
|
||||
}
|
||||
}
|
||||
static void pp_model_changed(VariableItem* item) {
|
||||
ProtocolCfg* _cfg = variable_item_get_context(item);
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = variable_item_get_context(item);
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
if(index) {
|
||||
index--;
|
||||
_cfg->mode = ProtocolModeValue;
|
||||
payload->mode = PayloadModeValue;
|
||||
cfg->data.proximity_pair.model = pp_models[index].value;
|
||||
variable_item_set_current_value_text(item, pp_models[index].name);
|
||||
} else {
|
||||
_cfg->mode = ProtocolModeRandom;
|
||||
payload->mode = PayloadModeRandom;
|
||||
variable_item_set_current_value_text(item, "Random");
|
||||
}
|
||||
}
|
||||
static void pp_prefix_changed(VariableItem* item) {
|
||||
ProtocolCfg* _cfg = variable_item_get_context(item);
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = variable_item_get_context(item);
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
if(index) {
|
||||
index--;
|
||||
@@ -383,22 +383,22 @@ static void pp_prefix_changed(VariableItem* item) {
|
||||
}
|
||||
}
|
||||
static void na_action_changed(VariableItem* item) {
|
||||
ProtocolCfg* _cfg = variable_item_get_context(item);
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = variable_item_get_context(item);
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
if(index) {
|
||||
index--;
|
||||
_cfg->mode = ProtocolModeValue;
|
||||
payload->mode = PayloadModeValue;
|
||||
cfg->data.nearby_action.action = na_actions[index].value;
|
||||
variable_item_set_current_value_text(item, na_actions[index].name);
|
||||
} else {
|
||||
_cfg->mode = ProtocolModeRandom;
|
||||
payload->mode = PayloadModeRandom;
|
||||
variable_item_set_current_value_text(item, "Random");
|
||||
}
|
||||
}
|
||||
static void extra_config(Ctx* ctx) {
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
VariableItemList* list = ctx->variable_item_list;
|
||||
VariableItem* item;
|
||||
size_t value_index;
|
||||
@@ -406,16 +406,16 @@ static void extra_config(Ctx* ctx) {
|
||||
switch(cfg->type) {
|
||||
case ContinuityTypeProximityPair: {
|
||||
item = variable_item_list_add(
|
||||
list, "Model Code", pp_models_count + 1, pp_model_changed, _cfg);
|
||||
list, "Model Code", pp_models_count + 1, pp_model_changed, payload);
|
||||
const char* model_name = NULL;
|
||||
char model_name_buf[5];
|
||||
switch(_cfg->mode) {
|
||||
case ProtocolModeRandom:
|
||||
switch(payload->mode) {
|
||||
case PayloadModeRandom:
|
||||
default:
|
||||
model_name = "Random";
|
||||
value_index = 0;
|
||||
break;
|
||||
case ProtocolModeValue:
|
||||
case PayloadModeValue:
|
||||
for(uint8_t i = 0; i < pp_models_count; i++) {
|
||||
if(cfg->data.proximity_pair.model == pp_models[i].value) {
|
||||
model_name = pp_models[i].name;
|
||||
@@ -430,7 +430,7 @@ static void extra_config(Ctx* ctx) {
|
||||
value_index = pp_models_count + 1;
|
||||
}
|
||||
break;
|
||||
case ProtocolModeBruteforce:
|
||||
case PayloadModeBruteforce:
|
||||
model_name = "Bruteforce";
|
||||
value_index = pp_models_count + 1;
|
||||
break;
|
||||
@@ -438,8 +438,8 @@ static void extra_config(Ctx* ctx) {
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, model_name);
|
||||
|
||||
item =
|
||||
variable_item_list_add(list, "Prefix", pp_prefixes_count + 1, pp_prefix_changed, _cfg);
|
||||
item = variable_item_list_add(
|
||||
list, "Prefix", pp_prefixes_count + 1, pp_prefix_changed, payload);
|
||||
const char* prefix_name = NULL;
|
||||
char prefix_name_buf[3];
|
||||
if(cfg->data.proximity_pair.prefix == 0x00) {
|
||||
@@ -469,16 +469,16 @@ static void extra_config(Ctx* ctx) {
|
||||
}
|
||||
case ContinuityTypeNearbyAction: {
|
||||
item = variable_item_list_add(
|
||||
list, "Action Type", na_actions_count + 1, na_action_changed, _cfg);
|
||||
list, "Action Type", na_actions_count + 1, na_action_changed, payload);
|
||||
const char* action_name = NULL;
|
||||
char action_name_buf[3];
|
||||
switch(_cfg->mode) {
|
||||
case ProtocolModeRandom:
|
||||
switch(payload->mode) {
|
||||
case PayloadModeRandom:
|
||||
default:
|
||||
action_name = "Random";
|
||||
value_index = 0;
|
||||
break;
|
||||
case ProtocolModeValue:
|
||||
case PayloadModeValue:
|
||||
for(uint8_t i = 0; i < na_actions_count; i++) {
|
||||
if(cfg->data.nearby_action.action == na_actions[i].value) {
|
||||
action_name = na_actions[i].name;
|
||||
@@ -496,7 +496,7 @@ static void extra_config(Ctx* ctx) {
|
||||
value_index = na_actions_count + 1;
|
||||
}
|
||||
break;
|
||||
case ProtocolModeBruteforce:
|
||||
case PayloadModeBruteforce:
|
||||
action_name = "Bruteforce";
|
||||
value_index = na_actions_count + 1;
|
||||
break;
|
||||
@@ -539,8 +539,8 @@ static uint8_t config_counts[ContinuityTypeCOUNT] = {
|
||||
[ContinuityTypeNearbyInfo] = 0,
|
||||
[ContinuityTypeCustomCrash] = ConfigCcCOUNT - ConfigExtraStart - 1,
|
||||
};
|
||||
static uint8_t config_count(const ProtocolCfg* _cfg) {
|
||||
const ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
static uint8_t config_count(const Payload* payload) {
|
||||
const ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
return config_counts[cfg->type];
|
||||
}
|
||||
|
||||
@@ -554,25 +554,25 @@ const Protocol protocol_continuity = {
|
||||
|
||||
static void pp_model_callback(void* _ctx, uint32_t index) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
switch(index) {
|
||||
case 0:
|
||||
_cfg->mode = ProtocolModeRandom;
|
||||
payload->mode = PayloadModeRandom;
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
break;
|
||||
case pp_models_count + 1:
|
||||
scene_manager_next_scene(ctx->scene_manager, SceneContinuityPpModelCustom);
|
||||
break;
|
||||
case pp_models_count + 2:
|
||||
_cfg->mode = ProtocolModeBruteforce;
|
||||
_cfg->bruteforce.counter = 0;
|
||||
_cfg->bruteforce.value = cfg->data.proximity_pair.model;
|
||||
_cfg->bruteforce.size = 2;
|
||||
payload->mode = PayloadModeBruteforce;
|
||||
payload->bruteforce.counter = 0;
|
||||
payload->bruteforce.value = cfg->data.proximity_pair.model;
|
||||
payload->bruteforce.size = 2;
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
break;
|
||||
default:
|
||||
_cfg->mode = ProtocolModeValue;
|
||||
payload->mode = PayloadModeValue;
|
||||
cfg->data.proximity_pair.model = pp_models[index - 1].value;
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
break;
|
||||
@@ -580,33 +580,33 @@ static void pp_model_callback(void* _ctx, uint32_t index) {
|
||||
}
|
||||
void scene_continuity_pp_model_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
Submenu* submenu = ctx->submenu;
|
||||
uint32_t selected = 0;
|
||||
submenu_reset(submenu);
|
||||
|
||||
submenu_add_item(submenu, "Random", 0, pp_model_callback, ctx);
|
||||
if(_cfg->mode == ProtocolModeRandom) {
|
||||
if(payload->mode == PayloadModeRandom) {
|
||||
selected = 0;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
for(uint8_t i = 0; i < pp_models_count; i++) {
|
||||
submenu_add_item(submenu, pp_models[i].name, i + 1, pp_model_callback, ctx);
|
||||
if(!found && _cfg->mode == ProtocolModeValue &&
|
||||
if(!found && payload->mode == PayloadModeValue &&
|
||||
cfg->data.proximity_pair.model == pp_models[i].value) {
|
||||
found = true;
|
||||
selected = i + 1;
|
||||
}
|
||||
}
|
||||
submenu_add_item(submenu, "Custom", pp_models_count + 1, pp_model_callback, ctx);
|
||||
if(!found && _cfg->mode == ProtocolModeValue) {
|
||||
if(!found && payload->mode == PayloadModeValue) {
|
||||
selected = pp_models_count + 1;
|
||||
}
|
||||
|
||||
submenu_add_item(submenu, "Bruteforce", pp_models_count + 2, pp_model_callback, ctx);
|
||||
if(_cfg->mode == ProtocolModeBruteforce) {
|
||||
if(payload->mode == PayloadModeBruteforce) {
|
||||
selected = pp_models_count + 2;
|
||||
}
|
||||
|
||||
@@ -625,17 +625,17 @@ void scene_continuity_pp_model_on_exit(void* _ctx) {
|
||||
|
||||
static void pp_model_custom_callback(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
_cfg->mode = ProtocolModeValue;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
payload->mode = PayloadModeValue;
|
||||
cfg->data.proximity_pair.model = (ctx->byte_store[0] << 0x08) + (ctx->byte_store[1] << 0x00);
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
}
|
||||
void scene_continuity_pp_model_custom_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
ByteInput* byte_input = ctx->byte_input;
|
||||
|
||||
byte_input_set_header_text(byte_input, "Enter custom Model Code");
|
||||
@@ -659,8 +659,8 @@ void scene_continuity_pp_model_custom_on_exit(void* _ctx) {
|
||||
|
||||
static void pp_prefix_callback(void* _ctx, uint32_t index) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
switch(index) {
|
||||
case 0:
|
||||
cfg->data.proximity_pair.prefix = 0x00;
|
||||
@@ -677,8 +677,8 @@ static void pp_prefix_callback(void* _ctx, uint32_t index) {
|
||||
}
|
||||
void scene_continuity_pp_prefix_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
Submenu* submenu = ctx->submenu;
|
||||
uint32_t selected = 0;
|
||||
bool found = false;
|
||||
@@ -717,16 +717,16 @@ void scene_continuity_pp_prefix_on_exit(void* _ctx) {
|
||||
|
||||
static void pp_prefix_custom_callback(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
cfg->data.proximity_pair.prefix = (ctx->byte_store[0] << 0x00);
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
}
|
||||
void scene_continuity_pp_prefix_custom_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
ByteInput* byte_input = ctx->byte_input;
|
||||
|
||||
byte_input_set_header_text(byte_input, "Enter custom Prefix");
|
||||
@@ -749,25 +749,25 @@ void scene_continuity_pp_prefix_custom_on_exit(void* _ctx) {
|
||||
|
||||
static void na_action_callback(void* _ctx, uint32_t index) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
switch(index) {
|
||||
case 0:
|
||||
_cfg->mode = ProtocolModeRandom;
|
||||
payload->mode = PayloadModeRandom;
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
break;
|
||||
case na_actions_count + 1:
|
||||
scene_manager_next_scene(ctx->scene_manager, SceneContinuityNaActionCustom);
|
||||
break;
|
||||
case na_actions_count + 2:
|
||||
_cfg->mode = ProtocolModeBruteforce;
|
||||
_cfg->bruteforce.counter = 0;
|
||||
_cfg->bruteforce.value = cfg->data.nearby_action.action;
|
||||
_cfg->bruteforce.size = 1;
|
||||
payload->mode = PayloadModeBruteforce;
|
||||
payload->bruteforce.counter = 0;
|
||||
payload->bruteforce.value = cfg->data.nearby_action.action;
|
||||
payload->bruteforce.size = 1;
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
break;
|
||||
default:
|
||||
_cfg->mode = ProtocolModeValue;
|
||||
payload->mode = PayloadModeValue;
|
||||
cfg->data.nearby_action.action = na_actions[index - 1].value;
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
break;
|
||||
@@ -775,33 +775,33 @@ static void na_action_callback(void* _ctx, uint32_t index) {
|
||||
}
|
||||
void scene_continuity_na_action_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
Submenu* submenu = ctx->submenu;
|
||||
uint32_t selected = 0;
|
||||
submenu_reset(submenu);
|
||||
|
||||
submenu_add_item(submenu, "Random", 0, na_action_callback, ctx);
|
||||
if(_cfg->mode == ProtocolModeRandom) {
|
||||
if(payload->mode == PayloadModeRandom) {
|
||||
selected = 0;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
for(uint8_t i = 0; i < na_actions_count; i++) {
|
||||
submenu_add_item(submenu, na_actions[i].name, i + 1, na_action_callback, ctx);
|
||||
if(!found && _cfg->mode == ProtocolModeValue &&
|
||||
if(!found && payload->mode == PayloadModeValue &&
|
||||
cfg->data.nearby_action.action == na_actions[i].value) {
|
||||
found = true;
|
||||
selected = i + 1;
|
||||
}
|
||||
}
|
||||
submenu_add_item(submenu, "Custom", na_actions_count + 1, na_action_callback, ctx);
|
||||
if(!found && _cfg->mode == ProtocolModeValue) {
|
||||
if(!found && payload->mode == PayloadModeValue) {
|
||||
selected = na_actions_count + 1;
|
||||
}
|
||||
|
||||
submenu_add_item(submenu, "Bruteforce", na_actions_count + 2, na_action_callback, ctx);
|
||||
if(_cfg->mode == ProtocolModeBruteforce) {
|
||||
if(payload->mode == PayloadModeBruteforce) {
|
||||
selected = na_actions_count + 2;
|
||||
}
|
||||
|
||||
@@ -820,17 +820,17 @@ void scene_continuity_na_action_on_exit(void* _ctx) {
|
||||
|
||||
static void na_action_custom_callback(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
_cfg->mode = ProtocolModeValue;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
payload->mode = PayloadModeValue;
|
||||
cfg->data.nearby_action.action = (ctx->byte_store[0] << 0x00);
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
scene_manager_previous_scene(ctx->scene_manager);
|
||||
}
|
||||
void scene_continuity_na_action_custom_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
ByteInput* byte_input = ctx->byte_input;
|
||||
|
||||
byte_input_set_header_text(byte_input, "Enter custom Action Type");
|
||||
@@ -857,8 +857,8 @@ static void na_flags_callback(void* _ctx) {
|
||||
}
|
||||
void scene_continuity_na_flags_on_enter(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
ByteInput* byte_input = ctx->byte_input;
|
||||
|
||||
byte_input_set_header_text(byte_input, "Press back for automatic");
|
||||
@@ -879,7 +879,7 @@ bool scene_continuity_na_flags_on_event(void* _ctx, SceneManagerEvent event) {
|
||||
}
|
||||
void scene_continuity_na_flags_on_exit(void* _ctx) {
|
||||
Ctx* ctx = _ctx;
|
||||
ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
|
||||
ContinuityCfg* cfg = &_cfg->specific.continuity;
|
||||
Payload* payload = &ctx->attack->payload;
|
||||
ContinuityCfg* cfg = &payload->cfg.continuity;
|
||||
cfg->data.nearby_action.flags = (ctx->byte_store[0] << 0x00);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user