• Stars
    star
    867
  • Rank 50,558 (Top 2 %)
  • Language
    Ruby
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A REPL for x86-64 assembly language

ASMREPL

This is a REPL for assembly language.

Usage

Install the gem:

$ gem install asmrepl

Then start the repl like this:

$ asmrepl

If you're on macOS, you'll need to start the repl with sudo.

When the REPL starts, it will display all register values and flags:

================== CPU STATE ===================
rax  000000000000000000  r8   0x00007f89d0f04640
rbx  000000000000000000  r9   0x0000000000000004
rcx  0x00007f89d0f04a50  r10  000000000000000000
rdx  0x..fc611d3f0aa2900d4  r11  0x00000001033a4000
rdi  0x00007ff7bd126148  r12  000000000000000000
rsi  000000000000000000  r13  0x00007ff7bd125dc0
rbp  0x00007ff7bd125c40  r14  000000000000000000
rsp  0x00007ff7bd125c38  r15  000000000000000000

rip     0x00000001033a4001
rflags  0x0000000000000246
cs      0x000000000000002b
fs      000000000000000000
gs      000000000000000000

FLAGS: ["PF", "ZF", "IF"]

(rip 0x00000001033a4001)>

Then you can issue commands and inspect register values. Let's write to the rax register and inspect its value:

(rip 0x00000001033a4001)> mov rax, 5
=============== REGISTER CHANGES ===============
rax     000000000000000000 => 0x0000000000000005

(rip 0x00000001033a4009)> rax
0x0000000000000005
(rip 0x00000001033a4009)>

Now let's write to the rbx register and add the two values:

(rip 0x00000001033a4009)> mov rbx, 3
=============== REGISTER CHANGES ===============
rbx     000000000000000000 => 0x0000000000000003

(rip 0x00000001033a4011)> add rax, rbx
=============== REGISTER CHANGES ===============
rax     0x0000000000000005 => 0x0000000000000008
rflags  0x0000000000000246 => 0x0000000000000202

FLAGS: ["IF"]

(rip 0x00000001033a4015)> rax
0x0000000000000008
(rip 0x00000001033a4015)> rbx
0x0000000000000003
(rip 0x00000001033a4015)>

Finally, lets check all values in the CPU:

(rip 0x00000001033a4015)> cpu
================== CPU STATE ===================
rax  0x0000000000000008  r8   0x00007f89d0f04640
rbx  0x0000000000000003  r9   0x0000000000000004
rcx  0x00007f89d0f04a50  r10  000000000000000000
rdx  0x..fc611d3f0aa2900d4  r11  0x00000001033a4000
rdi  0x00007ff7bd126148  r12  000000000000000000
rsi  000000000000000000  r13  0x00007ff7bd125dc0
rbp  0x00007ff7bd125c40  r14  000000000000000000
rsp  0x00007ff7bd125c38  r15  000000000000000000

rip     0x00000001033a4015
rflags  0x0000000000000202
cs      0x000000000000002b
fs      000000000000000000
gs      000000000000000000

FLAGS: ["IF"]

(rip 0x00000001033a4015)>

More Repositories

1

initial-v

It's a BMW shifter converted to a Bluetooth Keyboard that you use with Vim
C++
959
star
2

rails_autolink

The auto_link function from Rails
Ruby
582
star
3

the_metal

A spike for thoughts about Rack 2.0
Ruby
519
star
4

analog-terminal-bell

A bell for your terminal that is analog
OpenSCAD
474
star
5

tenderjit

JIT for Ruby that is written in Ruby
Ruby
416
star
6

fisk

A pure Ruby assembler
Ruby
295
star
7

phuby

phuby wraps PHP in a loving embrace
Ruby
266
star
8

hana

An implementation of JSON Patch and JSON Pointer for Ruby
Ruby
214
star
9

esp8266aq

ESP8266 and Plantower AQ sensor
C++
212
star
10

recma

Pure ruby javascript parser and interpreter.
Ruby
194
star
11

dnssd

Multicast DNS client for ruby! YAY!
Ruby
173
star
12

ruby-glossary

Just a glossary of terms I've found in Ruby source code
172
star
13

enterprise

Make ruby ruby application enter the enterprise with the enterprise gem
Ruby
156
star
14

heap-analyzer

A heap analyzer for MRI that isn't very good.
JavaScript
141
star
15

rexical

rexical is a lexical scanner generator for ruby
Ruby
135
star
16

namecase

Properly case people's names
Ruby
128
star
17

refreshing

A Rails Engine that gives Language Server support to Rails apps
Ruby
112
star
18

tusk

Message busses with Observable API
Ruby
101
star
19

uart

Simple serial / UART interface for Ruby
Ruby
100
star
20

heapfrag

Heap visualizer for Ruby
Ruby
97
star
21

nfc

NFC is a ruby wrapper for the Near Field Communication library.
C
90
star
22

rubycommitters.org

The source for rubycommitters.org
Ruby
83
star
23

ds9

Wrapper around nghttp2
C
80
star
24

tinygql

A tiny and experimental GraphQL parser in Ruby
Ruby
78
star
25

fibur

Concurrent execution during Ruby I/O
Ruby
78
star
26

our_pc

Our Procedure Calls
Ruby
71
star
27

magic_scan

My magic card recognition system
Ruby
69
star
28

av_capture

A wrapper around av_capture on OS X
Objective-C
68
star
29

aarch64

Pure Ruby ARM64 Assembler
Ruby
64
star
30

gda

