README.md in ronin-asm-0.1.0 vs README.md in ronin-asm-0.2.0

- old
+ new

@@ -1,13 +1,15 @@ -# Ronin Asm +# Ronin ASM * [Source](https://github.com/ronin-ruby/ronin-asm) * [Issues](https://github.com/ronin-ruby/ronin-asm/issues) * [Documentation](http://rubydoc.info/github/ronin-ruby/ronin-asm/frames) * [Mailing List](https://groups.google.com/group/ronin-ruby) * [irc.freenode.net #ronin](http://ronin-ruby.github.com/irc/) +[![Build Status](https://secure.travis-ci.org/ronin-ruby/ronin-asm.png?branch=master)](https://travis-ci.org/ronin-ruby/ronin-asm) + ## Description {Ronin::ASM} is a Ruby DSL for crafting Assmebly programs and Shellcode. ## Features @@ -22,54 +24,58 @@ Create a program: asm = ASM.new do push ebx - mov ebx, eax + mov eax, 0xc0ffee pop ebx hlt end puts asm.to_asm + # BITS 32 + # section .text # _start: + # push ebx + # mov eax, WORD 0xc0ffee + # pop ebx + # hlt + + puts asm.to_asm(:att) + # .code32 + # .text + # _start: # pushl %ebx # movl %ebx, %eax # popl %ebx # hlt - puts asm.to_asm(:intel) - # _start: - # push ebx - # mov eax, ebx - # pop ebx - # hlt - Create shellcode: - shellcode = ASM::Shellcode.new(:arch => :x86) do + shellcode = ASM::Shellcode.new(arch: :x86) do xor eax, eax push eax push 0x68732f2f push 0x6e69622f mov esp, ebx push eax push ebx mov esp, ecx xor edx, edx - mov 0xb, al + mov al, 0xb int 0x80 end shellcode.assemble - # => "f1\xC0fPfh//shfh/binf\x89\xE3fPfSf\x89\xE1f1\xD2\xB0\v\xCD\x80" + # => "1\xC0Ph//shh/bin\x89\xDCPS\x89\xCC1\xD2\xB0\v\xCD\x80" ### Immediate Operands Immediate operands can be Integers or `nil`: - mov 0xff, eax - mov nil, ebx + mov eax, 0xff + mov ebx, nil The size of the operand can also be specified explicitly: push byte(0xff) push word(0xffff) @@ -78,14 +84,14 @@ ### Memory Operands Memory operands can be expressed as arithmatic on registers: - mov eax+8, ebx - mov eax-8, ebx - mov eax+esi, ebx - mov eax+(esi*4), ebx + mov ebx, eax+8 + mov ebx, eax-8 + mov ebx, eax+esi + mov ebx, eax+(esi*4) ### Labels Labels can be expressed with blocks: @@ -98,19 +104,20 @@ ### Syscalls If the `:os` option is specified, then syscall numbers can be looked up via the `syscalls` Hash: - ASM.new(:os => 'Linux') do + ASM.new(os: 'Linux') do # ... - mov syscalls[:execve], al + mov al, syscalls[:execve] int 0x80 end ## Requirements -* [data_paths] ~> 0.3 +* [Ruby] >= 1.9.1 +* [data\_paths] ~> 0.3 * [yasm] >= 0.6.0 * [ruby-yasm] ~> 0.2 ## Install @@ -118,11 +125,11 @@ ## License Ronin::ASM - A Ruby DSL for crafting Assmebly programs and Shellcode. -Copyright (c) 2007-2012 Hal Brodigan (postmodern.mod3 at gmail.com) +Copyright (c) 2007-2013 Hal Brodigan (postmodern.mod3 at gmail.com) This file is part of Ronin ASM. Ronin Asm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -135,8 +142,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Ronin Asm. If not, see <http://www.gnu.org/licenses/>. +[Ruby]: http://www.ruby-lang.org [yasm]: http://yasm.tortall.net/ [data_paths]: https://github.com/postmodern/data_paths#readme [ruby-yasm]: https://github.com/sophsec/ruby-yasm#readme