📄 flask_op.c
字号:
/* * * Authors: Michael LeMay, <mdlemay@epoch.ncsc.mil> * George Coker, <gscoker@alpha.ncsc.mil> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. */#include <unistd.h>#include <stdio.h>#include <errno.h>#include <fcntl.h>#include <string.h>#include <sys/mman.h>#include <sys/types.h>#include <sys/stat.h>#include <stdlib.h>#include <stdint.h>#include <sys/ioctl.h>#include <flask.h>#include <xenctrl.h>int flask_load(int xc_handle, char *buf, uint32_t size){ int err; flask_op_t op; op.cmd = FLASK_LOAD; op.buf = buf; op.size = size; if ( (err = xc_flask_op(xc_handle, &op)) != 0 ) return err; return 0;}int flask_context_to_sid(int xc_handle, char *buf, uint32_t size, uint32_t *sid){ int err; flask_op_t op; op.cmd = FLASK_CONTEXT_TO_SID; op.buf = buf; op.size = size; if ( (err = xc_flask_op(xc_handle, &op)) != 0 ) return err; sscanf(buf, "%u", sid); return 0;}int flask_sid_to_context(int xc_handle, int sid, char *buf, uint32_t size){ int err; flask_op_t op; op.cmd = FLASK_SID_TO_CONTEXT; op.buf = buf; op.size = size; snprintf(buf, size, "%u", sid); if ( (err = xc_flask_op(xc_handle, &op)) != 0 ) return err; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -