MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / PrintBytesRow

Function PrintBytesRow

rEFIt_UEFI/Platform/BootLog.cpp:20–47  ·  view source on GitHub ↗

Prints Number of bytes in a row (hex and ascii). Row size is MaxNumber. */

Source from the content-addressed store, hash-verified

18
19/** Prints Number of bytes in a row (hex and ascii). Row size is MaxNumber. */
20VOID
21PrintBytesRow(IN UINT8 *Bytes, IN UINTN Number, IN UINTN MaxNumber)
22{
23 UINTN Index;
24
25 // print hex vals
26 for (Index = 0; Index < Number; Index++) {
27 DebugLog(1, "%02hhX ", Bytes[Index]);
28 }
29
30 // pad to MaxNumber if needed
31 for (; Index < MaxNumber; Index++) {
32 DebugLog(1, " ");
33 }
34
35 DebugLog(1, "| ");
36
37 // print ASCII
38 for (Index = 0; Index < Number; Index++) {
39 if (Bytes[Index] >= 0x20 && Bytes[Index] <= 0x7e) {
40 DebugLog(1, "%c", (CHAR16)Bytes[Index]);
41 } else {
42 DebugLog(1, "%c", L'.');
43 }
44 }
45
46 DebugLog(1, "\n");
47}
48
49/** Prints series of bytes. */
50VOID

Callers 1

PrintBytesFunction · 0.70

Calls 1

DebugLogFunction · 0.70

Tested by

no test coverage detected