mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
flash: fix & simplify post-logo filling
This commit is contained in:
+7
-6
@@ -635,11 +635,7 @@ static const char ice[] =
|
||||
"...................................................................\n @@@ @@@@@@@ @@@@@@@@ @@@@@@@@@@ @@@@@@ @@@ @@@\n"
|
||||
" @@! !@@ @@! @@! @@! @@! @@! @@@ @@!@!@@@\n !!@ !@! @!!!:! @!! !!@ @!@ @!@!@!@! @!@@!!@!\n"
|
||||
" !!: :!! !!: !!: !!: !!: !!! !!: !!!\n : :: :: : : :: ::: : : : : : :: : \n"
|
||||
_RED_(" . .. .. . . .. ... . . . . . .. . ")
|
||||
"\n...................................................................\n"
|
||||
"...................................................................\n"
|
||||
"...................................................................\n"
|
||||
;
|
||||
_RED_(" . .. .. . . .. ... . . . . . .. . ");
|
||||
|
||||
// Write a file's segments to Flash
|
||||
int flash_write(flash_file_t *ctx) {
|
||||
@@ -651,6 +647,7 @@ int flash_write(flash_file_t *ctx) {
|
||||
char ice3[sizeof(ice)] = {0};
|
||||
memcpy_filter_ansi(ice2, ice, sizeof(ice), !g_session.supports_colors);
|
||||
memcpy_filter_emoji(ice3, ice2, sizeof(ice2), g_session.emoji_mode);
|
||||
size_t ice3len = strlen(ice3);
|
||||
|
||||
for (int i = 0; i < ctx->num_segs; i++) {
|
||||
flash_seg_t *seg = &ctx->segments[i];
|
||||
@@ -679,10 +676,14 @@ int flash_write(flash_file_t *ctx) {
|
||||
baddr += block_size;
|
||||
length -= block_size;
|
||||
block++;
|
||||
if (len < strlen(ice3)) {
|
||||
if (len < ice3len) {
|
||||
fprintf(stdout, "%c", ice3[len++]);
|
||||
} else {
|
||||
if ((len - ice3len) % 67 == 0) {
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
fprintf(stdout, ".");
|
||||
len++;
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user