Update hexadecimal numbers output format from ABCDh to 0xABCD

This commit is contained in:
Nikolaj Schlej 2025-04-26 16:16:02 +07:00
parent 73d07cddc3
commit 9cc9518f8b
10 changed files with 397 additions and 394 deletions

View file

@ -91,7 +91,7 @@ USTATUS FfsFinder::findHexPattern(const UModelIndex & index, const UByteArray &
msg(UString("Hex pattern \"") + UString(hexPattern)
+ UString("\" found as \"") + hexBody.mid(offset, hexPattern.length()).toUpper()
+ UString("\" in ") + name
+ usprintf(" at %s-offset %02Xh", mode == SEARCH_MODE_BODY ? "body" : "header", offset / 2),
+ usprintf(" at %s-offset 0x%02X", mode == SEARCH_MODE_BODY ? "body" : "header", offset / 2),
index);
ret = U_SUCCESS;
}
@ -193,7 +193,7 @@ USTATUS FfsFinder::findGuidPattern(const UModelIndex & index, const UByteArray &
msg(UString("GUID pattern \"") + UString(guidPattern)
+ UString("\" found as \"") + hexBody.mid(offset, hexPattern.length()).toUpper()
+ UString("\" in ") + name
+ usprintf(" at %s-offset %02Xh", mode == SEARCH_MODE_BODY ? "body" : "header", offset / 2),
+ usprintf(" at %s-offset 0x%02X", mode == SEARCH_MODE_BODY ? "body" : "header", offset / 2),
index);
ret = U_SUCCESS;
}
@ -267,7 +267,7 @@ USTATUS FfsFinder::findTextPattern(const UModelIndex & index, const UString & pa
msg((unicode ? UString("Unicode") : UString("ASCII")) + UString(" text \"") + UString(pattern)
+ UString("\" found in ") + name
+ usprintf(" at %s-offset %02Xh", mode == SEARCH_MODE_BODY ? "body" : "header", offset),
+ usprintf(" at %s-offset 0x%02X", mode == SEARCH_MODE_BODY ? "body" : "header", offset),
index);
ret = U_SUCCESS;
}

View file

@ -249,5 +249,5 @@ UString jedecIdToUString(UINT8 vendorId, UINT8 deviceId0, UINT8 deviceId1)
case 0x9D7019: return UString("ISSI Ix25WP256");
}
return usprintf("Unknown %08Xh", jedecId);
return usprintf("Unknown 0x%08X", jedecId);
}

View file

@ -296,7 +296,7 @@ UString fileTypeToUString(const UINT8 type)
case EFI_FV_FILETYPE_MM_CORE_STANDALONE: return UString("MM standalone core");
case EFI_FV_FILETYPE_PAD: return UString("Pad");
};
return usprintf("Unknown %02Xh", type);
return usprintf("Unknown 0x%02X", type);
}
UString sectionTypeToUString(const UINT8 type)
@ -320,7 +320,7 @@ UString sectionTypeToUString(const UINT8 type)
case INSYDE_SECTION_POSTCODE: return UString("Insyde postcode");
case PHOENIX_SECTION_POSTCODE: return UString("Phoenix postcode");
}
return usprintf("Unknown %02Xh", type);
return usprintf("Unknown 0x%02X", type);
}
UString bpdtEntryTypeToUString(const UINT16 type)
@ -373,7 +373,7 @@ UString bpdtEntryTypeToUString(const UINT16 type)
case BPDT_ENTRY_TYPE_TCCP: return UString("TCC");
case BPDT_ENTRY_TYPE_PSEP: return UString("PSE");
}
return usprintf("Unknown %04Xh", type);
return usprintf("Unknown 0x%04X", type);
}
UString cpdExtensionTypeToUstring(const UINT32 type)
@ -412,5 +412,5 @@ UString cpdExtensionTypeToUstring(const UINT32 type)
case CPD_EXT_TYPE_SIGNED_PACKAGE_INFO_EXT: return UString("Extended Signed Package Info");
case CPD_EXT_TYPE_SPS_PLATFORM_ID: return UString("SPS Platform ID");
}
return usprintf("Unknown %08Xh", type);
return usprintf("Unknown 0x%08X", type);
}

View file

