All Projects → ronin-rb → ronin-asm

ronin-rb / ronin-asm

Licence: LGPL-3.0 License
ronin-asm is a Ruby DSL for crafting Assmebly programs and Shellcode.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to ronin-asm

HIGH-TO-LOW
in this repository you will find codes in C and their equivalence in MIPS Assembly
Stars: ✭ 20 (-51.22%)
Mutual labels:  asm
gb-starter-kit
A customizable and ready-to-compile bundle for Game Boy RGBDS projects. Contains your bread and butter, guaranteed 100% kitchen sink-free.
Stars: ✭ 24 (-41.46%)
Mutual labels:  asm
Radical-OS
Radical kernel source tree
Stars: ✭ 45 (+9.76%)
Mutual labels:  asm
Exploits
A personal collection of Windows CVE I have turned in to exploit source, as well as a collection of payloads I've written to be used in conjunction with these exploits.
Stars: ✭ 75 (+82.93%)
Mutual labels:  asm
zx-spectrum-games
Collection of ZX Spectrum annotated game source code dissasemblies as .skool files
Stars: ✭ 35 (-14.63%)
Mutual labels:  asm
C-Experiments
Experiments on C/C++ Exploits
Stars: ✭ 19 (-53.66%)
Mutual labels:  asm
f5-rest-client
F5 BIG-IP SDK for the Go programming language.
Stars: ✭ 49 (+19.51%)
Mutual labels:  asm
bevm
Basic computer emulator
Stars: ✭ 20 (-51.22%)
Mutual labels:  asm
Corth
It's like Porth, but in C++. Yep, we're going full circle.
Stars: ✭ 17 (-58.54%)
Mutual labels:  asm
Assembly-Lib
A 16-bits x86 DOS Assembly library that provides many useful functions for developing programs. It has both VGA grapics functions as well as general purpose utilities. The main purpose of this library was to be able to implement simple DOS games (in Assembly) using VGA (320x200, 256 colors) display.
Stars: ✭ 36 (-12.2%)
Mutual labels:  asm
OSRSUpdater
A simple (and outdated) Old-School RuneScape decompiler/deobfuscator. Performs field and method analysis which uses ASM and bytecode patterns for identification. Identified fields could be used for creating bot clients or QoL clients. For educational use only.
Stars: ✭ 13 (-68.29%)
Mutual labels:  asm
objconv
Object file converter This utility can be used for converting object files between COFF/PE, OMF, ELF and Mach-O formats for all 32-bit and 64-bit x86 platforms. Can modify symbol names in object files. Can build, modify and convert function libraries across platforms. Can dump object files and executable files. Also includes a very good disassem…
Stars: ✭ 114 (+178.05%)
Mutual labels:  asm
LanOS
one mini operating system simplified from linux0.12
Stars: ✭ 61 (+48.78%)
Mutual labels:  asm
xorpd-solutions
[SPOILER ALERT] My attempt at tackling the x86_64 asm riddles in xorpd's xchg rax,rax book. Pull requests welcome.
Stars: ✭ 57 (+39.02%)
Mutual labels:  asm
AOSV
Lecture notes for Advanced Operating Systems and Virtualization course at Sapienza University of Rome
Stars: ✭ 21 (-48.78%)
Mutual labels:  asm
awesome-n64-development
A curated list of Nintendo 64 development resources including toolchains, documentation, emulators, example code, and more
Stars: ✭ 210 (+412.2%)
Mutual labels:  asm
first nes
Create your own games for the Nintendo Entertainment System! This "starter" game is easily extensible for your own projects. Includes references.
Stars: ✭ 94 (+129.27%)
Mutual labels:  asm
MandelbrotOS
A community driven OS by the youth
Stars: ✭ 172 (+319.51%)
Mutual labels:  asm
asm-defuse
ASM powered by definitions/uses analysis
Stars: ✭ 24 (-41.46%)
Mutual labels:  asm
dxbc reader
easy to read hlsl asm shader code. parse dxbc text and export hlsl like for read
Stars: ✭ 194 (+373.17%)
Mutual labels:  asm

ronin-asm

CI Code Climate

Description

{Ronin::ASM} is a Ruby DSL for crafting Assmebly programs and Shellcode.

Features

  • Provides a Ruby DSL for writing Assembly programs.
    • Supports X86 and AMD64 instruction sets.
    • Supports ATT and Intel syntax.
  • Uses yasm to assemble the programs.
  • Supports assembling Shellcode.

Examples

Create a program:

asm = ASM.new do
  push ebx
  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

Create shellcode:

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   al,   0xb
  int   0x80
end

shellcode.assemble
# => "1\xC0Ph//shh/bin\x89\xDCPS\x89\xCC1\xD2\xB0\v\xCD\x80"

Immediate Operands

Immediate operands can be Integers or nil:

mov eax, 0xff
mov ebx, nil

The size of the operand can also be specified explicitly:

push byte(0xff)
push word(0xffff)
push dword(0xffffffff)
push qword(0xffffffffffffffff)

Memory Operands

Memory operands can be expressed as arithmatic on registers:

mov ebx, eax+8
mov ebx, eax-8
mov ebx, eax+esi
mov ebx, eax+(esi*4)

Labels

Labels can be expressed with blocks:

_loop do
  inc eax
  cmp eax, 10
  jl :_loop
end

Syscalls

If the :os option is specified, then syscall numbers can be looked up via the syscalls Hash:

ASM.new(os: 'Linux') do
  # ...
  mov al, syscalls[:execve]
  int 0x80
end

Requirements

Install

$ gem install ronin-asm

License

ronin-asm - A Ruby DSL for crafting Assmebly programs and Shellcode.

Copyright (c) 2007-2022 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 Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ronin-asm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with ronin-asm. If not, see https://www.gnu.org/licenses/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].