VirtualBox

vbox的更動 66799 路徑 trunk/src/VBox/HostDrivers


忽略:
時間撮記:
2017-5-4 下午07:03:27 (8 年 以前)
作者:
vboxsync
訊息:

Support: Save and restore the content of rax because it clobbered when converting relative calls

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp

    r66794 r66799  
    369369
    370370    /*
    371      * Each relative call requires 7 extra bytes as it is converted to an absolute one
    372      * using two instructions (mov raw, qword + call rax). */
    373     cbPatchMem += cRelCalls * 7;
     371     * Each relative call requires 9 extra bytes as it is converted to an absolute one
     372     * using two instructions (push rax + mov rax, qword + call rax + pop rax). */
     373    cbPatchMem += cRelCalls * 9;
    374374    cbPatchMem += 14; /* jmp qword [$+8 wrt RIP] + 8 byte address to jump to. */
    375375    cbPatchMem = RT_ALIGN_32(cbPatchMem, 8);
     
    456456            uintptr_t uAddr = (uintptr_t)&pbTarget[offInsn + cbInstr] + (intptr_t)Dis.Param1.uValue;
    457457
    458             *pbPatchMem++ = 0x48;
     458            *pbPatchMem++ = 0x50; /* push rax */
     459            *pbPatchMem++ = 0x48; /* mov rax, qword */
    459460            *pbPatchMem++ = 0xb8;
    460461            *(uint64_t *)pbPatchMem = uAddr;
     
    463464            *pbPatchMem++ = 0xff; /* call rax */
    464465            *pbPatchMem++ = 0xd0;
     466            *pbPatchMem++ = 0x58; /* pop rax */
    465467        }
    466468        else
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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