⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 system.cpp

📁 MONA是为数不多的C++语言编写的一个很小的操作系统
💻 CPP
字号:
#include <monapi.h>#include <monapi/messages.h>namespace MonAPI{    static PsInfo psInfo;    static char bundlePath[128];    PsInfo* System::getProcessInfo()    {        dword tid = getThreadID();        syscall_set_ps_dump();        while (syscall_read_ps_dump(&psInfo) == 0)        {            if (psInfo.tid == tid) break;        }        return &psInfo;    }    dword System::getParentThreadID()    {        MessageInfo msg;        if (Message::sendReceive(&msg, monapi_get_server_thread_id(ID_PROCESS_SERVER), MSG_PROCESS_GET_PROCESS_INFO) != 0)        {            return NULL;        }        return msg.arg2;    }    const char* System::getProcessPath()    {        MessageInfo msg;        if (Message::sendReceive(&msg, monapi_get_server_thread_id(ID_PROCESS_SERVER), MSG_PROCESS_GET_PROCESS_INFO) != 0)        {            return NULL;        }        return msg.str;    }    const char* System::getBundlePath()    {        const char* path = getProcessPath();        char* app = strstr(path, ".APP/");        if (app == NULL) return NULL;        int len = app - path + 4;        strncpy(bundlePath, path, len);        bundlePath[len] = '\0';        return bundlePath;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -