I've tried enumerating the UEFI startup entries with the following code:
Code: Select all
EnableExplicit
Structure BootOrder Align #PB_Structure_AlignC
BootOrderList.w[128]
EndStructure
Structure _EFI_LOAD_OPTION Align #PB_Structure_AlignC
Attributes.l
FilePathListLength.w
Description.u[256]
EndStructure
Prototype.l ProtoGetFirmwareEnvironmentVariableEx(Name.p-unicode, GUID.p-unicode, Buffer.l, Size.l, Attrib.l)
Define BootOrder.BootOrder
Define EFILoadOption._EFI_LOAD_OPTION
Define GetFirmwareEnvironmentVariableEx.ProtoGetFirmwareEnvironmentVariableEx
Define Attrib.l
Define BootOrderSize.i
Define tmp.b
Define i.i
Define BootSequence$
If OpenLibrary(0, "Kernel32.dll")
GetFirmwareEnvironmentVariableEx = GetFunction(0, "GetFirmwareEnvironmentVariableExW")
EndIf
RtlAdjustPrivilege_(22, 1, 0, @tmp)
BootOrderSize = GetFirmwareEnvironmentVariableEx("BootOrder", "{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}", @BootOrder, SizeOf(BootOrder), @Attrib)
If BootOrderSize
For i = 0 To BootOrderSize/SizeOf(word)-1
BootSequence$ = "Boot" + RSet(Hex(BootOrder\BootOrderList[i], #PB_Long), 4, "0")
GetFirmwareEnvironmentVariableEx(BootSequence$, "{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}", @EFILoadOption, SizeOf(EFILoadOption), @Attrib)
Debug BootSequence$ + ": " + PeekS(@EFILoadOption\Description)
Next
EndIf
RtlAdjustPrivilege_(22, 0, 0, @tmp)