• Stars
    star
    80
  • Rank 390,909 (Top 8 %)
  • Language
    Scheme
  • License
    MIT License
  • Created over 13 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

Disassembler for Racket

Build Status

A disassembler for JITed functions in Racket.

To install:

% raco pkg install disassemble

To use it, try something like this:

[samth@punge:~/sw/disassemble (master) plt] racket
Welcome to Racket v6.0.1.10.
> (require disassemble)
> (define (f x) 1)
> (disassemble f)
       0: 488943f8                       (mov (mem64+ rbx #x-8) rax)
       4: 4883c3f8                       (add rbx #xfffffffffffffff8)
       8: b803000000                     (mov eax #x3)
       d: 4c8b75c8                       (mov r14 (mem64+ rbp #x-38))
      11: 4883c428                       (add rsp #x28)
      15: 415d                           (pop r13)
      17: 415c                           (pop r12)
      19: 5b                             (pop rbx)
      1a: 5d                             (pop rbp)
      1b: c3                             (ret)
>

If you have ndisasm installed (and in your PATH) you can also try:

> (disassemble f #:program 'nasm)
00000000  488943F8          mov [rbx-0x8],rax
00000004  4883C3F8          add rbx,byte -0x8
00000008  B803000000        mov eax,0x3
0000000D  4C8B75C8          mov r14,[rbp-0x38]
00000011  4883C428          add rsp,byte +0x28
00000015  415D              pop r13
00000017  415C              pop r12
00000019  5B                pop rbx
0000001A  5D                pop rbp
0000001B  C3                ret

This works only on x86 or x86-64.

Also, the dump function writes the bytes of the machine code to a file:

> (dump const "file.bin")

Patches, uses, complaints, and suggestions are all welcome.

The disassembly code (when not using NASM) is taken from Gรถran Weinholt's Machine Code library.

More Repositories

1

gradual-typing-bib

A bibliography on Gradual Typing
Racket
245
star
2

fancy-app

A Scala-style magic function application form
Racket
44
star
3

git-slice

Slicing git repositories.
Racket
22
star
4

semilit

Semiliterate programming in Racket
Racket
13
star
5

gcstats

GC statistics for Racket
Racket
11
star
6

bcrypt.rkt

A Racket interface to bcrypt
C
10
star
7

object-backtrace

find out what keeps an object alive
Racket
7
star
8

tr-tutorial

Typed Racket tutorial at ELS 2013 & RacketCon 2012
Racket
7
star
9

javascript.plt

dherman's javascript.plt planet pkg
Scheme
6
star
10

zuo

Racket
5
star
11

persistent-array

Racket
5
star
12

new-racket-web

A revised Racket web page
Racket
5
star
13

docker-racket-build

Shell
5
star
14

rhombus-more

4
star
15

find-pkg-deps

Racket
4
star
16

var

Verification via Abstract Reduction
Racket
4
star
17

raco-git

Obseleted by raco pkg, aka Planet 2
Racket
4
star
18

github.rkt

GitHub bindings for Racket
Racket
4
star
19

lang-slide

A slide that shows all the languages used to build Racket
Racket
4
star
20

racket-examples

Explainer for Racket homepage examples
Racket
3
star
21

github

Racket
3
star
22

get-primitive

Racket
3
star
23

ella

Racket
3
star
24

control-contract-model

Racket
2
star
25

project-ideas

Ideas
2
star
26

raco-bug

Racket
2
star
27

persistent-union-find

Racket
2
star
28

rekt

Racket
2
star
29

pkg-build-diff

Racket
2
star
30

xlang

A language of combinators and numeric constants, implemented in Racket.
Racket
2
star
31

talks

PostScript
2
star
32

raco-macro-step

Racket
2
star
33

samth.github.io

Web page
Isabelle
2
star
34

module-constraints

Racket
2
star
35

test-bugs

2
star
36

pltalk

Racket
2
star
37

mmap

Racket
2
star
38

popl08-model

Scheme
2
star
39

split-by

Racket
1
star
40

test-date

Testing DrRacket on multiple dates
Racket
1
star
41

chap-bench

Racket
1
star
42

dltool

Racket
1
star
43

find-parent-dir

Finding containing directories
Racket
1
star
44

dissertation

TeX
1
star
45

htdp-json

Racket
1
star
46

in-covid

Racket
1
star
47

.github

1
star
48

perf-scripts

Python
1
star
49

aoc2021

Racket
1
star
50

jscontracts

Proxy-based Contract Library for JavaScript
1
star
51

r6rs-immutable

Racket
1
star
52

abnf

Racket
1
star