VirtualBox

Changeset 106897 in vbox for trunk


Ignore:
Timestamp:
Nov 8, 2024 5:00:52 PM (3 months ago)
Author:
vboxsync
Message:

SUPHardNt: Rough and untested port of the C code to win.arm64 so the extpack builds [SCM fix]. VBP-1447

File:
1 edited

Legend:

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

    r106893 r106897  
    31393139#elif defined(RT_ARCH_ARM64)
    31403140    /*
    3141      * Patch 64-bit ARM hosts. 
     3141     * Patch 64-bit ARM hosts.
    31423142     * We can make this work, provided the target address doesn't use bits 63:48.
    31433143     */
     
    32613261#elif defined(RT_ARCH_ARM64)
    32623262    /*
    3263      * Patch 64-bit ARM hosts. 
    3264      * 
    3265      * Note! Blindly ASSUMES that the code is at least 20 bytes long, that x17 
     3263     * Patch 64-bit ARM hosts.
     3264     *
     3265     * Note! Blindly ASSUMES that the code is at least 20 bytes long, that x17
    32663266     *       isn't being used, and that there are no branch instructions.
    32673267     *       So, far we've only seen the typical long STP sequence.
     
    34043404     *       In the code we've been looking at, the 4th instruction is a CBZ,
    34053405     *       which means we can only use 16 bytes here to do the patching.
    3406      * 
     3406     *
    34073407     * w10-1709:
    34083408     *      1800243a0: f94003ef     ldr     x15, [sp]                   ; The APC routine address.
     
    35713571     *     1800244b0: 94011b76     bl      0x18006b288 <RtlQueryEnvironmentVariable+0x21d8>
    35723572     *     1800244b4: b40000a0     cbz     x0, 0x1800244c8 <KiUserExceptionDispatcher+0x38>
    3573      * 
     3573     *
    35743574     * What is loaded and checked at the beginning is a function poitner caller
    35753575     * Wow64PrepareForException, which we can presume is NULL for a native
    35763576     * arm64 process.
    3577      * 
     3577     *
    35783578     * The easiest thing to do would be to hijack the pointer. Unfortunately
    35793579     * that differs too much from the others architectures, as the patching
Note: See TracChangeset for help on using the changeset viewer.

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