This commit is contained in:
Willy-JL
2024-02-14 19:22:31 +00:00
28 changed files with 87 additions and 215 deletions

View File

@@ -1,4 +1,5 @@
#include "../lfrfid_i.h"
#include <bit_lib.h>
#include "tools/t5577.h"
#define TAG "Clear T5577"
@@ -21,8 +22,7 @@ static void lfrfid_clear_t5577_password_and_config_to_EM(LfRfid* app) {
};
// Clear custom password
uint32_t custom_pass = (app->password[0] << 24) | (app->password[1] << 16) |
(app->password[2] << 8) | (app->password[3]);
uint32_t custom_pass = bit_lib_bytes_to_num_be(app->password, 4);
snprintf(curr_buf, sizeof(curr_buf), "Custom password");
view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup);

View File

@@ -1,4 +1,5 @@
#include "../lfrfid_i.h"
#include "bit_lib.h"
#include "gui/scene_manager.h"
int next_scene;
@@ -16,7 +17,7 @@ void lfrfid_scene_enter_password_on_enter(void* context) {
const uint32_t* password_list = lfrfid_get_t5577_default_passwords(&password_list_size);
uint32_t pass = password_list[furi_get_tick() % password_list_size];
for(uint8_t i = 0; i < 4; i++) app->password[4 - (i + 1)] = (pass >> (8 * i)) & 0xFF;
bit_lib_num_to_bytes_be(pass, 4, app->password);
}
byte_input_set_header_text(byte_input, "Enter the password in hex");