Re: Is there a way to include a custom binary in EDK2 and load it in a UEFI driver?


Guomin Jiang
 

I am busy recently and won't spend time on the thread until July.

I suggest that you can search the source code and figure out how to use ReadFile() function, I think it is better that use ReadSection service to get the file content.

Best Regards
Guomin

-----Original Message-----
From: Laszlo Ersek <lersek@redhat.com>
Sent: Tuesday, May 5, 2020 11:45 PM
To: discuss@edk2.groups.io; mzktsn@gmail.com; Jiang, Guomin
<guomin.jiang@intel.com>
Subject: Re: [edk2-discuss] Is there a way to include a custom binary in EDK2
and load it in a UEFI driver?

On 04/30/20 19:02, mzktsn@gmail.com wrote:
Hello!

I have managed to insert a custom file into the Firmware Volume, but
then attempting to retrieve the original contents from a DXE_DRIVER,
only the first 4 bytes of the file are returned correct.

Used ReadFile() from EFI_FIRMWARE_VOLUME2_PROTOCOL succesfully
retrieves the 4 first bytes and the rest are modified.
The file size of the Buffer returned is correct by the way.

Am i missing something in the way to retrieve the file contents? Or
there is some processing that may alter the contents without noticing it?
I probably won't have much time to spend on this thread, but I'd suggest
posting a minimal / self-contained reproducer, complete with DSC / FDF / INF
file(s).

Independently, some of the functions in
"MdePkg/Include/Library/DxeServicesLib.h" might prove useful.

Laszlo

Join discuss@edk2.groups.io to automatically receive all group messages.