Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider reintroducing remote call API #240

Open
rdbo opened this issue Jun 19, 2024 · 0 comments
Open

Consider reintroducing remote call API #240

rdbo opened this issue Jun 19, 2024 · 0 comments

Comments

@rdbo
Copy link
Owner

rdbo commented Jun 19, 2024

Although complex, a remote call API could be possible if done like this:

enum {
    LM_REG_RAX = 0,
    ...
    LM_REG_MAX
};

enum {
    LM_FPREG_XMM0 = 0,
    ...
    LM_FPREG_MAX
}

struct lm_callstate_t {
    lm_byte_t stack[0xFF];
    lm_uintptr_t regs[32]; // arch-dependent, accessed by LM_REG_*
    double fpregs[16]; // arch-dependent, may not be available on some archs, accessed by LM_FPREG_*
}

lm_bool_t
LM_RemoteCall(lm_process_t *process, lm_callstate_t *setup, lm_callstate_t *post_call);

It will setup the call using the call state, and then write the post-call state into an optional variable
On Linux/FreeBSD, this is """easily""" achievable with ptrace; on Windows, not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant