mirror of
https://github.com/Whispergate/JanusLoader
synced 2026-07-22 11:23:12 +00:00
22 lines
763 B
C++
22 lines
763 B
C++
#pragma once
|
|
#include <cstdint>
|
|
|
|
// ECALL numbers (payload convention — a7 register)
|
|
enum JanusEcall : uint64_t {
|
|
ECALL_GET_PEB = 0, // () -> void* peb
|
|
ECALL_HOST_CALL = 1, // (void* fn, uintptr_t* args, int argc) -> uintptr_t
|
|
ECALL_RESOLVE = 2, // (char* mod, char* sym) -> void*
|
|
ECALL_EXIT = 3, // (int code) -> noreturn
|
|
};
|
|
|
|
// Swap this struct to retarget the VM (different OS, sandbox environment, etc.)
|
|
struct SyscallTable {
|
|
void* (*get_peb)();
|
|
uintptr_t (*host_call)(void* fn, uintptr_t* args, int argc);
|
|
void* (*resolve)(const char* mod, const char* sym);
|
|
void (*exit_fn)(int code);
|
|
};
|
|
|
|
// Default Windows implementation (defined in src/syscall/table.cpp)
|
|
extern SyscallTable g_win_syscalls;
|