A SQL parser. It wraps libgda
C
64
star
31

taka

Taka is a DOM (core and html) implementation for Ruby
Ruby
63
star
32

minitest-emoji

View your test output as emoji
Ruby
59
star
33

mmap

A wrapper around mmap
C
57
star
34

neversaydie

NeverSayDie will let you rescue from SEGV's and is evil
Ruby
55
star
35

reloader

A demo of live streams on Rails 4
Ruby
50
star
36

HTML5DeckBuilder

an html5 mtg deck builder
JavaScript
49
star
37

sphero

A ruby gem for the sphero ball
Ruby
45
star
38

dot_vim

my dot vim directory
Vim Script
44
star
39

markup_validity

Test for valid markup with test/unit or rspec
Ruby
44
star
40

my_thing

demo of regression test selection
Ruby
42
star
41

defrost

Never let pesky "frozen" objects get in your way again! Use Defrost to remove the frozen state from your objects!
Ruby
41
star
42

gem_survey

a survey script for gems
Ruby
41
star
43

spectacular

View SNMP in your browser
Ruby
38
star
44

zeroconf

Multicast DNS client and server written in pure Ruby
Ruby
30
star
45

leap_motion

Ruby bindings to the Leap Motion C++ library
C++
30
star
46

paddle

Paddle is an rdoc plugin for emitting epub books suitable for use with iBooks
Ruby
29
star
47

horo

RDoc style extracted from Rails and refactored for RDoc 2.5.x
Ruby
26
star
48

earworm

What is that song? Earworm uses libofa and MusicDNS to tell you.
Ruby
26
star
49

streamdeck-ruby-plugin

Minimal Stream Deck plugin written in Ruby
Ruby
24
star
50

raop

RAOP Client is an Airport Express client written in ruby. It allows you to stream music to an Airport Express from Ruby.
Ruby
24
star
51

lolwut

Demo of SSE and reloading with AC::Live
Ruby
23
star
52

purdytest

Colorized output for minitest
Ruby
23
star
53

qrtools

QR Decoder for Ruby. Uses libdecodeqr
C++
22
star
54

dejour

find awesome stuff on the network
Ruby
22
star
55

playpen

A wrapper around the OS X security library
Ruby
21
star
56

geera

A commandline client for JIRA
Ruby
20
star
57

rjson

An JSON parser written with Racc
Ruby
20
star
58

widen

A library for narrowing and widening characters
Ruby
19
star
59

arghhh

I can't figure out SSL, please help!
Ruby
19
star
60

heap-utils

Just random scripts I'm using for Ruby heap info
Ruby
19
star
61

icanhasaudio

I am in ur computar, encodin' and decodin' ur MP3z.
C
19
star
62

housefire

Dumb campfire clone
Ruby
18
star
63

xml_truth

A collection of XML/HTML parser benchmarks for Ruby
Ruby
18
star
64

tldr

Too Long Didn't Run
Ruby
17
star
65

adequatehq.com

Adequate HQ
17
star
66

stree

A wrapper around libstree
C
16
star
67

allocation_sampler

C
16
star
68

wreckster

A Ruby API for Rexster
Ruby
15
star
69

chicken-yaml

libyaml wrapper for chicken scheme
Scheme
15
star
70

ruby-pprof

A Ruby program for parsing gperftools output
Ruby
14
star
71

uchip

Ruby library for interacting with MCP2221 and MCP2221a
Ruby
14
star
72

betabrite

This is a ruby API for the BetaBrite LED sign
Ruby
14
star
73

orient

Binary protocol implementation for Orient DB and Ruby
Ruby
14
star
74

fsmjs

Simulating fsm in JS
14
star
75

imgur2

Quick hack for uploading to imgur
Ruby
13
star
76

roastr

My Christmas roast
R
13
star
77

zomg

An OMG IDL parser and ruby code generator
Ruby
12
star
78

quail

Zero MQ ruby wrapper
Ruby
12
star
79

jit_buffer

General purpose buffer for use with building JITs
Ruby
10
star
80

hacks

Code for accessing CRuby constants and functions as Ruby
Ruby
10
star
81

meow

Meow gives you access to Growl notifications using RubyCocoa
Ruby
10
star
82

awkward

Produce dot files that represent your object graph
Ruby
10
star
83

libxml2

my fork of libxml2
C
10
star
84

mallcop

libssh2 wrapper
Ruby
9
star
85

milton

Ruby
9
star
86

odinflex

Different utilities that I've written
Ruby
9
star
87

remotehash

An OpenDHT client library
Ruby
9
star
88

wank

Ruby
9
star
89

WORF

WORF, the DWARF parser
Ruby
9
star
90

kedama

A wrapper around ming. Create swf files in ruby using ming.
Ruby
9
star
91

rubypan

Ruby
8
star
92

tree_diff

Parse html using different parsers, then show differences between the generated trees
Ruby
8
star
93

hatstone

A minimal Ruby wrapper for Capstone disassembler
C++
8
star
94

e-zine

My E-Zine
7
star
95

rsat

A pure Ruby SAT solver
Ruby
7
star
96

tenderlove.github.com

My awesome website
HTML
7
star
97

myhidapi

A wrapper around hidapi for Ruby
C
7
star
98

compiler

Proof of concept for converting Journey routes to state tables
Ruby
7
star
99

magic

I found some of my old code from 2004 on a USB stick. This code is not for use, it's just for fun
Roff
7
star
100

hearts

I love hearts!
Ruby
6
star