返回介绍

1. 寄存器

发布于 2024-10-13 10:58:56 字数 1156 浏览 0 评论 0 收藏 0

CPU 内置,以名称访问,速度最快的存储器。包括通用寄存器、控制寄存器和段寄存器。

  • 通用寄存器:RAX, RBX, RCX, RDX, RBP, RSP, RSI, RDI, R8-R15
  • 指令寄存器:RIP(PC)
  • 段寄存器:CS, DS, SS, ES, FS, GS
  • 标志寄存器:EFLAGS (OF/DF/IF ...)

RIP 指向下一条要执行的指令地址。RSP 指向栈顶,从高向低扩展。

  64           32     16   8    0
  +======================+==========+======+======+
  |            |      |  AH  |  AL  |
  +======================+==========+======+======+
  |            |      |       |
  |            |      +----- AX ----+
  |            +----- EAX --------------+
  +----- RAX -------------------------------------+
  

REPL

Rappel is a pretty janky assembly REPL. It works by creating a shell ELF, starting it under ptrace, then continiously rewriting/running the .text section, while showing the register states. It's maybe half done right now, and supports Linux x86, amd64, armv7 (no thumb), and armv8 at the moment.

$ apt install -y libedit-dev
$ git clone https://github.com/yrp604/rappel

$ cd rappel
$ make

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文