Skip to content

Commit

Permalink
Mise à jours, correction encodage de caractères, mise en page,...
Browse files Browse the repository at this point in the history
  • Loading branch information
KaliStudio committed Feb 25, 2024
1 parent 16f4501 commit 24f353e
Show file tree
Hide file tree
Showing 117 changed files with 925 additions and 801 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 5 additions & 8 deletions applications/debug/accessor/helpers/wiegand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#include <furi.h>
#include <furi_hal.h>

volatile unsigned long WIEGAND::_cardTempHigh = 0;
volatile unsigned long WIEGAND::_cardTemp = 0;
volatile unsigned long WIEGAND::_lastWiegand = 0;
unsigned long WIEGAND::_cardTempHigh = 0;
unsigned long WIEGAND::_cardTemp = 0;
unsigned long WIEGAND::_lastWiegand = 0;
unsigned long WIEGAND::_code = 0;
unsigned long WIEGAND::_codeHigh = 0;
volatile int WIEGAND::_bitCount = 0;
int WIEGAND::_bitCount = 0;
int WIEGAND::_wiegandType = 0;

constexpr uint32_t clocks_in_ms = 64 * 1000;
Expand Down Expand Up @@ -98,10 +98,7 @@ void WIEGAND::ReadD1() {
_lastWiegand = DWT->CYCCNT; // Keep track of last wiegand bit received
}

unsigned long WIEGAND::GetCardId(
volatile unsigned long* codehigh,
volatile unsigned long* codelow,
char bitlength) {
unsigned long WIEGAND::GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength) {
if(bitlength == 26) // EM tag
return (*codelow & 0x1FFFFFE) >> 1;

Expand Down
14 changes: 6 additions & 8 deletions applications/debug/accessor/helpers/wiegand.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ class WIEGAND {

private:
static bool DoWiegandConversion();
static unsigned long GetCardId(
volatile unsigned long* codehigh,
volatile unsigned long* codelow,
char bitlength);
static unsigned long
GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength);

static volatile unsigned long _cardTempHigh;
static volatile unsigned long _cardTemp;
static volatile unsigned long _lastWiegand;
static volatile int _bitCount;
static unsigned long _cardTempHigh;
static unsigned long _cardTemp;
static unsigned long _lastWiegand;
static int _bitCount;
static int _wiegandType;
static unsigned long _code;
static unsigned long _codeHigh;
Expand Down
3 changes: 2 additions & 1 deletion applications/debug/battery_test_app/battery_test_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ void battery_test_dialog_callback(DialogExResult result, void* context) {
}
}

