Class: Ronin::ASM::Shellcode
- Defined in:
- lib/ronin/asm/shellcode.rb
Overview
Represents Shellcode. Shellcode is like an Assembly Program, but assembles into raw machine code which can be injected into a process.
ASM::Shellcode.new 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
int 0x80
end
Constant Summary
Constants inherited from Program
Program::PARSERS, Program::SYNTAX
Instance Attribute Summary
Attributes inherited from Program
#allocated_registers, #arch, #instructions, #os, #registers, #syscalls, #word_size
Instance Method Summary collapse
-
#assemble(options = {}) ⇒ String
Assembles the Shellcode.
Methods inherited from Program
#byte, #critical, #dword, #eval, #initialize, #instruction, #interrupt, #label, #method_missing, #qword, #register, #register?, #register_clear, #register_load, #register_save, #register_set, #stack_pop, #stack_push, #syscall, #to_asm, #to_s, #word
Constructor Details
This class inherits a constructor from Ronin::ASM::Program
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ronin::ASM::Program
Instance Method Details
#assemble(options = {}) ⇒ String
Assembles the Shellcode.
60 61 62 63 64 65 66 |
# File 'lib/ronin/asm/shellcode.rb', line 60 def assemble(={}) output = Tempfile.new(['ronin-shellcode', '.bin']).path super(output,.merge(format: :bin)) return File.new(output,'rb').read end |