16 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *
ConOut;
21 #define OPTION_FORCE_EXIT 0 // user requested to exit
22 #define OPTION_CONTINUE 1 // draw the menu one more time
23 #define OPTION_STAY_RESIDENT 2 // request residency
32 Status = gST->ConIn->ReadKeyStroke(gST->ConIn, &Key);
33 if (Status == EFI_NOT_READY)
35 gBS->WaitForEvent(1, &gST->ConIn->WaitForKey, &junk);
36 gST->ConIn->ReadKeyStroke(gST->ConIn, &Key);
39 return (CHAR8)Key.UnicodeChar;
47 #define BOX_SZEROKOSC 50
49 ConOut->SetAttribute (
ConOut, EFI_BACKGROUND_RED | EFI_BRIGHT | EFI_WHITE );
52 AsciiPrint(
"%c", BOXDRAW_DOWN_RIGHT_DOUBLE);
54 AsciiPrint(
"%c", BOXDRAW_DOUBLE_HORIZONTAL);
55 AsciiPrint(
"%c\r\n", BOXDRAW_DOWN_LEFT_DOUBLE );
57 AsciiPrint(
"%c RDFU ver 1.0 ready %c\r\n", BOXDRAW_VERTICAL_HORIZONTAL, BOXDRAW_VERTICAL_HORIZONTAL );
59 AsciiPrint(
"%c", BOXDRAW_UP_RIGHT_DOUBLE);
60 for (i = 0; i < BOX_SZEROKOSC; i++)
61 AsciiPrint(
"%c", BOXDRAW_DOUBLE_HORIZONTAL);
62 AsciiPrint(
"%c\r\n", BOXDRAW_UP_LEFT_DOUBLE );
87 ConOut->SetAttribute (
ConOut, EFI_BACKGROUND_BLACK | EFI_BRIGHT | EFI_WHITE );
88 AsciiPrint(
"\r\n\r\n");
91 AsciiPrint(
"Menu: \r\n\r\n");
92 AsciiPrint(
"[0] - List all handles\r\n");
93 AsciiPrint(
"[1] - List all images\r\n");
94 AsciiPrint(
"[2] - Dump all images to disk\r\n");
95 AsciiPrint(
"[3] - Check BootServices/RuntimeServices/SystemTable pointers in images\r\n");
96 AsciiPrint(
"[4] - Install image sniffer (SniffImage, requires residency)\r\n");
97 AsciiPrint(
"[5] - List all events\r\n");
98 AsciiPrint(
"[6] - Install event scanner (requires residency)\r\n");
99 AsciiPrint(
"[7] - Scan memory for PE images (bruteforce) and dump them to disk\r\n");
100 AsciiPrint(
"[8] - Display memory map\r\n");
101 AsciiPrint(
"[9] - Display and dump memory map\r\n");
102 AsciiPrint(
"[A] - Display and dump memory map (skip Reserved and MemoryMappedIO mem)\r\n");
103 AsciiPrint(
"[B] - Display EFI services\r\n");
104 AsciiPrint(
"[C] - Install EFI services scanner (requires residency)\r\n");
105 AsciiPrint(
"[D] - Display IDT\r\n");
106 AsciiPrint(
"[E] - Display GDT\r\n");
107 AsciiPrint(
"[F] - Display Context\r\n");
108 AsciiPrint(
"[G] - Dump firmware from ROM\r\n");
109 AsciiPrint(
"[H] - Install all resident scanners\r\n");
110 AsciiPrint(
"[I] - Run COM console\r\n");
111 AsciiPrint(
"[Q] - Quit\r\n");
123 AsciiPrint(
"Error: GetAllHandlesWithDescription return 0\r\n");
137 AsciiPrint(
"Error: GetAllImagesWithDescription returned 0\r\n");
151 AsciiPrint(
"Error: GetAllImagesWithDescription returned 0\r\n");
165 AsciiPrint(
"Error: GetAllImagesWithDescription returned 0\r\n");
187 AsciiPrint(
"Error: GetAllEvents() returned 0\r\n");
212 AsciiPrint(
"Error: GetMemoryMapList() returned 0\r\n");
227 AsciiPrint(
"Error: GetMemoryMapList() returned 0\r\n");
244 AsciiPrint(
"Error: GetMemoryMapList() returned 0\r\n");
318 AsciiPrint(
"Quiting.\r\n");