Changeset 99220 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Mar 30, 2023 12:40:46 PM (20 months ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp
r98103 r99220 360 360 || ( Dis.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW 361 361 && Dis.pCurInstr->uOpcode != OP_CALL) 362 || ( Dis. ModRM.Bits.Mod == 0363 && Dis. ModRM.Bits.Rm == 5 /* wrt RIP */362 || ( Dis.arch.x86.ModRM.Bits.Mod == 0 363 && Dis.arch.x86.ModRM.Bits.Rm == 5 /* wrt RIP */ 364 364 && Dis.pCurInstr->uOpcode != OP_MOV)) 365 365 return VERR_SUPLIB_UNEXPECTED_INSTRUCTION; 366 366 367 if (Dis. ModRM.Bits.Mod == 0 && Dis.ModRM.Bits.Rm == 5 /* wrt RIP */)367 if (Dis.arch.x86.ModRM.Bits.Mod == 0 && Dis.ModRM.Bits.Rm == 5 /* wrt RIP */) 368 368 cRipRelMovs++; 369 369 if ( Dis.pCurInstr->uOpcode == OP_CALL … … 418 418 return VERR_SUPLIB_UNEXPECTED_INSTRUCTION; 419 419 420 if ( Dis. ModRM.Bits.Mod == 0421 && Dis. ModRM.Bits.Rm == 5 /* wrt RIP */420 if ( Dis.arch.x86.ModRM.Bits.Mod == 0 421 && Dis.arch.x86.ModRM.Bits.Rm == 5 /* wrt RIP */ 422 422 && Dis.pCurInstr->uOpcode == OP_MOV) 423 423 { … … 437 437 438 438 *pbPatchMem++ = 0x48; 439 *pbPatchMem++ = 0xb8 + Dis.Param1. Base.idxGenReg;439 *pbPatchMem++ = 0xb8 + Dis.Param1.arch.x86.Base.idxGenReg; 440 440 *(uintptr_t *)pbPatchMem = uAddr; 441 441 pbPatchMem += sizeof(uintptr_t); … … 443 443 *pbPatchMem++ = 0x48; 444 444 *pbPatchMem++ = 0x8b; 445 *pbPatchMem++ = (Dis.Param1.Base. idxGenReg << X86_MODRM_REG_SHIFT) | Dis.Param1.Base.idxGenReg;445 *pbPatchMem++ = (Dis.Param1.Base.arch.x86.idxGenReg << X86_MODRM_REG_SHIFT) | Dis.Param1.Base.arch.x86.idxGenReg; 446 446 } 447 447 else … … 453 453 *pbPatchMem++ = 0x48; 454 454 *pbPatchMem++ = 0x8b; 455 *pbPatchMem++ = (Dis.Param1. Base.idxGenReg << X86_MODRM_REG_SHIFT) | 5;455 *pbPatchMem++ = (Dis.Param1.arch.x86.Base.idxGenReg << X86_MODRM_REG_SHIFT) | 5; 456 456 *(int32_t *)pbPatchMem = (int32_t)iDispNew; 457 457 pbPatchMem += sizeof(int32_t); -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r98103 r99220 3077 3077 if ( RT_FAILURE(rc) 3078 3078 || (Dis.pCurInstr->fOpType & (DISOPTYPE_CONTROLFLOW)) 3079 || (Dis. ModRM.Bits.Mod == 0 && Dis.ModRM.Bits.Rm == 5 /* wrt RIP */) )3079 || (Dis.arch.x86.ModRM.Bits.Mod == 0 && Dis.arch.x86.ModRM.Bits.Rm == 5 /* wrt RIP */) ) 3080 3080 supR3HardenedWinHookFailed("LdrLoadDll", pbLdrLoadDll); 3081 3081 offJmpBack += cbInstr; … … 3164 3164 if ( RT_FAILURE(rc) 3165 3165 || (Dis.pCurInstr->fOpType & (DISOPTYPE_CONTROLFLOW)) 3166 || (Dis. ModRM.Bits.Mod == 0 && Dis.ModRM.Bits.Rm == 5 /* wrt RIP */) )3166 || (Dis.arch.x86.ModRM.Bits.Mod == 0 && Dis.arch.x86.ModRM.Bits.Rm == 5 /* wrt RIP */) ) 3167 3167 supR3HardenedWinHookFailed("KiUserApcDispatcher", pbKiUserApcDispatcher); 3168 3168 offJmpBack += cbInstr;
Note:
See TracChangeset
for help on using the changeset viewer.