From cd38556f97a4f868698f1b75930e68cf7dc1dd64 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 29 May 2015 14:46:22 -0300 Subject: [PATCH] Fill unused header area with 0xFF instead of garbage. --- source/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/main.c b/source/main.c index 9b52772..700fb53 100644 --- a/source/main.c +++ b/source/main.c @@ -164,7 +164,9 @@ restart_program: // Write header - TODO: Not sure why this is done at the very end.. f_lseek(&file, 0x1000); unsigned int written = 0; - f_write(&file, header, 0x200, &written); + // Fill the 0x1200-0x4000 unused area with 0xFF instead of random garbage. + memset(header + 0x200, 0xFF, 0x3000 - 0x200); + f_write(&file, header, 0x3000, &written); } Debug("Done!");