@ -126,11 +126,11 @@ USTATUS FfsBuilder::buildCapsule(const UModelIndex & index, UByteArray & capsule
UINT32 newSize = (UINT32)capsule.size();
UINT32 oldSize = (UINT32)model->body(index).size();
if (newSize > oldSize) {
msg(usprintf("buildCapsule: new capsule size %Xh (%u) is bigger than the original %Xh (%u)", newSize, newSize, oldSize, oldSize), index);
msg(usprintf("buildCapsule: new capsule size 0x%X (%u) is bigger than the original 0x%X (%u)", newSize, newSize, oldSize, oldSize), index);
return U_INVALID_CAPSULE;
}
else if (newSize < oldSize) {
msg(usprintf("buildCapsule: new capsule size %Xh (%u) is smaller than the original %Xh (%u)", newSize, newSize, oldSize, oldSize), index);
msg(usprintf("buildCapsule: new capsule size 0x%X (%u) is smaller than the original 0x%X (%u)", newSize, newSize, oldSize, oldSize), index);
return U_INVALID_CAPSULE;
}
}
@ -225,11 +225,11 @@ USTATUS FfsBuilder::buildIntelImage(const UModelIndex & index, UByteArray & inte
UINT32 newSize = (UINT32)intelImage.size();
UINT32 oldSize = (UINT32)model->body(index).size();
if (newSize > oldSize) {
msg(usprintf("buildIntelImage: new image size %Xh (%u) is bigger than the original %Xh (%u)", newSize, newSize, oldSize, oldSize), index);
msg(usprintf("buildIntelImage: new image size 0x%X (%u) is bigger than the original 0x%X (%u)", newSize, newSize, oldSize, oldSize), index);
return U_INVALID_IMAGE;
}
else if (newSize < oldSize) {
msg(usprintf("buildIntelImage: new image size %Xh (%u) is smaller than the original %Xh (%u)", newSize, newSize, oldSize, oldSize), index);
msg(usprintf("buildIntelImage: new image size 0x%X (%u) is smaller than the original 0x%X (%u)", newSize, newSize, oldSize, oldSize), index);
return U_INVALID_IMAGE;
}
@ -296,11 +296,11 @@ USTATUS FfsBuilder::buildRawArea(const UModelIndex & index, UByteArray & rawArea
UINT32 newSize = (UINT32)rawArea.size();
UINT32 oldSize = (UINT32)model->body(index).size();
if (newSize > oldSize) {
msg(usprintf("buildRawArea: new area size %Xh (%u) is bigger than the original %Xh (%u)", newSize, newSize, oldSize, oldSize), index);
msg(usprintf("buildRawArea: new area size 0x%X (%u) is bigger than the original 0x%X (%u)", newSize, newSize, oldSize, oldSize), index);
return U_INVALID_RAW_AREA;
}
else if (newSize < oldSize) {
msg(usprintf("buildRawArea: new area size %Xh (%u) is smaller than the original %Xh (%u)", newSize, newSize, oldSize, oldSize), index);
msg(usprintf("buildRawArea: new area size 0x%X (%u) is smaller than the original 0x%X (%u)", newSize, newSize, oldSize, oldSize), index);
return U_INVALID_RAW_AREA;
}
}

File diff suppressed because it is too large Load diff

View file

@ -79,7 +79,7 @@ USTATUS FitParser::parseFit(const UModelIndex & index)
tempFitHeader->Checksum = 0;
UINT8 calculated = calculateChecksum8((const UINT8*)tempFitHeader, fitSize);
if (calculated != fitHeader->Checksum) {
msg(usprintf("%s: invalid FIT table checksum %02Xh, should be %02Xh", __FUNCTION__, fitHeader->Checksum, calculated), fitIndex);
msg(usprintf("%s: invalid FIT table checksum 0x%02X, should be 0x%02X", __FUNCTION__, fitHeader->Checksum, calculated), fitIndex);
}
}
@ -92,9 +92,9 @@ USTATUS FitParser::parseFit(const UModelIndex & index)
// Add FIT header
std::vector<UString> currentStrings;
currentStrings.push_back(UString("_FIT_ "));
currentStrings.push_back(usprintf("%08Xh", fitSize));
currentStrings.push_back(usprintf("%04Xh", fitHeader->Version));
currentStrings.push_back(usprintf("%02Xh", fitHeader->Checksum));
currentStrings.push_back(usprintf("0x%08X", fitSize));
currentStrings.push_back(usprintf("0x%04X", fitHeader->Version));
currentStrings.push_back(usprintf("0x%02X", fitHeader->Checksum));
currentStrings.push_back(fitEntryTypeToUString(fitHeader->Type));
currentStrings.push_back(UString()); // Empty info for FIT header
fitTable.push_back(std::pair<std::vector<UString>, UModelIndex>(currentStrings, fitIndex));
@ -120,7 +120,7 @@ USTATUS FitParser::parseFit(const UModelIndex & index)
if ((currentEntry->Type == INTEL_FIT_TYPE_TXT_POLICY || currentEntry->Type == INTEL_FIT_TYPE_TPM_POLICY)
&& currentEntry->Version == 0) {
const INTEL_FIT_INDEX_IO_ADDRESS* policy = (const INTEL_FIT_INDEX_IO_ADDRESS*)currentEntry;
info += usprintf("Index: %04Xh, BitPosition: %02Xh, AccessWidth: %02Xh, DataRegAddr: %04Xh, IndexRegAddr: %04Xh",
info += usprintf("Index: 0x%04X, BitPosition: 0x%02X, AccessWidth: 0x%02X, DataRegAddr: 0x%04X, IndexRegAddr: 0x%04X",
policy->Index,
policy->BitPosition,
policy->AccessWidthInBytes,
@ -170,10 +170,10 @@ USTATUS FitParser::parseFit(const UModelIndex & index)
}
// Add entry to fitTable
currentStrings.push_back(usprintf("%016" PRIX64 "h", currentEntry->Address));
currentStrings.push_back(usprintf("%08Xh", currentEntrySize));
currentStrings.push_back(usprintf("%04Xh", currentEntry->Version));
currentStrings.push_back(usprintf("%02Xh", currentEntry->Checksum));
currentStrings.push_back(usprintf("0x%016" PRIX64, currentEntry->Address));
currentStrings.push_back(usprintf("0x%08X", currentEntrySize));
currentStrings.push_back(usprintf("0x%04X", currentEntry->Version));
currentStrings.push_back(usprintf("0x%02X", currentEntry->Checksum));
currentStrings.push_back(fitEntryTypeToUString(currentEntry->Type));
currentStrings.push_back(info);
fitTable.push_back(std::pair<std::vector<UString>, UModelIndex>(currentStrings, itemIndex));
@ -238,7 +238,7 @@ void FitParser::findFitRecursive(const UModelIndex & index, UModelIndex & found,
// Real FIT found
found = index;
fitOffset = offset;
msg(usprintf("%s: real FIT table found at physical address %08Xh", __FUNCTION__, fitAddress), found);
msg(usprintf("%s: real FIT table found at physical address 0x%08X", __FUNCTION__, fitAddress), found);
break;
}
}
@ -265,7 +265,7 @@ USTATUS FitParser::parseFitEntryMicrocode(const UByteArray & microcode, const UI
}
// Valid microcode found
info = usprintf("CpuSignature: %08Xh, Revision: %08Xh, Date: %02X.%02X.%04X",
info = usprintf("CpuSignature: 0x%08X, Revision: 0x%08X, Date: %02X.%02X.%04X",
ucodeHeader->ProcessorSignature,
ucodeHeader->UpdateRevision,
ucodeHeader->DateDay,
@ -290,11 +290,11 @@ USTATUS FitParser::parseFitEntryAcm(const UByteArray & acm, const UINT32 localOf
// Check header version to be of a known value
if (header->header_version() != intel_acm_t::KNOWN_HEADER_VERSION_V0_0
&& header->header_version() != intel_acm_t::KNOWN_HEADER_VERSION_V3_0) {
msg(usprintf("%s: Intel ACM with unknown header version %08Xh found", __FUNCTION__, header->header_version()), parent);
msg(usprintf("%s: Intel ACM with unknown header version 0x%08X found", __FUNCTION__, header->header_version()), parent);
}
// Valid ACM found
info = usprintf("LocalOffset: %08Xh, EntryPoint: %08Xh, ACM SVN: %04Xh, Date: %02X.%02X.%04X",
info = usprintf("LocalOffset: 0x%08X, EntryPoint: 0x%08X, ACM SVN: 0x%04X, Date: %02X.%02X.%04X",
localOffset,
header->entry_point(),
header->acm_svn(),
@ -314,30 +314,30 @@ USTATUS FitParser::parseFitEntryAcm(const UByteArray & acm, const UINT32 localOf
acmInfo = "BootGuard ACM ";
}
else {
acmInfo = usprintf("Unknown ACM (%04Xh)", header->module_subtype());
msg(usprintf("%s: Intel ACM with unknown subtype %04Xh found", __FUNCTION__, header->module_subtype()), parent);
acmInfo = usprintf("Unknown ACM (0x%04X)", header->module_subtype());
msg(usprintf("%s: Intel ACM with unknown subtype 0x%04X found", __FUNCTION__, header->module_subtype()), parent);
}
acmInfo += usprintf("found at base %Xh\n"
"ModuleType: %04Xh\n"
"ModuleSubtype: %04Xh\n"
"HeaderSize: %08Xh\n"
"HeaderVersion: %08Xh\n"
"ChipsetId: %04Xh\n"
"Flags: %04Xh\n"
"ModuleVendor: %04Xh\n"
acmInfo += usprintf("found at base 0x%X\n"
"ModuleType: 0x%04X\n"
"ModuleSubtype: 0x%04X\n"
"HeaderSize: 0x%08X\n"
"HeaderVersion: 0x%08X\n"
"ChipsetId: 0x%04X\n"
"Flags: 0x%04X\n"
"ModuleVendor: 0x%04X\n"
"Date: %02X.%02X.%04X\n"
"ModuleSize: %08Xh\n"
"AcmSvn: %04Xh\n"
"SeSvn: %04Xh\n"
"CodeControlFlags: %08Xh\n"
"ErrorEntryPoint: %08Xh\n"
"GdtMax: %08Xh\n"
"GdtBase: %08Xh\n"
"SegmentSel: %08Xh\n"
"EntryPoint: %08Xh\n"
"KeySize: %08Xh\n"
"ScratchSpaceSize: %08Xh\n",
"ModuleSize: 0x%08X\n"
"AcmSvn: 0x%04X\n"
"SeSvn: 0x%04X\n"
"CodeControlFlags: 0x%08X\n"
"ErrorEntryPoint: 0x%08X\n"
"GdtMax: 0x%08X\n"
"GdtBase: 0x%08X\n"
"SegmentSel: 0x%08X\n"
"EntryPoint: 0x%08X\n"
"KeySize: 0x%08X\n"
"ScratchSpaceSize: 0x%08X\n",
model->base(parent) + localOffset,
header->module_type(),
header->module_subtype(),
@ -361,10 +361,10 @@ USTATUS FitParser::parseFitEntryAcm(const UByteArray & acm, const UINT32 localOf
// Add RsaPublicKey
if (header->_is_null_rsa_exponent() == false) {
acmInfo += usprintf("ACM RSA Public Key Exponent: %Xh\n", header->rsa_exponent());
acmInfo += usprintf("ACM RSA Public Key Exponent: 0x%X\n", header->rsa_exponent());
}
else {
acmInfo += usprintf("ACM RSA Public Key Exponent: %Xh\n", INTEL_ACM_HARDCODED_RSA_EXPONENT);
acmInfo += usprintf("ACM RSA Public Key Exponent: 0x%X\n", INTEL_ACM_HARDCODED_RSA_EXPONENT);
}
acmInfo += usprintf("ACM RSA Public Key:");
for (UINT32 i = 0; i < header->rsa_public_key().size(); i++) {
@ -403,7 +403,7 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
intel_keym_v1_t parsed(&ks);
// Valid KM found
info = usprintf("LocalOffset: %08Xh, Version: %02Xh, KM Version: %02Xh, KM SVN: %02Xh",
info = usprintf("LocalOffset: 0x%08X, Version: 0x%02X, KM Version: 0x%02X, KM SVN: 0x%02X",
localOffset,
parsed.version(),
parsed.km_version(),
@ -411,12 +411,12 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
// Populate KM info
UString kmInfo
= usprintf("Intel BootGuard Key manifest found at base %Xh\n"
= usprintf("Intel BootGuard Key manifest found at base 0x%X\n"
"Tag: '__KEYM__'\n"
"Version: %02Xh\n"
"KmVersion: %02Xh\n"
"KmSvn: %02Xh\n"
"KmId: %02Xh\n",
"Version: 0x%02X\n"
"KmVersion: 0x%02X\n"
"KmSvn: 0x%02X\n"
"KmId: 0x%02X\n",
model->base(parent) + localOffset,
parsed.version(),
parsed.km_version(),
@ -433,15 +433,15 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
// Add Key Signature
const intel_keym_v1_t::key_signature_t* key_signature = parsed.key_signature();
kmInfo += usprintf("Key Manifest Key Signature:\n"
"Version: %02Xh\n"
"KeyId: %04Xh\n"
"SigScheme: %04Xh\n",
"Version: 0x%02X\n"
"KeyId: 0x%04X\n"
"SigScheme: 0x%04X\n",
key_signature->version(),
key_signature->key_id(),
key_signature->sig_scheme());
// Add PubKey
kmInfo += usprintf("Key Manifest Public Key Exponent: %Xh\n", key_signature->public_key()->exponent());
kmInfo += usprintf("Key Manifest Public Key Exponent: 0x%X\n", key_signature->public_key()->exponent());
kmInfo += usprintf("Key Manifest Public Key:");
for (UINT16 i = 0; i < (UINT16)key_signature->public_key()->modulus().length(); i++) {
if (i % 32 == 0) kmInfo += UString("\n");
@ -507,7 +507,7 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
intel_keym_v2_t::header_t* header = parsed.header();
// Valid KM found
info = usprintf("LocalOffset: %08Xh, Version: %02Xh, KM Version: %02Xh, KM SVN: %02Xh",
info = usprintf("LocalOffset: 0x%08X, Version: 0x%02X, KM Version: 0x%02X, KM SVN: 0x%02X",
localOffset,
header->version(),
parsed.km_version(),
@ -515,15 +515,15 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
// Populate KM info
UString kmInfo
= usprintf("Intel BootGuard Key manifest found at base %Xh\n"
= usprintf("Intel BootGuard Key manifest found at base 0x%X\n"
"Tag: '__KEYM__'\n"
"Version: %02Xh\n"
"KmVersion: %02Xh\n"
"KmSvn: %02Xh\n"
"KmId: %02Xh\n"
"KeySignatureOffset: %04Xh\n"
"FPFHashAlgorithmId: %04Xh\n"
"HashCount: %04Xh\n",
"Version: 0x%02X\n"
"KmVersion: 0x%02X\n"
"KmSvn: 0x%02X\n"
"KmId: 0x%02X\n"
"KeySignatureOffset: 0x%04X\n"
"FPFHashAlgorithmId: 0x%04X\n"
"HashCount: 0x%04X\n",
model->base(parent) + localOffset,
header->version(),
parsed.km_version(),
@ -544,7 +544,7 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
const auto & current_km_hash = parsed.km_hashes()->at(i);
// Add KM hash
kmInfo += usprintf("UsageFlags: %016" PRIX64 "h, ", current_km_hash->usage_flags()) + hashTypeToUString(current_km_hash->hash_algorithm_id()) + ": ";
kmInfo += usprintf("UsageFlags: 0x%016" PRIX64 ", ", current_km_hash->usage_flags()) + hashTypeToUString(current_km_hash->hash_algorithm_id()) + ": ";
for (UINT16 j = 0; j < current_km_hash->len_hash(); j++) {
kmInfo += usprintf("%02X", (UINT8)current_km_hash->hash().data()[j]);
}
@ -559,15 +559,15 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
// Add Key Signature
const intel_keym_v2_t::key_signature_t* key_signature = parsed.key_signature();
kmInfo += usprintf("Key Manifest Key Signature:\n"
"Version: %02Xh\n"
"KeyId: %04Xh\n"
"SigScheme: %04Xh\n",
"Version: 0x%02X\n"
"KeyId: 0x%04X\n"
"SigScheme: 0x%04X\n",
key_signature->version(),
key_signature->key_id(),
key_signature->sig_scheme());
// Add PubKey
kmInfo += usprintf("Key Manifest Public Key Exponent: %Xh\n", key_signature->public_key()->exponent());
kmInfo += usprintf("Key Manifest Public Key Exponent: 0x%X\n", key_signature->public_key()->exponent());
kmInfo += usprintf("Key Manifest Public Key:");
for (UINT16 i = 0; i < (UINT16)key_signature->public_key()->modulus().length(); i++) {
if (i % 32 == 0) kmInfo += UString("\n");
@ -638,20 +638,20 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
intel_acbp_v1_t parsed(&ks);
// Valid BPM found
info = usprintf("LocalOffset: %08Xh, Version: %02Xh, BP SVN: %02Xh, ACM SVN: %02Xh",
info = usprintf("LocalOffset: 0x%08X, Version: 0x%02X, BP SVN: 0x%02X, ACM SVN: 0x%02X",
localOffset,
parsed.version(),
parsed.bp_svn(),
parsed.acm_svn());
UString bpInfo
= usprintf("Intel BootGuard Boot Policy Manifest found at base %Xh\n"
= usprintf("Intel BootGuard Boot Policy Manifest found at base 0x%X\n"
"StructureId: '__ACBP__'\n"
"Version: %02Xh\n"
"BPMRevision: %02Xh\n"
"BPSVN: %02Xh\n"
"ACMSVN: %02Xh\n"
"NEMDataSize: %04Xh\n",
"Version: 0x%02X\n"
"BPMRevision: 0x%02X\n"
"BPSVN: 0x%02X\n"
"ACMSVN: 0x%02X\n"
"NEMDataSize: 0x%04X\n",
model->base(parent) + localOffset,
parsed.version(),
parsed.bpm_revision(),
@ -667,7 +667,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const char* structure_id_bytes = (const char*)&structure_id;
bpInfo += usprintf("StructureId: '%c%c%c%c%c%c%c%c'\n"
"Version: %02Xh\n",
"Version: 0x%02X\n",
structure_id_bytes[0],
structure_id_bytes[1],
structure_id_bytes[2],
@ -683,15 +683,15 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const intel_acbp_v1_t::ibbs_body_t* ibbs_body = element->ibbs_body();
// Valid IBBS element found
bpInfo += usprintf("Flags: %08Xh\n"
"MchBar: %016" PRIX64 "h\n"
"VtdBar: %016" PRIX64 "h\n"
"DmaProtectionBase0: %08Xh\n"
"DmaProtectionLimit0: %08Xh\n"
"DmaProtectionBase1: %016" PRIX64 "h\n"
"DmaProtectionLimit1: %016" PRIX64 "h\n"
"IbbEntryPoint: %08Xh\n"
"IbbSegmentsCount: %02Xh\n",
bpInfo += usprintf("Flags: 0x%08X\n"
"MchBar: 0x%016" PRIX64 "\n"
"VtdBar: 0x%016" PRIX64 "\n"
"DmaProtectionBase0: 0x%08X\n"
"DmaProtectionLimit0: 0x%08X\n"
"DmaProtectionBase1: 0x%016" PRIX64 "\n"
"DmaProtectionLimit1: 0x%016" PRIX64 "\n"
"IbbEntryPoint: 0x%08X\n"
"IbbSegmentsCount: 0x%02X\n",
ibbs_body->flags(),
ibbs_body->mch_bar(),
ibbs_body->vtd_bar(),
@ -743,7 +743,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
for (UINT8 i = 0; i < ibbs_body->num_ibb_segments(); i++) {
const auto & current_segment = ibbs_body->ibb_segments()->at(i);
bpInfo += usprintf("Flags: %04Xh, Address: %08Xh, Size: %08Xh\n",
bpInfo += usprintf("Flags: 0x%04X, Address: 0x%08X, Size: 0x%08X\n",
current_segment->flags(),
current_segment->base(),
current_segment->size());
@ -765,9 +765,9 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
intel_acbp_v1_t::pmda_body_t* pmda_body = element->pmda_body();
// Valid Microsoft PMDA element found
bpInfo += usprintf("TotalSize: %04Xh\n"
"Version: %08Xh\n"
"NumEntries: %08Xh\n",
bpInfo += usprintf("TotalSize: 0x%04X\n"
"Version: 0x%08X\n"
"NumEntries: 0x%08X\n",
pmda_body->total_size(),
pmda_body->version(),
pmda_body->num_entries());
@ -782,7 +782,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const auto & current_element = pmda_body->entries_v1()->at(i);
// Add element
bpInfo += usprintf("Address: %08Xh, Size: %08Xh\n",
bpInfo += usprintf("Address: 0x%08X, Size: 0x%08X\n",
current_element->base(),
current_element->size());
@ -811,7 +811,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const auto & current_element = pmda_body->entries_v2()->at(i);
// Add element
bpInfo += usprintf("Address: %08Xh, Size: %08Xh\n",
bpInfo += usprintf("Address: 0x%08X, Size: 0x%08X\n",
current_element->base(),
current_element->size());
@ -840,15 +840,15 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
else if (element->_is_null_pmsg_body() == false) {
const intel_acbp_v1_t::pmsg_body_t* key_signature = element->pmsg_body();
bpInfo += usprintf("Boot Policy Key Signature:\n"
"Version: %02Xh\n"
"KeyId: %04Xh\n"
"SigScheme: %04Xh\n",
"Version: 0x%02X\n"
"KeyId: 0x%04X\n"
"SigScheme: 0x%04X\n",
key_signature->version(),
key_signature->key_id(),
key_signature->sig_scheme());
// Add PubKey
bpInfo += usprintf("Boot Policy Public Key Exponent: %Xh\n", key_signature->public_key()->exponent());
bpInfo += usprintf("Boot Policy Public Key Exponent: 0x%X\n", key_signature->public_key()->exponent());
bpInfo += usprintf("Boot Policy Public Key:");
for (UINT16 i = 0; i < (UINT16)key_signature->public_key()->modulus().length(); i++) {
if (i % 32 == 0) bpInfo += UString("\n");
@ -900,7 +900,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
kaitai::kstream ks(&is);
intel_acbp_v2_t parsed(&ks); // This already verified the version to be >= 0x20
// Valid BPM found
info = usprintf("LocalOffset: %08Xh, Version: %02Xh, BP SVN: %02Xh, ACM SVN: %02Xh",
info = usprintf("LocalOffset: 0x%08X, Version: 0x%02X, BP SVN: 0x%02X, ACM SVN: 0x%02X",
localOffset,
parsed.version(),
parsed.bp_svn(),
@ -908,16 +908,16 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
// Add BP header and body info
UString bpInfo
= usprintf("Intel BootGuard Boot Policy Manifest found at base %Xh\n"
= usprintf("Intel BootGuard Boot Policy Manifest found at base 0x%X\n"
"StructureId: '__ACBP__'\n"
"Version: %02Xh\n"
"HeaderSpecific: %02Xh\n"
"TotalSize: %04Xh\n"
"KeySignatureOffset: %04Xh\n"
"BPMRevision: %02Xh\n"
"BPSVN: %02Xh\n"
"ACMSVN: %02Xh\n"
"NEMDataSize: %04Xh\n",
"Version: 0x%02X\n"
"HeaderSpecific: 0x%02X\n"
"TotalSize: 0x%04X\n"
"KeySignatureOffset: 0x%04X\n"
"BPMRevision: 0x%02X\n"
"BPSVN: 0x%02X\n"
"ACMSVN: 0x%02X\n"
"NEMDataSize: 0x%04X\n",
model->base(parent) + localOffset,
parsed.version(),
parsed.header_specific(),
@ -936,9 +936,9 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const char* structure_id_bytes = (const char*)&structure_id;
bpInfo += usprintf("StructureId: '%c%c%c%c%c%c%c%c'\n"
"Version: %02Xh\n"
"HeaderSpecific: %02Xh\n"
"TotalSize: %04Xh\n",
"Version: 0x%02X\n"
"HeaderSpecific: 0x%02X\n"
"TotalSize: 0x%04X\n",
structure_id_bytes[0],
structure_id_bytes[1],
structure_id_bytes[2],
@ -956,19 +956,19 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const intel_acbp_v2_t::ibbs_body_t* ibbs_body = element->ibbs_body();
// Valid IBBS element found
bpInfo += usprintf("SetNumber: %02Xh\n"
"PBETValue: %02Xh\n"
"Flags: %08Xh\n"
"MchBar: %016" PRIX64 "h\n"
"VtdBar: %016" PRIX64 "h\n"
"DmaProtectionBase0: %08Xh\n"
"DmaProtectionLimit0: %08Xh\n"
"DmaProtectionBase1: %016" PRIX64 "h\n"
"DmaProtectionLimit1: %016" PRIX64 "h\n"
"IbbEntryPoint: %08Xh\n"
"IbbDigestsSize: %02Xh\n"
"IbbDigestsCount: %02Xh\n"
"IbbSegmentsCount: %02Xh\n",
bpInfo += usprintf("SetNumber: 0x%02X\n"
"PBETValue: 0x%02X\n"
"Flags: 0x%08X\n"
"MchBar: 0x%016" PRIX64 "\n"
"VtdBar: 0x%016" PRIX64 "\n"
"DmaProtectionBase0: 0x%08X\n"
"DmaProtectionLimit0: 0x%08X\n"
"DmaProtectionBase1: 0x%016" PRIX64 "\n"
"DmaProtectionLimit1: 0x%016" PRIX64 "\n"
"IbbEntryPoint: 0x%08X\n"
"IbbDigestsSize: 0x%02X\n"
"IbbDigestsCount: 0x%02X\n"
"IbbSegmentsCount: 0x%02X\n",
ibbs_body->set_number(),
ibbs_body->pbet_value(),
ibbs_body->flags(),
@ -1058,7 +1058,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
for (UINT8 i = 0; i < ibbs_body->num_ibb_segments(); i++) {
const auto & current_segment = ibbs_body->ibb_segments()->at(i);
bpInfo += usprintf("Flags: %04Xh, Address: %08Xh, Size: %08Xh\n",
bpInfo += usprintf("Flags: 0x%04X, Address: 0x%08X, Size: 0x%08X\n",
current_segment->flags(),
current_segment->base(),
current_segment->size());
@ -1080,9 +1080,9 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const intel_acbp_v2_t::pmda_body_t* pmda_body = element->pmda_body();
// Valid Microsoft PMDA element found
bpInfo += usprintf("TotalSize: %04Xh\n"
"Version: %08Xh\n"
"NumEntries: %08Xh\n",
bpInfo += usprintf("TotalSize: 0x%04X\n"
"Version: 0x%08X\n"
"NumEntries: 0x%08X\n",
pmda_body->total_size(),
pmda_body->version(),
pmda_body->num_entries());
@ -1099,7 +1099,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
const char* entry_id_bytes = (const char*)&entry_id;
// Add element
bpInfo += usprintf("EntryId: '%c%c%c%c', Version: %04Xh, Address: %08Xh, Size: %08Xh\n",
bpInfo += usprintf("EntryId: '%c%c%c%c', Version: 0x%04X, Address: 0x%08X, Size: 0x%08X\n",
entry_id_bytes[0],
entry_id_bytes[1],
entry_id_bytes[2],
@ -1134,15 +1134,15 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
// Add Key Signature
const intel_acbp_v2_t::key_signature_t* key_signature = parsed.key_signature();
bpInfo += usprintf("Boot Policy Key Signature:\n"
"Version: %02Xh\n"
"KeyId: %04Xh\n"
"SigScheme: %04Xh\n",
"Version: 0x%02X\n"
"KeyId: 0x%04X\n"
"SigScheme: 0x%04X\n",
key_signature->version(),
key_signature->key_id(),
key_signature->sig_scheme());
// Add PubKey
bpInfo += usprintf("Boot Policy Public Key Exponent: %Xh\n", key_signature->public_key()->exponent());
bpInfo += usprintf("Boot Policy Public Key Exponent: 0x%X\n", key_signature->public_key()->exponent());
bpInfo += usprintf("Boot Policy Public Key:");
for (UINT16 i = 0; i < (UINT16)key_signature->public_key()->modulus().length(); i++) {
if (i % 32 == 0) bpInfo += UString("\n");

View file

@ -136,8 +136,8 @@ USTATUS MeParser::parseFptRegion(const UByteArray & region, const UModelIndex &
if (ptHeader->HeaderVersion == FPT_HEADER_VERSION_21) {
const FPT_HEADER_21* ptHeader21 = (const FPT_HEADER_21*)ptHeader;
info = usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nROM bypass vector: %s\nNumber of entries: %u\nHeader version: %02Xh\nEntry version: %02Xh\n"
"Header length: %02Xh\nFlags: %Xh\nTicks to add: %04Xh\nTokens to add: %04Xh\nSPS Flags: %Xh\nFITC version: %u.%u.%u.%u\nCRC32 Checksum: %08Xh",
info = usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nROM bypass vector: %s\nNumber of entries: %u\nHeader version: 0x%02X\nEntry version: 0x%02X\n"
"Header length: 0x%02X\nFlags: 0x%X\nTicks to add: 0x%04X\nTokens to add: 0x%04X\nSPS Flags: 0x%X\nFITC version: %u.%u.%u.%u\nCRC32 Checksum: 0x%08X",
ptSize, ptSize,
(UINT32)header.size(), (UINT32)header.size(),
ptBodySize, ptBodySize,
@ -156,8 +156,8 @@ USTATUS MeParser::parseFptRegion(const UByteArray & region, const UModelIndex &
}
// Default handling for all other versions, may be too generic in some corner cases
else {
info = usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nROM bypass vector: %s\nNumber of entries: %u\nHeader version: %02Xh\nEntry version: %02Xh\n"
"Header length: %02Xh\nFlash cycle life: %04Xh\nFlash cycle limit: %04Xh\nUMA size: %Xh\nFlags: %Xh\nFITC version: %u.%u.%u.%u\nChecksum: %02Xh",
info = usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nROM bypass vector: %s\nNumber of entries: %u\nHeader version: 0x%02X\nEntry version: 0x%02X\n"
"Header length: 0x%02X\nFlash cycle life: 0x%04X\nFlash cycle limit: 0x%04X\nUMA size: 0x%X\nFlags: 0x%X\nFITC version: %u.%u.%u.%u\nChecksum: 0x%02X",
ptSize, ptSize,
(UINT32)header.size(), (UINT32)header.size(),
ptBodySize, ptBodySize,
@ -189,7 +189,7 @@ USTATUS MeParser::parseFptRegion(const UByteArray & region, const UModelIndex &
// Get info
name = visibleAsciiOrHex((UINT8*)ptEntry->Name, 4);
info = usprintf("Full size: %Xh (%u)\nPartition offset: %Xh\nPartition length: %Xh\nPartition type: %02Xh",
info = usprintf("Full size: 0x%X (%u)\nPartition offset: 0x%X\nPartition length: 0x%X\nPartition type: 0x%02X",
(UINT32)sizeof(FPT_HEADER_ENTRY), (UINT32)sizeof(FPT_HEADER_ENTRY),
ptEntry->Offset,
ptEntry->Size,
@ -305,7 +305,7 @@ make_partition_table_consistent:
UModelIndex partitionIndex;
// Get info
name = visibleAsciiOrHex((UINT8*) partitions[i].ptEntry.Name, 4);
info = usprintf("Full size: %Xh (%u)\nPartition type: %02Xh\n",
info = usprintf("Full size: 0x%X (%u)\nPartition type: 0x%02X\n",
(UINT32)partition.size(), (UINT32)partition.size(),
partitions[i].ptEntry.Type);
@ -321,7 +321,7 @@ make_partition_table_consistent:
else if (partitions[i].type == Types::Padding) {
// Get info
name = UString("Padding");
info = usprintf("Full size: %Xh (%u)", (UINT32)partition.size(), (UINT32)partition.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)partition.size(), (UINT32)partition.size());
// Add tree item
model->addItem(partitions[i].ptEntry.Offset, Types::Padding, getPaddingType(partition), name, UString(), info, UByteArray(), partition, UByteArray(), Fixed, parent);
@ -346,14 +346,14 @@ USTATUS MeParser::parseIfwi16Region(const UByteArray & region, const UModelIndex
UByteArray header = region.left(ptSize);
UString name = UString("IFWI 1.6 header");
UString info = usprintf("Full size: %Xh (%u)\n"
"Data partition offset: %Xh\nData partition size: %Xh\n"
"Boot1 partition offset: %Xh\nBoot1 partition size: %Xh\n"
"Boot2 partition offset: %Xh\nBoot2 partition size: %Xh\n"
"Boot3 partition offset: %Xh\nBoot3 partition size: %Xh\n"
"Boot4 partition offset: %Xh\nBoot4 partition size: %Xh\n"
"Boot5 partition offset: %Xh\nBoot5 partition size: %Xh\n"
"Checksum: %" PRIX64 "h",
UString info = usprintf("Full size: 0x%X (%u)\n"
"Data partition offset: 0x%X\nData partition size: 0x%X\n"
"Boot1 partition offset: 0x%X\nBoot1 partition size: 0x%X\n"
"Boot2 partition offset: 0x%X\nBoot2 partition size: 0x%X\n"
"Boot3 partition offset: 0x%X\nBoot3 partition size: 0x%X\n"
"Boot4 partition offset: 0x%X\nBoot4 partition size: 0x%X\n"
"Boot5 partition offset: 0x%X\nBoot5 partition size: 0x%X\n"
"Checksum: 0x%" PRIX64,
(UINT32)header.size(), (UINT32)header.size(),
ifwiHeader->DataPartition.Offset, ifwiHeader->DataPartition.Size,
ifwiHeader->BootPartition[0].Offset, ifwiHeader->BootPartition[0].Size,
@ -471,7 +471,7 @@ make_partition_table_consistent:
}
// Get info
info = usprintf("Full size: %Xh (%u)\n", (UINT32)partition.size(), (UINT32)partition.size());
info = usprintf("Full size: 0x%X (%u)\n", (UINT32)partition.size(), (UINT32)partition.size());
// Add tree item
partitionIndex = model->addItem(partitions[i].ptEntry.Offset, partitions[i].type, partitions[i].subtype, name, UString(), info, UByteArray(), partition, UByteArray(), Fixed, parent);
@ -490,7 +490,7 @@ make_partition_table_consistent:
else if (partitions[i].type == Types::Padding) {
// Get info
name = UString("Padding");
info = usprintf("Full size: %Xh (%u)", (UINT32)partition.size(), (UINT32)partition.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)partition.size(), (UINT32)partition.size());
// Add tree item
model->addItem(partitions[i].ptEntry.Offset, Types::Padding, getPaddingType(partition), name, UString(), info, UByteArray(), partition, UByteArray(), Fixed, parent);
@ -516,17 +516,17 @@ USTATUS MeParser::parseIfwi17Region(const UByteArray & region, const UModelIndex
UByteArray header = region.left(ptSize);
UString name = UString("IFWI 1.7 header");
UString info = usprintf("Full size: %Xh (%u)\n"
"Flags: %02Xh\n"
"Reserved: %02Xh\n"
"Checksum: %Xh\n"
"Data partition offset: %Xh\nData partition size: %Xh\n"
"Boot1 partition offset: %Xh\nBoot1 partition size: %Xh\n"
"Boot2 partition offset: %Xh\nBoot2 partition size: %Xh\n"
"Boot3 partition offset: %Xh\nBoot3 partition size: %Xh\n"
"Boot4 partition offset: %Xh\nBoot4 partition size: %Xh\n"
"Boot5 partition offset: %Xh\nBoot5 partition size: %Xh\n"
"Temp page offset: %Xh\nTemp page size: %Xh\n",
UString info = usprintf("Full size: 0x%X (%u)\n"
"Flags: 0x%02X\n"
"Reserved: 0x%02X\n"
"Checksum: 0x%X\n"
"Data partition offset: 0x%X\nData partition size: 0x%X\n"
"Boot1 partition offset: 0x%X\nBoot1 partition size: 0x%X\n"
"Boot2 partition offset: 0x%X\nBoot2 partition size: 0x%X\n"
"Boot3 partition offset: 0x%X\nBoot3 partition size: 0x%X\n"
"Boot4 partition offset: 0x%X\nBoot4 partition size: 0x%X\n"
"Boot5 partition offset: 0x%X\nBoot5 partition size: 0x%X\n"
"Temp page offset: 0x%X\nTemp page size: 0x%X\n",
(UINT32)header.size(), (UINT32)header.size(),
ifwiHeader->Flags,
ifwiHeader->Reserved,
@ -659,7 +659,7 @@ make_partition_table_consistent:
}
// Get info
info = usprintf("Full size: %Xh (%u)\n", (UINT32)partition.size(), (UINT32)partition.size());
info = usprintf("Full size: 0x%X (%u)\n", (UINT32)partition.size(), (UINT32)partition.size());
// Add tree item
partitionIndex = model->addItem(partitions[i].ptEntry.Offset, partitions[i].type, partitions[i].subtype, name, UString(), info, UByteArray(), partition, UByteArray(), Fixed, parent);
@ -685,7 +685,7 @@ make_partition_table_consistent:
else if (partitions[i].type == Types::Padding) {
// Get info
name = UString("Padding");
info = usprintf("Full size: %Xh (%u)", (UINT32)partition.size(), (UINT32)partition.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)partition.size(), (UINT32)partition.size());
// Add tree item
model->addItem(partitions[i].ptEntry.Offset, Types::Padding, getPaddingType(partition), name, UString(), info, UByteArray(), partition, UByteArray(), Fixed, parent);

View file

@ -87,7 +87,7 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index)
UByteArray padding = nvar.mid(entry->offset(), unparsedSize);
// Get info
UString info = usprintf("Full size: %Xh (%u)", (UINT32)padding.size(), (UINT32)padding.size());
UString info = usprintf("Full size: 0x%X (%u)", (UINT32)padding.size(), (UINT32)padding.size());
if ((UINT32)padding.count(emptyByte) == unparsedSize) { // Free space
// Add tree item
@ -108,7 +108,7 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index)
UByteArray guidArea = nvar.right(guidAreaSize);
// Get info
name = UString("GUID store");
info = usprintf("Full size: %Xh (%u)\nGUIDs in store: %u",
info = usprintf("Full size: 0x%X (%u)\nGUIDs in store: %u",
(UINT32)guidArea.size(), (UINT32)guidArea.size(),
guidsInStore);
// Add tree item
@ -223,7 +223,7 @@ processing_done:
info += usprintf("GUID index: %u\n", entry_body->guid_index());
// Add header, body and extended data info
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nTail size: %Xh (%u)",
info += usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nTail size: 0x%X (%u)",
entry->size(), entry->size(),
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
@ -231,7 +231,7 @@ processing_done:
// Add attributes info
const NVAR_ENTRY_HEADER entryHeader = readUnaligned((NVAR_ENTRY_HEADER*)header.constData());
info += usprintf("\nAttributes: %02Xh", entryHeader.Attributes);
info += usprintf("\nAttributes: 0x%02X", entryHeader.Attributes);
// Translate attributes to text
if (entryHeader.Attributes != 0x00 && entryHeader.Attributes != 0xFF)
@ -239,15 +239,15 @@ processing_done:
// Add next node info
if (entry->next() != 0xFFFFFF)
info += usprintf("\nNext node at offset: %Xh", localOffset + entry->offset() + (UINT32)entry->next());
info += usprintf("\nNext node at offset: 0x%X", localOffset + entry->offset() + (UINT32)entry->next());
// Add extended header info
if (entry_body->extended_header_size() > 0) {
info += usprintf("\nExtended header size: %Xh (%u)",
info += usprintf("\nExtended header size: 0x%X (%u)",
entry_body->extended_header_size(), entry_body->extended_header_size());
const UINT8 extendedAttributes = *tail.constData();
info += usprintf("\nExtended attributes: %02Xh (", extendedAttributes) + nvarExtendedAttributesToUString(extendedAttributes) + UString(")");
info += usprintf("\nExtended attributes: 0x%02X (", extendedAttributes) + nvarExtendedAttributesToUString(extendedAttributes) + UString(")");
// Add checksum
if (!entry_body->_is_null_extended_header_checksum()) {
@ -266,13 +266,13 @@ processing_done:
}
// Include entry attributes
calculatedChecksum += entryHeader.Attributes;
info += usprintf("\nChecksum: %02Xh, ", entry_body->extended_header_checksum())
+ (calculatedChecksum ? usprintf(", invalid, should be %02Xh", 0x100 - calculatedChecksum) : UString(", valid"));
info += usprintf("\nChecksum: 0x%02X, ", entry_body->extended_header_checksum())
+ (calculatedChecksum ? usprintf(", invalid, should be 0x%02X", 0x100 - calculatedChecksum) : UString(", valid"));
}
// Add timestamp
if (!entry_body->_is_null_extended_header_timestamp())
info += usprintf("\nTimestamp: %" PRIX64 "h", entry_body->extended_header_timestamp());
info += usprintf("\nTimestamp: 0x%" PRIX64, entry_body->extended_header_timestamp());
// Add hash
if (!entry_body->_is_null_extended_header_hash()) {
@ -375,7 +375,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
// VSS store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
UString info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
UString info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -395,8 +395,8 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
name = UString("VSS store");
}
info = usprintf("Signature: %Xh (", parsed.signature()) + fourCC(parsed.signature()) + UString(")\n");
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nFormat: %02Xh\nState: %02Xh\nReserved: %02Xh\nReserved1: %04Xh",
info = usprintf("Signature: 0x%X (", parsed.signature()) + fourCC(parsed.signature()) + UString(")\n");
info += usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nFormat: 0x%02X\nState: 0x%02X\nReserved: 0x%02X\nReserved1: 0x%04X",
storeSize , storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
@ -419,7 +419,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
if (entryOffset < storeSize) {
UByteArray freeSpace = vss.mid(entryOffset, storeSize - entryOffset);
// Add info
info = usprintf("Full size: %Xh (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
// Check that remaining unparsed bytes are actually empty
if (freeSpace.count(emptyByte) == freeSpace.size()) { // Free space
@ -497,7 +497,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
+ (UINT32)(variable->attributes()->apple_data_checksum() << 31);
// Add generic info
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nState: %02Xh\nReserved: %02Xh\nAttributes: %08Xh (",
info += usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nState: 0x%02X\nReserved: 0x%02X\nAttributes: 0x%08X (",
variableSize, variableSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
@ -508,15 +508,15 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
// Add specific info
if (variable->is_auth()) {
UINT64 monotonicCounter = (UINT64)variable->len_name() + ((UINT64)variable->len_data() << 32);
info += usprintf("\nMonotonic counter: %" PRIX64 "h\nTimestamp: ", monotonicCounter) + efiTimeToUString(*(const EFI_TIME*)variable->timestamp().c_str())
info += usprintf("\nMonotonic counter: 0x%" PRIX64 "\nTimestamp: ", monotonicCounter) + efiTimeToUString(*(const EFI_TIME*)variable->timestamp().c_str())
+ usprintf("\nPubKey index: %u", variable->pubkey_index());
}
else if (!variable->_is_null_apple_data_crc32()) {
// Calculate CRC32 of the variable data
UINT32 calculatedCrc32 = (UINT32)crc32(0, (const UINT8*)body.constData(), (uInt)body.size());
info += usprintf("\nData checksum: %08Xh", variable->apple_data_crc32()) +
(variable->apple_data_crc32() != calculatedCrc32 ? usprintf(", invalid, should be %08Xh", calculatedCrc32) : UString(", valid"));
info += usprintf("\nData checksum: 0x%08X", variable->apple_data_crc32()) +
(variable->apple_data_crc32() != calculatedCrc32 ? usprintf(", invalid, should be 0x%08X", calculatedCrc32) : UString(", valid"));
}
// Add tree item
@ -578,7 +578,7 @@ not_vss:
// VSS2 store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -599,7 +599,7 @@ not_vss:
info = UString("Signature: DDCF3617-3275-4164-98B6-FE85707FFE7D\n");
}
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nFormat: %02Xh\nState: %02Xh\nReserved: %02Xh\nReserved1: %04Xh",
info += usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nFormat: 0x%02X\nState: 0x%02X\nReserved: 0x%02X\nReserved1: 0x%04X",
storeSize, storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
@ -622,7 +622,7 @@ not_vss:
if (entryOffset < storeSize) {
UByteArray freeSpace = vss2.mid(entryOffset, storeSize - entryOffset);
// Add info
info = usprintf("Full size: %Xh (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
// Check that remaining unparsed bytes are actually empty
if (freeSpace.count(emptyByte) == freeSpace.size()) { // Free space
@ -680,7 +680,7 @@ not_vss:
+ (UINT32)(variable->attributes()->reserved() << 7);
// Add generic info
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nState: %02Xh\nReserved: %02Xh\nAttributes: %08Xh (",
info += usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nState: 0x%02X\nReserved: 0x%02X\nAttributes: 0x%08X (",
variableSize, variableSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
@ -691,7 +691,7 @@ not_vss:
// Add specific info
if (variable->is_auth()) {
UINT64 monotonicCounter = (UINT64)variable->len_name() + ((UINT64)variable->len_data() << 32);
info += usprintf("\nMonotonic counter: %" PRIX64 "h\nTimestamp: ", monotonicCounter) + efiTimeToUString(*(const EFI_TIME*)variable->timestamp().c_str())
info += usprintf("\nMonotonic counter: 0x%" PRIX64 "\nTimestamp: ", monotonicCounter) + efiTimeToUString(*(const EFI_TIME*)variable->timestamp().c_str())
+ usprintf("\nPubKey index: %u", variable->pubkey_index());
}
@ -739,7 +739,7 @@ not_vss2:
}
else {
// No need to parse further, unknown FTW store size
msg(usprintf("%s: can not determine FTW store size for candidate at base %08Xh", __FUNCTION__, model->base(index) + localOffset + storeOffset), index);
msg(usprintf("%s: can not determine FTW store size for candidate at base 0x%08X", __FUNCTION__, model->base(index) + localOffset + storeOffset), index);
goto not_ftw;
}
storeSize = MIN(volumeBodySize - storeOffset, storeSize);
@ -777,7 +777,7 @@ not_vss2:
// FTW store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
UString info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
UString info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -788,12 +788,12 @@ not_vss2:
// Add info
name = UString("FTW store");
info = UString("Signature: ") + guidToUString(*(const EFI_GUID*)guid.constData(), false);
info += usprintf("\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nState: %02Xh\nHeader CRC32: %08Xh",
info += usprintf("\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nState: 0x%02X\nHeader CRC32: 0x%08X",
(UINT32)storeSize, (UINT32)storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
parsed.state(),
parsed.crc()) + (parsed.crc() != calculatedCrc ? usprintf(", invalid, should be %08Xh", calculatedCrc) : UString(", valid"));
parsed.crc()) + (parsed.crc() != calculatedCrc ? usprintf(", invalid, should be 0x%08X", calculatedCrc) : UString(", valid"));
// Add header tree item
model->addItem(localOffset + storeOffset, Types::FtwStore, 0, name, UString(), info, header, body, UByteArray(), Fixed, index);
@ -826,7 +826,7 @@ not_ftw:
// Insyde FDC store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
UString info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
UString info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -837,7 +837,7 @@ not_ftw:
// Add info
name = UString("Insyde FDC store");
info = usprintf("Signature: _FDC\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)",
info = usprintf("Signature: _FDC\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)",
storeSize, storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size());
@ -877,7 +877,7 @@ not_fdc:
// Apple SysF/Diag store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -898,13 +898,13 @@ not_fdc:
name = UString("Apple Diag store");
info = UString("Signature: Gaid\n");
}
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nUnknown: %02Xh\nUnknown1: %08Xh\nCRC32: %08Xh",
info += usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nUnknown: 0x%02X\nUnknown1: 0x%08X\nCRC32: 0x%08X",
storeSize, storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
parsed.unknown(),
parsed.unknown1(),
parsed.crc()) + (parsed.crc() != calculatedCrc ? usprintf(", invalid, should be %08Xh", calculatedCrc) : UString(", valid"));
parsed.crc()) + (parsed.crc() != calculatedCrc ? usprintf(", invalid, should be 0x%08X", calculatedCrc) : UString(", valid"));
// Add header tree item
UModelIndex headerIndex = model->addItem(localOffset + storeOffset, Types::SysFStore, 0, name, UString(), info, header, body, UByteArray(), Fixed, index);
@ -933,7 +933,7 @@ not_fdc:
}
// Add generic info
UINT32 variableSize = (UINT32)header.size() + (UINT32)body.size();
info = usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\n",
info = usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\n",
variableSize, variableSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size());
@ -948,7 +948,7 @@ not_fdc:
if (entryOffset < storeSize) {
UByteArray freeSpace = volumeBody.mid(storeOffset + entryOffset, storeSize - entryOffset);
// Add info
info = usprintf("Full size: %Xh (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
// Check that remaining unparsed bytes are actually zeroes
if (freeSpace.count('\x00') == freeSpace.size() - 4) { // Free space, 4 last bytes are always CRC32
@ -990,7 +990,7 @@ not_sysf:
// Phoenix FlashMap store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -1001,7 +1001,7 @@ not_sysf:
// Add info
name = UString("Phoenix SCT flash map");
info = usprintf("Signature: _FLASH_MAP\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nEntries: %u\nReserved: %08Xh",
info = usprintf("Signature: _FLASH_MAP\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nEntries: %u\nReserved: 0x%08X",
storeSize, storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
@ -1033,7 +1033,7 @@ not_sysf:
// Add info
UINT32 entrySize = (UINT32)header.size();
info = usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: 0h (0)\nData type: %04Xh\nEntry type: %04Xh\nSize: %08Xh\nOffset: %08Xh\nPhysical address: %" PRIX64 "h",
info = usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0h (0)\nData type: 0x%04X\nEntry type: 0x%04X\nSize: 0x%08X\nOffset: 0x%08X\nPhysical address: 0x%" PRIX64,
entrySize, entrySize,
(UINT32)header.size(), (UINT32)header.size(),
entry->data_type(),
@ -1078,7 +1078,7 @@ not_flm:
// Phoenix EVSA store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -1092,14 +1092,14 @@ not_flm:
// Add info
name = UString("Phoenix EVSA store");
info = usprintf("Signature: EVSA\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nAttributes: %08Xh\nReserved: %08Xh\nChecksum: %02Xh",
info = usprintf("Signature: EVSA\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nAttributes: 0x%08X\nReserved: 0x%08X\nChecksum: 0x%02X",
storeSize, storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
parsed.attributes(),
parsed.reserved(),
parsed.checksum())
+ (parsed.checksum() != calculated ? usprintf(", invalid, should be %02Xh", calculated) : UString(", valid"));
+ (parsed.checksum() != calculated ? usprintf(", invalid, should be 0x%02X", calculated) : UString(", valid"));
// Add header tree item
UModelIndex headerIndex = model->addItem(localOffset + storeOffset, Types::EvsaStore, 0, name, UString(), info, header, body, UByteArray(), Fixed, index);
@ -1118,7 +1118,7 @@ not_flm:
if (entryOffset < storeSize) {
UByteArray freeSpace = volumeBody.mid(storeOffset + entryOffset, storeSize - entryOffset);
// Add info
info = usprintf("Full size: %Xh (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)freeSpace.size(), (UINT32)freeSpace.size());
// Check that remaining unparsed bytes are actually empty
if (freeSpace.count(emptyByte) == freeSpace.size()) { // Free space
@ -1145,14 +1145,14 @@ not_flm:
EFI_GUID guid = *(const EFI_GUID*)(guidEntry->guid().c_str());
name = guidToUString(guid);
info = UString("GUID: ") + guidToUString(guid, false)
+ usprintf("\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nType: %02Xh\nChecksum: %02Xh",
+ usprintf("\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nType: 0x%02X\nChecksum: 0x%02X",
entrySize, entrySize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
entry->entry_type(),
entry->checksum())
+ (entry->checksum() != calculated ? usprintf(", invalid, should be %02Xh", calculated) : UString(", valid"))
+ usprintf("\nGuidId: %04Xh", guidEntry->guid_id());
+ (entry->checksum() != calculated ? usprintf(", invalid, should be 0x%02X", calculated) : UString(", valid"))
+ usprintf("\nGuidId: 0x%04X", guidEntry->guid_id());
subtype = Subtypes::GuidEvsaEntry;
guidMap.insert(std::pair<UINT16, EFI_GUID>(guidEntry->guid_id(), guid));
}
@ -1164,14 +1164,14 @@ not_flm:
entrySize = (UINT32)(header.size() + body.size());
name = uFromUcs2(body.constData());
info = UString("Name: ") + name
+ usprintf("\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nType: %02Xh\nChecksum: %02Xh",
+ usprintf("\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nType: 0x%02X\nChecksum: 0x%02X",
entrySize, entrySize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
entry->entry_type(),
entry->checksum())
+ (entry->checksum() != calculated ? usprintf(", invalid, should be %02Xh", calculated) : UString(", valid"))
+ usprintf("\nVarId: %04Xh", nameEntry->var_id());
+ (entry->checksum() != calculated ? usprintf(", invalid, should be 0x%02X", calculated) : UString(", valid"))
+ usprintf("\nVarId: 0x%04X", nameEntry->var_id());
subtype = Subtypes::NameEvsaEntry;
nameMap.insert(std::pair<UINT16, UString>(nameEntry->var_id(), name));
}
@ -1203,14 +1203,14 @@ not_flm:
+ (dataEntry->attributes()->extended_header() << 28)
+ (UINT32)(dataEntry->attributes()->reserved1() << 29);
info = usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nType: %02Xh\nChecksum: %02Xh",
info = usprintf("Full size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)\nType: 0x%02X\nChecksum: 0x%02X",
entrySize, entrySize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size(),
entry->entry_type(),
entry->checksum())
+ (entry->checksum() != calculated ? usprintf(", invalid, should be %02Xh", calculated) : UString(", valid"))
+ usprintf("\nVarId: %04Xh\nGuidId: %04Xh\nAttributes: %08Xh (",
+ (entry->checksum() != calculated ? usprintf(", invalid, should be 0x%02X", calculated) : UString(", valid"))
+ usprintf("\nVarId: 0x%04X\nGuidId: 0x%04X\nAttributes: 0x%08X (",
dataEntry->var_id(),
dataEntry->guid_id(),
attributes)
@ -1295,7 +1295,7 @@ not_flm:
// CMDB store at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -1306,7 +1306,7 @@ not_flm:
// Add info
name = UString("Phoenix CMDB store");
info = usprintf("Signature: CMDB\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)",
info = usprintf("Signature: CMDB\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0x%X (%u)",
storeSize, storeSize,
(UINT32)header.size(), (UINT32)header.size(),
(UINT32)body.size(), (UINT32)body.size());
@ -1344,7 +1344,7 @@ not_cmdb:
// SLIC PubKey at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -1354,8 +1354,8 @@ not_cmdb:
// Add info
name = UString("SLIC pubkey");
info = usprintf("Type: 0h\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: 0h (0)\n"
"Key type: %02Xh\nVersion: %02Xh\nAlgorithm: %08Xh\nMagic: RSA1\nBit length: %08Xh\nExponent: %08Xh",
info = usprintf("Type: 0h\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0h (0)\n"
"Key type: 0x%02X\nVersion: 0x%02X\nAlgorithm: 0x%08X\nMagic: RSA1\nBit length: 0x%08X\nExponent: 0x%08X",
parsed.len_pubkey(), parsed.len_pubkey(),
parsed.len_pubkey(), parsed.len_pubkey(),
parsed.key_type(),
@ -1404,7 +1404,7 @@ not_pubkey:
// SLIC marker at current offset parsed correctly
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -1414,8 +1414,8 @@ not_pubkey:
// Add info
name = UString("SLIC marker");
info = usprintf("Type: 1h\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: 0h (0)\n"
"Version: %08Xh\nOEM ID: %s\nOEM table ID: %s\nWindows flag: WINDOWS \nSLIC version: %08Xh",
info = usprintf("Type: 1h\nFull size: 0x%X (%u)\nHeader size: 0x%X (%u)\nBody size: 0h (0)\n"
"Version: 0x%08X\nOEM ID: %s\nOEM table ID: %s\nWindows flag: WINDOWS \nSLIC version: 0x%08X",
parsed.len_marker(), parsed.len_marker(),
parsed.len_marker(), parsed.len_marker(),
parsed.version(),
@ -1465,7 +1465,7 @@ not_marker:
// All checks passed, microcode found
// Check if we need to add a padding before it
if (!outerPadding.isEmpty()) {
info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
model->addItem(localOffset + previousStoreEndOffset, Types::Padding, getPaddingType(outerPadding), UString("Padding"), UString(), info, UByteArray(), outerPadding, UByteArray(), Fixed, index);
outerPadding.clear();
}
@ -1523,7 +1523,7 @@ not_ffs_volume:
// Add padding at the very end
if (!outerPadding.isEmpty()) {
// Add info
UString info = usprintf("Full size: %Xh (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
UString info = usprintf("Full size: 0x%X (%u)", (UINT32)outerPadding.size(), (UINT32)outerPadding.size());
// Check that remaining unparsed bytes are actually empty
if (outerPadding.count(emptyByte) == outerPadding.size()) {

View file

@ -31,5 +31,5 @@ UString machineTypeToUString(UINT16 machineType)
case EFI_IMAGE_FILE_MACHINE_RISCV64: return UString("RISC-V 64-bit");
case EFI_IMAGE_FILE_MACHINE_RISCV128: return UString("RISC-V 128-bit");
}
return usprintf("Unknown %04Xh", machineType);
return usprintf("Unknown 0x%04X", machineType);
}

View file

@ -36,7 +36,7 @@ UString regionTypeToUString(const UINT8 type)
case Subtypes::PttRegion: return UString("PTT");
};
return usprintf("Unknown %02Xh", type);
return usprintf("Unknown 0x%02X", type);
}
UString itemTypeToUString(const UINT8 type)
@ -87,7 +87,7 @@ UString itemTypeToUString(const UINT8 type)
case Types::StartupApDataEntry: return UString("Startup AP data");
}
return usprintf("Unknown %02Xh", type);
return usprintf("Unknown 0x%02X", type);
}
UString itemSubtypeToUString(const UINT8 type, const UINT8 subtype)
@ -199,7 +199,7 @@ UString compressionTypeToUString(const UINT8 algorithm)
case COMPRESSION_ALGORITHM_ZLIB: return UString("Zlib");
}
return usprintf("Unknown %02Xh", algorithm);
return usprintf("Unknown 0x%02X", algorithm);
}
UString actionTypeToUString(const UINT8 action)
@ -214,7 +214,7 @@ UString actionTypeToUString(const UINT8 action)
case Actions::Rebase: return UString("Rebase");
}
return usprintf("Unknown %02Xh", action);
return usprintf("Unknown 0x%02X", action);
}
UString fitEntryTypeToUString(const UINT8 type)
@ -244,7 +244,7 @@ UString fitEntryTypeToUString(const UINT8 type)
case INTEL_FIT_TYPE_EMPTY: return UString("Empty");
}
return usprintf("Unknown %02Xh", (type & 0x7F));
return usprintf("Unknown 0x%02X", (type & 0x7F));
}
UString hashTypeToUString(const UINT16 algorithm_id)
@ -258,7 +258,7 @@ UString hashTypeToUString(const UINT16 algorithm_id)
case TCG_HASH_ALGORITHM_ID_SM3: return UString("SM3");
}
return usprintf("Unknown %04Xh", algorithm_id);
return usprintf("Unknown 0x%04X", algorithm_id);
}
UString insydeFlashDeviceMapEntryTypeGuidToUString(const EFI_GUID & guid)