This commit is contained in:
Samuel Tulach
2020-04-14 17:19:30 +02:00
parent f3f069cb22
commit e50e79673d
4 changed files with 18 additions and 10 deletions

View File

@@ -29,13 +29,13 @@ typedef struct _DummyProtocalData{
} DummyProtocalData; } DummyProtocalData;
// Pointers to original functions // Pointers to original functions
EFI_SET_VARIABLE oSetVariable = NULL; static EFI_SET_VARIABLE oSetVariable = NULL;
// Global declarations // Global declarations
EFI_EVENT NotifyEvent = NULL; static EFI_EVENT NotifyEvent = NULL;
EFI_EVENT ExitEvent = NULL; static EFI_EVENT ExitEvent = NULL;
BOOLEAN Virtual = FALSE; static BOOLEAN Virtual = FALSE;
BOOLEAN Runtime = FALSE; static BOOLEAN Runtime = FALSE;
// Defines used to check if call is really coming from client // Defines used to check if call is really coming from client
#define VARIABLE_NAME L"yromeMifE" // EfiMemory #define VARIABLE_NAME L"yromeMifE" // EfiMemory
@@ -95,6 +95,9 @@ HookedSetVariable(
// Check if GUID is correct // Check if GUID is correct
if (CompareGuid(VendorGuid, &VariableGuid)) if (CompareGuid(VendorGuid, &VariableGuid))
{ {
// Testing (instant bsoder 2000)
RT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
// Check if variable name is same as our declared one // Check if variable name is same as our declared one
// this is used to check if call is really from our program // this is used to check if call is really from our program
// running in the OS (client) // running in the OS (client)
@@ -131,6 +134,12 @@ SetVirtualAddressMapEvent(
IN VOID* Context IN VOID* Context
) )
{ {
// Convert orignal SetVariable address
RT->ConvertPointer(0, &oSetVariable);
// Convert runtime services pointer
RtLibEnableVirtualMappings();
// Null and close the event so it does not get called again // Null and close the event so it does not get called again
NotifyEvent = NULL; NotifyEvent = NULL;
@@ -195,8 +204,7 @@ SetServicePointer(
// Restore task priority level // Restore task priority level
BS->RestoreTPL(Tpl); BS->RestoreTPL(Tpl);
//return OriginalFunction; return OriginalFunction;
return 0;
} }
// EFI driver unload routine // EFI driver unload routine

Binary file not shown.

Binary file not shown.

Binary file not shown.