Tools for working with x86 assembly in Ruby?

L

ljp

Hi all,

I'm starting a project that will involve injecting instructions into
x86 assembly code. I'd like to write this tool in Ruby. In the
interest of not reinventing wheels, I'm appealing to the Ruby
community: does anyone know of some serviceable source code for
parsing x86 assembly, and ideally for editing (e.g., ability to update
offsets when an instruction is moved around)? Or perhaps someone
knows of an assembler written in Ruby that I could pilfer? My Google-
fu hasn't turned up anything.

(I know of Racc - it will be my starting point if I can't find an
existing parser)

Many thanks =)
 
M

Matt Lawrence

I'm starting a project that will involve injecting instructions into
x86 assembly code. I'd like to write this tool in Ruby. In the
interest of not reinventing wheels, I'm appealing to the Ruby
community: does anyone know of some serviceable source code for
parsing x86 assembly, and ideally for editing (e.g., ability to update
offsets when an instruction is moved around)? Or perhaps someone
knows of an assembler written in Ruby that I could pilfer? My Google-
fu hasn't turned up anything.

You may want to take a look at Metasploit, I think it does some of that.

-- Matt
It's not what I know that counts.
It's what I can remember in time to use.
 
M

M. Edward (Ed) Borasky

ljp said:
Hi all,

I'm starting a project that will involve injecting instructions into
x86 assembly code. I'd like to write this tool in Ruby. In the
interest of not reinventing wheels, I'm appealing to the Ruby
community: does anyone know of some serviceable source code for
parsing x86 assembly, and ideally for editing (e.g., ability to update
offsets when an instruction is moved around)? Or perhaps someone
knows of an assembler written in Ruby that I could pilfer? My Google-
fu hasn't turned up anything.

(I know of Racc - it will be my starting point if I can't find an
existing parser)

Many thanks =)

Have a look at RubyInline. It lets you put C code in line in Ruby code.
I would imagine that "C code" on a Gnu/Linux system could include Gnu
Assembler code as well. I can't help you on Windows, however. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,281
Latest member
Pedroaciny

Latest Threads

Top