Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Missing typecast on MinSize and MaxSize #18

Closed
osresearch opened this issue May 29, 2020 · 0 comments
Closed

Missing typecast on MinSize and MaxSize #18

osresearch opened this issue May 29, 2020 · 0 comments

Comments

@osresearch
Copy link

MinSize and MaxSize are printed as characters, not ints:

0x1A04E4                        String: Local IP Address, 
 VarStoreInfo (VarOffset/VarName): 0x2, 
 VarStore: 0x1, 
 QuestionId: 0x102, 
 MinSize: 0x^G, 
 MaxSize: 0x^O
 {1C 90 08 00 09 00 02 01 01 00 02 00 04 07 0F 00}

Should the types be unsigned or something more specific?

diff --git a/UEFI.cpp b/UEFI.cpp
index 157fa80..30558c0 100644
--- a/UEFI.cpp
+++ b/UEFI.cpp
@@ -441,8 +441,8 @@ void generateUEFIIFRDump(const string &outputFile, const vector<UEFI_IFR_STRING_
 
                 // Display temp
                 fout << "Password: " << strings[temp->Question.Header.Prompt + strPackageOffset] << ", VarStoreInfo (VarOffset/VarName): 0x" << hex << uppercase << temp->Question.VarStoreInfo.VarOffset << ", VarStore: 0x" << temp->Question.VarStoreId << ", QuestionId: 0x" << temp->Question.QuestionId;
-                fout << ", MinSize: 0x" << temp->MinSize;
-                fout << ", MaxSize 0x" << temp->MaxSize;
+                fout << ", MinSize: 0x" << (unsigned) temp->MinSize;
+                fout << ", MaxSize 0x" << (unsigned) temp->MaxSize;
             }
             else if (buffer[j] == EFI_IFR_ONE_OF_OPTION_OP) {
 
@@ -644,7 +644,7 @@ void generateUEFIIFRDump(const string &outputFile, const vector<UEFI_IFR_STRING_
                 EFI_IFR_STRING *temp = (EFI_IFR_STRING*)&buffer[j];
 
                 // Display temp
-                fout << "String: " << strings[temp->Question.Header.Prompt + strPackageOffset] << ", VarStoreInfo (VarOffset/VarName): 0x" << hex << uppercase << temp->Question.VarStoreInfo.VarOffset << ", VarStore: 0x" << temp->Question.VarStoreId << ", QuestionId: 0x" << temp->Question.QuestionId << ", MinSize: 0x" << temp->MinSize << ", MaxSize: 0x" << temp->MaxSize;
+                fout << "String: " << strings[temp->Question.Header.Prompt + strPackageOffset] << ", VarStoreInfo (VarOffset/VarName): 0x" << hex << uppercase << temp->Question.VarStoreInfo.VarOffset << ", VarStore: 0x" << temp->Question.VarStoreId << ", QuestionId: 0x" << temp->Question.QuestionId << ", MinSize: 0x" << (unsigned) temp->MinSize << ", MaxSize: 0x" << (unsigned) temp->MaxSize;
             }
             else if (buffer[j] == EFI_IFR_REFRESH_OP) {
 
rmast pushed a commit to rmast/Universal-IFR-Extractor that referenced this issue Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant