Minor stuff
This commit is contained in:
parent
2f274e2f47
commit
f89845257e
@ -50,7 +50,7 @@ diff -uNr a/source/brahma.c b/source/brahma.c
|
||||
+ fseek(p , 0, SEEK_END);
|
||||
+ psize = ftell(p);
|
||||
+ if (psize > 5 && psize < 58) {
|
||||
+ char path[58];
|
||||
+ char path[57];
|
||||
+
|
||||
+ fseek(p, 0, SEEK_SET);
|
||||
+ u32 bytes_read = fread(path, 1, psize, p);
|
||||
|
@ -43,7 +43,7 @@ void main(void)
|
||||
|
||||
if(pathSize > 5 && pathSize < 58)
|
||||
{
|
||||
char path[58];
|
||||
char path[57];
|
||||
unsigned int read;
|
||||
f_read(&pathFile, path, pathSize, &read);
|
||||
if(path[pathSize - 1] == 0xA) pathSize--;
|
||||
|
@ -38,19 +38,18 @@
|
||||
static inline void pathChanger(u8 *pos)
|
||||
{
|
||||
const char *pathFile = "path.txt";
|
||||
|
||||
u32 pathSize = getFileSize(pathFile);
|
||||
|
||||
if(pathSize < 6 || pathSize > 57) return;
|
||||
|
||||
u8 path[57];
|
||||
fileRead(path, pathFile, pathSize);
|
||||
|
||||
u32 pathSize = fileRead(path, pathFile, sizeof(path));
|
||||
|
||||
if(pathSize < 6) return;
|
||||
|
||||
if(path[pathSize - 1] == 0xA) pathSize--;
|
||||
if(path[pathSize - 1] == 0xD) pathSize--;
|
||||
|
||||
if(pathSize < 6 || pathSize > 57 || path[0] != '/' || memcmp(path + pathSize - 4, ".bin", 4) != 0) return;
|
||||
if(pathSize < 6 || pathSize > 55 || path[0] != '/' || memcmp(path + pathSize - 4, ".bin", 4) != 0) return;
|
||||
|
||||
u16 finalPath[58];
|
||||
u16 finalPath[56];
|
||||
for(u32 i = 0; i < pathSize; i++)
|
||||
finalPath[i] = (u16)path[i];
|
||||
|
||||
|
10
source/pin.c
10
source/pin.c
@ -150,19 +150,15 @@ bool verifyPin(u32 pinMode)
|
||||
drawCharacter('0' + lengthBlock[0], true, 10 + 5 * SPACING_X, 10 + 3 * SPACING_Y, COLOR_WHITE);
|
||||
|
||||
const char *messageFile = "pinmessage.txt";
|
||||
|
||||
u32 messageSize = getFileSize(messageFile);
|
||||
|
||||
if(messageSize > 0 && messageSize <= 800)
|
||||
{
|
||||
char message[801];
|
||||
|
||||
if(fileRead(message, messageFile, messageSize) == messageSize)
|
||||
u32 messageSize = fileRead(message, messageFile, sizeof(message) - 1);
|
||||
|
||||
if(messageSize != 0)
|
||||
{
|
||||
message[messageSize] = 0;
|
||||
drawString(message, false, 10, 10, COLOR_WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
//Pad to AES block length with zeroes
|
||||
__attribute__((aligned(4))) u8 enteredPassword[AES_BLOCK_SIZE] = {0};
|
||||
|
Reference in New Issue
Block a user