Update dlp client region free

Allows all dlp versions to have region free by patching necessary instruction after locating it with pattern.
This commit is contained in:
Pixel-Pop 2020-07-18 15:25:53 -07:00 committed by GitHub
parent 67ad6d425a
commit a7ce156f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -818,7 +818,10 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size, u32 textSize, u32 ro
};
static const u8 pattern2[] = {
0xBB, 0xD1
0x20, 0x82, 0xa8, 0x7e, 0x00, 0x28, 0x00, 0xd0, 0x01, 0x20, 0xa0, 0x77
},
pattern3[] = {
0x42
},
patch2[] = {
0xC0, 0x46 // mov r8, r8
@ -833,9 +836,11 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size, u32 textSize, u32 ro
)) goto error;
// Patch DLP client region check
if (!patchMemory(code, textSize,
pattern2,
sizeof(pattern2), 0,
u8 *found = memsearch(code, pattern2, textSize, sizeof(pattern2));
if (!patchMemory(found, textSize,
pattern3,
sizeof(pattern3), 1,
patch2,
sizeof(patch2), 1
)) goto error;