1 Star 0 Fork 13

virjar / UraniumVCPU

forked from YunYoo / UraniumVCPU 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

UraniumVCPU

YunYoo Uranium vCPU framework for arm/arm64/x86/x64 on Android/iOS/macOS.

Android iOS macOS
arm Yes No No
arm64 Yes Yes Yes
x86 Yes No No
x86_64 Yes No Yes

License

UraniumVM is developed by YunYoo(云铀子), all rights reserved.

  • A.Personal private use is free;
  • B.Any other usage should pay for a license;
  • 1.个人私用免费;
  • 2.除此之外的任何其他用途请购买授权;

Follow us for update or bug report:

Platform Account
Email liubaijiang@yunyoo.cn
公众号 江哥说安全
头条抖音 刘柏江/江哥说安全
微博 刘柏江VM
码云 https://gitee.com/geekneo/
码云 https://gitee.com/yunyoo/

VM API

// run function 'fn' on UraniumVCPU with 'ctx'
// return value is r[0].sx/rax
long uvm_run_interp(const void *fn, const uvm_context_t *ctx);
// this api is used to make target's function pointer under your control
//
// make a wrapper for function 'fn' with 'usrctx','callback'
// return value is a new function pointer which will run under our VCPU
// you can replace this pointer to target's function pointer
// like C++-Vtable/Script-Native-Bridge
// if return null, you should check errno
const void *uvm_make_callee(const void *fn, void *usrctx,
                            uvm_interp_callback_t callback);

Core Structure

// opcode type for callback args
typedef enum uvm_optype_t {
  vcop_read,    // memory read
  vcop_write,   // memory write
  vcop_call,    // function call
  vcop_return,  // function return
#if __ARM__
  vcop_svc,  // arm syscall
#else
  vcop_syscall,  // intel syscall
#endif
  vcop_ifetch,  // interpreter fetch instruction
} uvm_optype_t;
// callback args
typedef struct uvm_callback_args_t {
  // your own context passed for uvm_run_interp/uvm_make_callee
  const void *usrctx;
  // uvm execution context
  uvm_regs_t *uvmctx;
  // current opcode
  uvm_optype_t op;
  union {
    // for vcop_read/vcop_write/vcop_ifetch
    struct {
      const void *src;
      void *dst;
      int byte;
    } rw;
    // for vcop_call
    struct {
      const void *callee;
    } call;
    // for vcop_return
    struct {
      const void *hitaddr;  // which address hit return
    } ret;
    // for vcop_svc
    struct {
      // arm
      // parameters are in armctx->r[0...6]
      // syscall number from armctx->r[7]
      //
      // arm64
      // parameters are in arm64ctx->x
      // syscall number
      //
      // x86/x64
      // ...
      int sysno;
    } svc;
  } info;
} uvm_callback_args_t;

Version History

2021/8/26:

  • 1.修复大函数堆栈切换出错的问题;
  • 2.优化函数尾调用的识别算法;

2021/7/26:

  • 适配VMPStudio UVM采样编辑器 for arm64;

2021/5/14:

  • 发布V1.0.2;
  • 1.适配uvmdbg代码页托管断点模式;
  • 2.修复arm某些neon指令模拟执行错误的问题;
  • 3.修复arm某些thumb2指令模拟执行错误的问题;

2021/4/18:

  • 发布V1.0.1;
  • 1.修复arm/arm64 vm/host堆栈切换错误的问题;

2021/4/18:

  • 发布V1.0.0;
  • 1.Android x86/x86_64;
  • 2.macOS x86_64;

2021/4/15:

  • 发布V1.0.0;
  • 1.Android arm/arm64;
  • 2.iOS arm64/arm64e;
  • 3.macOS arm64;
MIT License Copyright (c) 2021 刘柏江 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

An arm/arm64/x86/x64 virtual CPU framework for macOS/iOS/Android. 展开 收起
C++
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/virjar/UraniumVCPU.git
git@gitee.com:virjar/UraniumVCPU.git
virjar
UraniumVCPU
UraniumVCPU
master

搜索帮助