GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tyilo/asm_repl: A REPL for assembly

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
mach_exc
mach_exc
 
 
.gitignore
.gitignore
 
 
Info.plist
Info.plist
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
asm_repl.c
asm_repl.c
 
 
assemble.c
assemble.c
 
 
assemble.h
assemble.h
 
 
colors.h
colors.h
 
 
float_registers.h
float_registers.h
 
 
registers.h
registers.h
 
 
status_flags.h
status_flags.h
 
 
taskport_auth.c
taskport_auth.c
 
 
taskport_auth.h
taskport_auth.h
 
 
utils.c
utils.c
 
 
utils.h
utils.h
 
 

Repository files navigation

asm_repl

A REPL for assembly.

Type some assembly instructions and immediatly see which registers were changed.

Currently only supports i386 and x86_64 on OS X.

Screenshot

Screenshot x86_64

Also see https://asciinema.org/a/19605.

Running

  • Install radare2.
  • make
  • ./asm_repl (make run32 or make run64 to choose a specific architecture)

You need to codesign asm_repl binary or run it as root as we have to access the process we're running the assembly code in. You can codesign the binary so it can use task_for_pid without root by creating a certificate named task_for_pid using the guide here and then running make.

Commands

Valid input:
  Help:
    ?      - show this help
    ?[cmd] - show help for a command

  Commands:
    .set      - change value of register
    .read     - read from memory
    .write    - write hex to memory
    .writestr - write string to memory
    .alloc    - allocate memory
    .regs     - show the contents of the registers
    .show     - toggle shown register types

Any other input will be interpreted as x86_64 assembly

.set

Usage: .set register value
Changes the value of a register

  register - register name (GPR, FPR or status)
  value    - hex if GPR or FPR, 0 or 1 if status

.read

Usage: .read address [len]
Displays a hexdump of memory starting at address

  address - an integer or a register name
  len     - the amount of bytes to read

.write

Usage: .write address hexpairs
Writes hexpairs to a destination address

  address  - an integer or a register name
  hexpairs - pairs of hexadecimal numbers

.writestr

Usage: .writestr address string
Writes an ascii string to a destination address

  address - an integer or a register name
  string  - an ascii string

.alloc

Usage: .alloc len
Allocates some memory and returns the address

  len - the amount of bytes to allocate

.regs

Usage: .regs
Displays the values of the registers currently toggled on

.show

Usage: .show [gpr|status|fpr_hex|fpr_double]
Toggles which types of registers are shown

  gpr        - General purpose registers (rax, rsp, rip, ...)
  status     - Status registers (CF, ZF, ...)
  fpr_hex    - Floating point registers shown in hex (xmm0, xmm1, ...)
  fpr_double - Floating point registers shown as doubles

Todo

  • Use a library (libr?) for assembling instead of reading the output of running rasm2.
  • Support more architectures (arm).
  • Support more platforms (linux).
  • Arithmetic for commands (.read rip-0x10).
  • Variables to specific memory addresses (.alloc 4 => .write $alloc 12345678).

About

A REPL for assembly

Resources

Readme
Activity

Stars

107 stars

Watchers

4 watching

Forks

9 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.