uint32_t battery_test_exit_confirm_view() {
uint32_t battery_test_exit_confirm_view(void* context) {
UNUSED(context);
return BatteryTestAppViewExitDialog;
}

Expand Down
4 changes: 2 additions & 2 deletions applications/debug/unit_tests/furi/furi_string_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ MU_TEST(mu_test_furi_string_trim) {
}

MU_TEST(mu_test_furi_string_utf8) {
FuriString* utf8_string = furi_string_alloc_set("イルカ");
FuriString* utf8_string = furi_string_alloc_set("イルカ");

// test furi_string_utf8_length
mu_assert_int_eq(9, furi_string_size(utf8_string));
Expand All @@ -440,7 +440,7 @@ MU_TEST(mu_test_furi_string_utf8) {
// test furi_string_utf8_push
furi_string_set(utf8_string, "");
furi_string_utf8_push(utf8_string, value);
mu_assert_string_eq("🐬", furi_string_get_cstr(utf8_string));
mu_assert_string_eq("🐬", furi_string_get_cstr(utf8_string));

furi_string_free(utf8_string);
}
Expand Down
6 changes: 4 additions & 2 deletions applications/drivers/subghz/cc1101_ext/cc1101_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ static bool subghz_device_cc1101_ext_stop_debug() {
return ret;
}

static void subghz_device_cc1101_ext_capture_ISR() {
static void subghz_device_cc1101_ext_capture_ISR(void* context) {
UNUSED(context);
if(!furi_hal_gpio_read(subghz_device_cc1101_ext->g0_pin)) {
if(subghz_device_cc1101_ext->async_rx.capture_callback) {
if(subghz_device_cc1101_ext->async_mirror_pin != NULL)
Expand Down Expand Up @@ -747,7 +748,8 @@ static void subghz_device_cc1101_ext_async_tx_refill(uint32_t* buffer, size_t sa
}
}

static void subghz_device_cc1101_ext_async_tx_dma_isr() {
static void subghz_device_cc1101_ext_async_tx_dma_isr(void* context) {
UNUSED(context);
furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx);

#if SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_CHANNEL == LL_DMA_CHANNEL_3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
static bool subghz_device_cc1101_ext_interconnect_is_frequency_valid(uint32_t frequency) {
bool ret = subghz_device_cc1101_ext_is_frequency_valid(frequency);
if(!ret) {
furi_crash("SubGhz: fréquence incorrecte.");
furi_crash("SubGhz: fréquence incorrecte.");
}
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ constexpr HashtableApiInterface applicaton_hashtable_api_interface{
.resolver_callback = &elf_resolve_from_hashtable,
},
/* pointers to application's API table boundaries */
.table_cbegin = app_api_table.cbegin(),
.table_cend = app_api_table.cend(),
app_api_table.cbegin(),
app_api_table.cend(),
};

/* Casting to generic resolver to use in Composite API resolver */
Expand Down
2 changes: 1 addition & 1 deletion applications/external/.utils/update-subtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ while read -u $remote repo branch subdir; do
fi
exec {capture}>&1
if [ "${subdir}" = "/" ]; then
result="$(git subtree pull -P "${path}" "${repo}" "${branch}" -m "Merge ${path} from ${repo}" 2>&1 | tee /proc/self/fd/$capture)"
result="$(git subtree pull -P "${path}" "${repo}" "${branch}" -m "Merge ${path} from ${repo}" 2>&1 | tee /proc/self/fd/$capture)"
else
result="$(bash .utils/subtree-subdir-helper.sh "${path}" "${repo}" "${branch}" "${subdir}" merge 2>&1 | tee /proc/self/fd/$capture)"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ int32_t flipper_atomicdiceroller_app() {
view_port_input_callback_set(view_port, input_callback, event_queue);

furi_hal_gpio_add_int_callback(&gpio_ext_pa7, gpiocallback, event_queue);
furi_hal_gpio_enable_int_callback(&gpio_ext_pa7);

Gui* gui = furi_record_open(RECORD_GUI);
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
Expand Down
2 changes: 1 addition & 1 deletion applications/external/ble_spam/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ App(
fap_category="Bluetooth",
fap_author="@Willy-JL @ECTO-1A @Spooks4576",
fap_weburl="https://github.com/Flipper-XFW/Xtreme-Apps/tree/dev/ble_spam",
fap_version="5.0",
fap_version="5.1",
fap_description="Flood BLE advertisements to cause spammy and annoying popups/notifications",
fap_icon_assets="icons",
fap_icon_assets_symbol="ble_spam",
Expand Down
96 changes: 54 additions & 42 deletions applications/external/ble_spam/ble_spam.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ typedef struct {
uint8_t lock_count;
FuriTimer* lock_timer;

// bool resume;
bool advertising;
uint8_t delay;
GapExtraBeaconConfig config;
Expand Down Expand Up @@ -160,38 +159,52 @@ static void stop_blink(State* state) {
notification_message_block(state->ctx.notification, &sequence_blink_stop);
}

static int32_t adv_thread(void* _ctx) {
State* state = _ctx;
static void randomize_mac(State* state) {
furi_hal_random_fill_buf(state->config.address, sizeof(state->config.address));
}

static void start_extra_beacon(State* state) {
uint8_t size;
uint16_t delay;
uint8_t* packet;
uint16_t delay = delays[state->delay];
GapExtraBeaconConfig* config = &state->config;
Payload* payload = &attacks[state->index].payload;
const Protocol* protocol = attacks[state->index].protocol;
if(!payload->random_mac) furi_hal_random_fill_buf(config->address, sizeof(config->address));

config->min_adv_interval_ms = delay;
config->max_adv_interval_ms = delay * 1.5;
if(payload->random_mac) randomize_mac(state);
furi_check(furi_hal_bt_extra_beacon_set_config(config));

if(protocol) {
protocol->make_packet(&size, &packet, payload);
} else {
protocols[rand() % protocols_count]->make_packet(&size, &packet, NULL);
}
furi_check(furi_hal_bt_extra_beacon_set_data(packet, size));
free(packet);

furi_check(furi_hal_bt_extra_beacon_start());
}

static int32_t adv_thread(void* _ctx) {
State* state = _ctx;
Payload* payload = &attacks[state->index].payload;
const Protocol* protocol = attacks[state->index].protocol;
if(!payload->random_mac) randomize_mac(state);
if(state->ctx.led_indicator) start_blink(state);

while(state->advertising) {
if(protocol) {
if(payload->mode == PayloadModeBruteforce && payload->bruteforce.counter++ >= 10) {
payload->bruteforce.counter = 0;
payload->bruteforce.value =
(payload->bruteforce.value + 1) % (1 << (payload->bruteforce.size * 8));
}
protocol->make_packet(&size, &packet, payload);
} else {
protocols[rand() % protocols_count]->make_packet(&size, &packet, NULL);
if(protocol && payload->mode == PayloadModeBruteforce &&
payload->bruteforce.counter++ >= 10) {
payload->bruteforce.counter = 0;
payload->bruteforce.value =
(payload->bruteforce.value + 1) % (1 << (payload->bruteforce.size * 8));
}

delay = delays[state->delay];
config->min_adv_interval_ms = config->max_adv_interval_ms = delay;
if(payload->random_mac) furi_hal_random_fill_buf(config->address, sizeof(config->address));
furi_check(furi_hal_bt_extra_beacon_set_config(config));
furi_check(furi_hal_bt_extra_beacon_set_data(packet, size));
free(packet);
start_extra_beacon(state);

furi_check(furi_hal_bt_extra_beacon_start());
furi_thread_flags_wait(true, FuriFlagWaitAny, delay);
furi_thread_flags_wait(true, FuriFlagWaitAny, delays[state->delay]);
furi_hal_bt_extra_beacon_stop();
}

Expand All @@ -204,11 +217,8 @@ static void toggle_adv(State* state) {
state->advertising = false;
furi_thread_flags_set(furi_thread_get_id(state->thread), true);
furi_thread_join(state->thread);
// if(state->resume) furi_hal_bt_start_advertising();
} else {
state->advertising = true;
// state->resume = furi_hal_bt_is_active();
// furi_hal_bt_stop_advertising();
furi_thread_start(state->thread);
}
}
Expand Down Expand Up @@ -512,33 +522,18 @@ static bool input_callback(InputEvent* input, void* _ctx) {
}
} else {
if(!advertising) {
// bool resume = furi_hal_bt_is_active();
// furi_hal_bt_stop_advertising();
GapExtraBeaconConfig* config = &state->config;
Payload* payload = &attacks[state->index].payload;
const Protocol* protocol = attacks[state->index].protocol;

uint8_t size;
uint8_t* packet;
protocol->make_packet(&size, &packet, payload);
if(input->type == InputTypeLong && !payload->random_mac) randomize_mac(state);

uint16_t delay = delays[state->delay];
config->min_adv_interval_ms = config->max_adv_interval_ms = delay;
if(payload->random_mac || input->type == InputTypeLong)
furi_hal_random_fill_buf(config->address, sizeof(config->address));
furi_check(furi_hal_bt_extra_beacon_set_config(config));
furi_check(furi_hal_bt_extra_beacon_set_data(packet, size));
free(packet);
start_extra_beacon(state);

furi_check(furi_hal_bt_extra_beacon_start());
if(state->ctx.led_indicator)
notification_message(state->ctx.notification, &solid_message);
furi_delay_ms(10);
furi_hal_bt_extra_beacon_stop();

if(state->ctx.led_indicator)
notification_message_block(state->ctx.notification, &sequence_reset_rgb);
// if(resume) furi_hal_bt_start_advertising();
}
}
break;
Expand Down Expand Up @@ -598,6 +593,15 @@ static bool back_event_callback(void* _ctx) {

int32_t ble_spam(void* p) {
UNUSED(p);
GapExtraBeaconConfig prev_cfg;
const GapExtraBeaconConfig* prev_cfg_ptr = furi_hal_bt_extra_beacon_get_config();
if(prev_cfg_ptr) {
memcpy(&prev_cfg, prev_cfg_ptr, sizeof(prev_cfg));
}
uint8_t prev_data[EXTRA_BEACON_MAX_DATA_SIZE];
uint8_t prev_data_len = furi_hal_bt_extra_beacon_get_data(prev_data);
bool prev_active = furi_hal_bt_extra_beacon_is_active();

State* state = malloc(sizeof(State));
state->config.adv_channel_map = GapAdvChannelMapAll;
state->config.adv_power_level = GapAdvPowerLevel_6dBm;
Expand Down Expand Up @@ -672,5 +676,13 @@ int32_t ble_spam(void* p) {
furi_timer_free(state->lock_timer);
furi_thread_free(state->thread);
free(state);

if(prev_cfg_ptr) {
furi_check(furi_hal_bt_extra_beacon_set_config(&prev_cfg));
}
furi_check(furi_hal_bt_extra_beacon_set_data(prev_data, prev_data_len));
if(prev_active) {
furi_check(furi_hal_bt_extra_beacon_start());
}
return 0;
}
2 changes: 1 addition & 1 deletion applications/external/ble_spam/scenes/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void scene_config_on_enter(void* _ctx) {

variable_item_list_set_enter_callback(list, config_callback, ctx);
if(!ctx->attack->protocol) {
variable_item_list_add(list, "Personne n'y échappe", 0, NULL, NULL);
variable_item_list_add(list, "Personne n'y échappe", 0, NULL, NULL);
} else if(ctx->attack->protocol->extra_config) {
ctx->fallback_config_enter = config_callback;
ctx->attack->protocol->extra_config(ctx);
Expand Down
2 changes: 1 addition & 1 deletion applications/external/bt_trigger/bt_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ __int32_t bt_trigger_app(void* p) {
//Dealing with events one by one
switch(event.type) {
case(EventTypeInput):
//On ne considère que les appuies courts
//On ne considère que les appuies courts
if(event.input.type == InputTypeShort) {
switch(event.input.key) {
case(InputKeyBack):
Expand Down
2 changes: 0 additions & 2 deletions applications/external/bt_trigger/bt_trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <dolphin/dolphin.h>
#include "bt_trigger_icons.h"

#include <assets_icons.h>

#define HID_BT_KEYS_STORAGE_PATH EXT_PATH("apps_data/hid_ble/.bt_hid.keys")
#define TAG "bt_trigger"

Expand Down
2 changes: 1 addition & 1 deletion applications/external/calculator/calculator.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void generate_calculator_layout(Canvas* canvas) {
canvas_draw_box(canvas, 63, 43, 1, 80);

//draw buttons
//row 1 (C, ;, %, รท)
//row 1 (C, ;, %, ÷)
canvas_draw_str(canvas, 5, 54, "C");
canvas_draw_str(canvas, 19, 54, " <-");
canvas_draw_str(canvas, 35, 54, " %");
Expand Down
2 changes: 1 addition & 1 deletion applications/external/doom/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ App(
fap_category="Games",
fap_icon_assets="assets",
fap_author="@xMasterX & @Svarich & @hedger (original code by @p4nic4ttack)",
fap_version="1.2",
fap_version="1.3",
fap_description="Will it run Doom?",
)
2 changes: 1 addition & 1 deletion applications/external/doom/assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define bmp_font_width_pxs 192
#define bmp_font_height_pxs 48
#define CHAR_MAP " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.,-_(){}[]#"
#define CHAR_WIDTH 4
#define UICHAR_WIDTH 4
#define CHAR_HEIGHT 6

#define BMP_GUN_WIDTH 32
Expand Down
2 changes: 1 addition & 1 deletion applications/external/doom/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void drawTextSpace(int8_t x, int8_t y, char* txt, uint8_t space, Canvas* const c
while((ch = txt[i]) != '\0') {
drawChar(pos, y, ch, canvas);
i++;
pos += CHAR_WIDTH + space;
pos += UICHAR_WIDTH + space;

// shortcut on end of screen
if(pos > SCREEN_WIDTH) return;
Expand Down
2 changes: 1 addition & 1 deletion applications/external/flipbip/lib/crypto/aes/aestab.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ AES_RETURN aes_init(void) {
}

/*
Automatic code initialisation (suggested by by Henrik S. Gaßmann)
Automatic code initialisation (suggested by by Henrik S. Gaßmann)
based on code provided by Joe Lowe and placed in the public domain at:
http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc
*/
Expand Down
2 changes: 1 addition & 1 deletion applications/external/flipbip/lib/crypto/base32.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ char* base32_encode(
int ret = base32_encode_character(out[i], alphabet);

if(ret == -1) {
return false;
return NULL;
} else {
out[i] = ret;
}
Expand Down
2 changes: 1 addition & 1 deletion applications/external/flipbip/lib/crypto/sha3.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* sha3.c - an implementation of Secure Hash Algorithm 3 (Keccak).
* based on the
* The Keccak SHA-3 submission. Submission to NIST (Round 3), 2011
* by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche
* by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche
*
* Copyright: 2013 Aleksey Kravchenko <[email protected]>
*
Expand Down
Loading

0 comments on commit 24f353e

Please sign in to comment.