VirtualBox

Ignore:
Timestamp:
Aug 19, 2024 1:27:44 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164428
Message:

Disassembler,VMM,HostDrivers,Debugger,MakeAlternativeSource: Convert DISSTATE::Param1,...,DISSTATE::Param4 to DISSTATE::aParams[4] for easier indexing, bugref:10394

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp

    r101541 r105724  
    251251
    252252    /* Extract start address. */
    253     pbSym = (pbSym + cbInstr + Dis.Param1.x86.uDisp.i32);
     253    pbSym = (pbSym + cbInstr + Dis.aParams[0].x86.uDisp.i32);
    254254    pbSym = (uint8_t *)*((uintptr_t *)pbSym);
    255255# else
     
    423423        {
    424424            /* Deduce destination register and write out new instruction. */
    425             if (RT_UNLIKELY(!(   (Dis.Param1.fUse & (DISUSE_BASE | DISUSE_REG_GEN64))
    426                               && (Dis.Param2.fUse & DISUSE_RIPDISPLACEMENT32))))
     425            if (RT_UNLIKELY(!(   (Dis.aParams[0].fUse & (DISUSE_BASE | DISUSE_REG_GEN64))
     426                              && (Dis.aParams[1].fUse & DISUSE_RIPDISPLACEMENT32))))
    427427                return VERR_SUPLIB_UNEXPECTED_INSTRUCTION;
    428428
    429             uintptr_t uAddr = (uintptr_t)&pbTarget[offInsn + cbInstr] + (intptr_t)Dis.Param2.x86.uDisp.i32;
     429            uintptr_t uAddr = (uintptr_t)&pbTarget[offInsn + cbInstr] + (intptr_t)Dis.aParams[1].x86.uDisp.i32;
    430430
    431431            if (fConvRipRelMovs)
     
    437437
    438438                *pbPatchMem++ = 0x48;
    439                 *pbPatchMem++ = 0xb8 + Dis.Param1.x86.Base.idxGenReg;
     439                *pbPatchMem++ = 0xb8 + Dis.aParams[0].x86.Base.idxGenReg;
    440440                *(uintptr_t *)pbPatchMem = uAddr;
    441441                pbPatchMem   += sizeof(uintptr_t);
     
    443443                *pbPatchMem++ = 0x48;
    444444                *pbPatchMem++ = 0x8b;
    445                 *pbPatchMem++ = (Dis.Param1.x86.Base.idxGenReg << X86_MODRM_REG_SHIFT) | Dis.Param1.x86.Base.idxGenReg;
     445                *pbPatchMem++ = (Dis.aParams[0].x86.Base.idxGenReg << X86_MODRM_REG_SHIFT) | Dis.aParams[0].x86.Base.idxGenReg;
    446446            }
    447447            else
     
    453453                *pbPatchMem++ = 0x48;
    454454                *pbPatchMem++ = 0x8b;
    455                 *pbPatchMem++ = (Dis.Param1.x86.Base.idxGenReg << X86_MODRM_REG_SHIFT) | 5;
     455                *pbPatchMem++ = (Dis.aParams[0].x86.Base.idxGenReg << X86_MODRM_REG_SHIFT) | 5;
    456456                *(int32_t *)pbPatchMem = (int32_t)iDispNew;
    457457                pbPatchMem   += sizeof(int32_t);
     
    462462        {
    463463            /* Convert to absolute jump. */
    464             uintptr_t uAddr = (uintptr_t)&pbTarget[offInsn + cbInstr] + (intptr_t)Dis.Param1.uValue;
     464            uintptr_t uAddr = (uintptr_t)&pbTarget[offInsn + cbInstr] + (intptr_t)Dis.aParams[0].uValue;
    465465
    466466            /* Skip the push instructions till the return address is known. */
     
    575575
    576576            /* jmp rel32 to the call target */
    577             uintptr_t const uAddr      = uAddrReturn + (int32_t)Dis.Param1.uValue;
     577            uintptr_t const uAddr      = uAddrReturn + (int32_t)Dis.aParams[0].uValue;
    578578            int32_t   const i32DispNew = uAddr - (uintptr_t)&pbPatchMem[5];
    579579
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette