Account for trailing newlines in .txts
This commit is contained in:
parent
f228cb241f
commit
c8586cfe26
@ -77,7 +77,7 @@ static void loadCustomVerString(u16 *out, u32 *verStringSize)
|
|||||||
{
|
{
|
||||||
u64 fileSize;
|
u64 fileSize;
|
||||||
|
|
||||||
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && fileSize <= 60)
|
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && fileSize <= 61)
|
||||||
{
|
{
|
||||||
u8 buf[fileSize];
|
u8 buf[fileSize];
|
||||||
u64 total;
|
u64 total;
|
||||||
@ -159,12 +159,12 @@ static void loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId)
|
|||||||
{
|
{
|
||||||
u64 fileSize;
|
u64 fileSize;
|
||||||
|
|
||||||
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && fileSize == 6)
|
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && (fileSize == 6 || fileSize == 7))
|
||||||
{
|
{
|
||||||
char buf[6];
|
char buf[fileSize];
|
||||||
u64 total;
|
u64 total;
|
||||||
|
|
||||||
if(R_SUCCEEDED(IFile_Read(&file, &total, buf, 6)))
|
if(R_SUCCEEDED(IFile_Read(&file, &total, buf, fileSize)))
|
||||||
{
|
{
|
||||||
for(u32 i = 0; i < 7; i++)
|
for(u32 i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
|
@ -484,6 +484,6 @@ void computePinHash(u8 *outbuf, const u8 *inbuf)
|
|||||||
|
|
||||||
sdmmc_get_cid(1, (u32 *)cid);
|
sdmmc_get_cid(1, (u32 *)cid);
|
||||||
aes_use_keyslot(4); //Console-unique keyslot whose keys are set by the ARM9 bootROM
|
aes_use_keyslot(4); //Console-unique keyslot whose keys are set by the ARM9 bootROM
|
||||||
aes(cipherText, in, 1, cid, AES_CBC_ENCRYPT_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
|
aes(cipherText, inbuf, 1, cid, AES_CBC_ENCRYPT_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
|
||||||
sha(out, cipherText, sizeof(cipherText), SHA_256_MODE);
|
sha(outbuf, cipherText, sizeof(cipherText), SHA_256_MODE);
|
||||||
}
|
}
|
Reference in New Issue
Block a user