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

Function CompareMemMask

rEFIt_UEFI/Platform/kext_patcher.cpp:95–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95BOOLEAN CompareMemMask(const UINT8 *Source, const UINT8 *Search, UINTN SearchSize, const UINT8 *Mask, UINTN MaskSize)
96{
97 UINT8 M;
98
99 if (!Mask || MaskSize == 0) {
100 return !CompareMem(Source, Search, SearchSize);
101 }
102 for (UINTN Ind = 0; Ind < SearchSize; Ind++) {
103 if (Ind < MaskSize)
104 M = *Mask++;
105 else M = 0xFF;
106 if ((*Source++ & M) != (*Search++ & M)) {
107 return FALSE;
108 }
109 }
110 return TRUE;
111}
112
113VOID CopyMemMask(UINT8 *Dest, const UINT8 *Replace, const UINT8 *Mask, UINTN SearchSize)
114{

Callers 5

KernelUserPatchMethod · 0.85
BooterPatchMethod · 0.85
FindMemMaskFunction · 0.85
SearchAndReplaceMaskFunction · 0.85
AnyKextPatchMethod · 0.85

Calls 1

CompareMemFunction · 0.50

Tested by

no test coverage detected