Skip to content

TCP_TUNNEL - Hypercall and Guest side software #105

@jeppojeps

Description

@jeppojeps

I have prepared a "working" patch based on the alephresearch project https://github.com/jeppojeps/qemu-ios/tree/tcp_tunnel, I have added a register to the architecture and recycled the entire functionality.
"Working" for now means the QEMU patch compiles fine and the emulator keeps running as before. I still need to test the guest side.
I am finishing up the compilation of the binary guest side that should be adapted to make the correct ASM call.

i.e. in ARM 64 https://github.com/alephsecurity/xnu-qemu-arm64-tools/blob/master/tcp-tunnel/src/qemu-guest-services/general.c

we should recompile with iOS 4.2 SDK with something like

#include "hw/arm/guest-services/general.h"

int32_t guest_svcs_errno = 0;

void qemu_call(qemu_call_t *qcall)
{
    // Load the address of the QEMU_CALL register into r0
    asm volatile ("ldr r0, %[addr]"::[addr] "m" (qcall));

    // Perform the MSR instruction to write to the QEMU_CALL register
    asm volatile (
        "msr c15, 0, r0, c15, c15, 0\n\t"
        "isb"
    );

}

While I revamp my 2006 Mac Mini if someone wants to take a look. @devos50 if you want me to make a PR to a specific branch LMK, until it is working e2e I would not make any PR.

This software along with the patched emulator would allow to tunnel host-guest ports to any program in the guest i.e. bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions