code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/dynldr'
module Metasm
module Gui
class XGui < DynLdr
new_api_c <<EOS, 'libX11.so'
#define KeyPressMask (1... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
module Metasm
module Gui
class Graph
# one box, has a text, an id, and a list of other boxes to/from
class Box
attr_accessor :id, :x, :y, ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/gui/dasm_graph'
module Metasm
module Gui
class FuncGraphViewWidget < GraphViewWidget
# :full / :from / :to / :both
# :from ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
module Metasm
module Gui
class AsmListingWidget < DrawableWidget
attr_accessor :dasm, :arrow_zone_w
# nr of raw bytes to display next to eac... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/gui/dasm_hex'
require 'metasm/gui/dasm_listing'
require 'metasm/gui/dasm_opcodes'
require 'metasm/gui/dasm_coverage'
require ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
module Metasm
module Gui
class CdecompListingWidget < DrawableWidget
attr_accessor :dasm, :curaddr, :tabwidth
def initialize_widget(dasm, p... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/preprocessor'
module Metasm
# c parser
# inspired from http://www.math.grin.edu/~stone/courses/languag... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class ExeFormat
# encodes an Array of source (Label/Data/Instruction etc) to an EncodedData
# resolves... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/parse_c'
module Metasm
module C
class Parser
def precompile
@toplevel.precompile(Compiler.new(se... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/cy16/decode'
require 'metasm/cpu/cy16/render'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/opcodes'
require 'metasm/cpu/ia32/encode'
require 'metasm/parse'
module Metasm
class Ia32
class ModRM
# may return... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/opcodes'
module Metasm
class Ia32
def dbg_register_pc
@dbg_register_pc ||= :eip
end
def dbg_register_sp
@dbg... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
# The ia32 aka x86 CPU
# currently limited to 16 and 32bit modes
class Ia32 < CPU
# some ruby magic t... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/main'
module Metasm
class Ia32
# temporarily setup dasm.address_binding so that backtracking
# stack-related offs... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/opcodes'
require 'metasm/encode'
module Metasm
class Ia32
class InvalidModRM < Exception ; end
class ModRM
# re... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/parse'
require 'metasm/compile_c'
module Metasm
class Ia32
class CCompiler < C::Compiler
# holds compiler state in... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/main'
module Metasm
class Ia32
def init_cpu_constants
@opcode_list ||= []
@fields_mask.update :w => 1, :s => 1... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/opcodes'
require 'metasm/render'
# XXX move context in another file ?
module Metasm
class Ia32
class Argument
in... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ia32/opcodes'
require 'metasm/decode'
module Metasm
class Ia32
class ModRM
def self.decode(edata, byte, endianness, a... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/opcodes'
require 'metasm/cpu/x86_64/encode'
require 'metasm/parse'
module Metasm
class X86_64
def parse_parser_i... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/opcodes'
module Metasm
class X86_64
def dbg_register_pc
@dbg_register_pc ||= :rip
end
def dbg_register_flags... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/ia32'
module Metasm
# The x86_64, 64-bit extension of the x86 CPU (x64, em64t, amd64...)
class X8... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/opcodes'
require 'metasm/encode'
module Metasm
class X86_64
class ModRM
def self.encode_reg(reg, mregval = 0)
... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/parse'
require 'metasm/compile_c'
module Metasm
class X86_64
class CCompiler < C::Compiler
# holds compiler stat... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/main'
require 'metasm/cpu/ia32/opcodes'
module Metasm
class X86_64
def init_cpu_constants
super()
[:i32, :u3... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/opcodes'
require 'metasm/render'
module Metasm
class X86_64
def gui_hilight_word_regexp_init
ret = {}
%w[a ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/x86_64/opcodes'
require 'metasm/decode'
module Metasm
class X86_64
class ModRM
def self.decode(edata, byte, endiannes... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class Sh4 < CPU
def initialize(e = :little, transfersz = 0, fpprecision = 0)
super()
@endianness = ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/sh4/main'
module Metasm
class Sh4
def addop(name, bin, *args)
o = Opcode.new name, bin
args.each { |a|
o.args <<... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/sh4/opcodes'
require 'metasm/decode'
module Metasm
class Sh4
def build_opcode_bin_mask(op)
op.bin_mask = 0
op.args.e... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
class Metasm::Dalvik < Metasm::CPU
end
require 'metasm/main'
require 'metasm/cpu/dalvik/decode'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class CY16 < CPU
class Reg
class << self
attr_accessor :s_to_i, :i_to_s
end
@i_to_s = (0..14).... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/cy16/main'
module Metasm
class CY16
def addop(name, bin, *args)
o = Opcode.new name, bin
args.each { |a|
o.args ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/cy16/opcodes'
require 'metasm/render'
module Metasm
class CY16
class Reg
include Renderable
def render ; [self.clas... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/cy16/opcodes'
require 'metasm/decode'
module Metasm
class CY16
def build_opcode_bin_mask(op)
# bit = 0 if can be muta... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
# fix autorequire warning
class Metasm::Ia32 < Metasm::CPU
end
require 'metasm/main'
require 'metasm/cpu/ia32/parse'
require 'metasm/cpu/ia32... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class Python < CPU
def initialize(prog = nil)
super()
@program = prog
@endianness = (prog.respond_... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/python/main'
module Metasm
class Python
CMP_OP = %w[< <= == != > >= in not_in is is_not exch]
def addop(name, bin, *ar... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/python/opcodes'
require 'metasm/decode'
module Metasm
class Python
def build_bin_lookaside
opcode_list.inject({}) { |l... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class Pic16c < CPU
def initialize(endianness = :big)
super()
@endianness = endianness
init
end
e... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/pic16c/main'
module Metasm
class Pic16c
def addop(name, bin, *l)
o = Opcode.new name, bin
l.each { |ll|
if @prop... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/pic16c/opcodes'
require 'metasm/decode'
module Metasm
class Pic16c
def build_opcode_bin_mask(op)
# bit = 0 if can be ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ppc/opcodes'
require 'metasm/parse'
module Metasm
class PowerPC
# TODO
def parse_arg_valid?(op, sym, arg)
case sym
... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/render'
module Metasm
class PowerPC < CPU
class Reg
include Renderable
class << self
attr_acce... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ppc/main'
module Metasm
class PowerPC
# temporarily setup dasm.address_binding so that backtracking
# stack-related of... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ppc/opcodes'
require 'metasm/encode'
module Metasm
class PowerPC
private
def encode_instr_op(exe, instr, op)
base = ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ppc/main'
module Metasm
class PowerPC
def addop(name, bin, *argprops)
o = Opcode.new name, bin
argprops.each { |a|... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/ppc/opcodes'
require 'metasm/decode'
module Metasm
class PowerPC
def build_opcode_bin_mask(op)
# bit = 0 if can be mu... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/bpf/decode'
require 'metasm/cpu/bpf/render'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
class Metasm::ARM < Metasm::CPU
end
require 'metasm/main'
require 'metasm/cpu/arm/parse'
require 'metasm/cpu/arm/encode'
require 'metasm/cpu/... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/arc/decode'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arm/opcodes'
require 'metasm/parse'
module Metasm
class ARM
def opcode_list_byname
@opcode_list_byname ||= opcode_lis... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arm/opcodes'
module Metasm
class ARM
def dbg_register_pc
@dbg_register_pc ||= :pc
end
def dbg_register_flags
@dbg... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class ARM < CPU
class Reg
class << self
attr_accessor :s_to_i, :i_to_s
end
@i_to_s = %w[r0 r1 ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arm/opcodes'
require 'metasm/encode'
module Metasm
class ARM
def encode_instr_op(program, instr, op)
base = op.bin
... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arm/main'
module Metasm
class ARM
private
# ARM MODE
def addop(name, bin, *args)
args << :cond if not args.delete... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/render'
require 'metasm/cpu/arm/opcodes'
module Metasm
class ARM
class Reg
include Renderable
def render
r = self.cla... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arm/opcodes'
require 'metasm/decode'
module Metasm
class ARM
# create the bin_mask for a given opcode
def build_opcode_... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
class Metasm::X86_64 < Metasm::Ia32
end
require 'metasm/main'
require 'metasm/cpu/x86_64/parse'
require 'metasm/cpu/x86_64/encode'
require 'm... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class BPF < CPU
class Reg
attr_accessor :v
def initialize(v)
@v = v
end
def symbolic(orig=n... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/bpf/main'
module Metasm
class BPF
def addop(name, bin, *args)
o = Opcode.new name, bin
args.each { |a|
o.args <<... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/bpf/opcodes'
require 'metasm/render'
module Metasm
class BPF
class Reg
include Renderable
def render ; [@v.to_s] en... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/bpf/opcodes'
require 'metasm/decode'
module Metasm
class BPF
def build_bin_lookaside
opcode_list.inject({}) { |h, op|... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/python/decode'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/z80/decode'
require 'metasm/cpu/z80/render'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/mips/opcodes'
require 'metasm/parse'
module Metasm
class MIPS
def parse_arg_valid?(op, sym, arg)
# special case for l... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class MIPS
def dbg_register_pc
@dbg_register_pc ||= :pc
end
def dbg_register_flags
@dbg_register_... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class MIPS < CPU
class Reg
class << self
attr_accessor :s_to_i, :i_to_s
end
@s_to_i = {}
@i_... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/mips/opcodes'
require 'metasm/encode'
module Metasm
class MIPS
private
def encode_instr_op(exe, instr, op)
base = op... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/mips/parse'
require 'metasm/compile_c'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/mips/main'
# TODO coprocessors, floating point, 64bits, thumb mode
module Metasm
class MIPS
def addop(name, bin, *arg... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/mips/opcodes'
require 'metasm/render'
module Metasm
class MIPS
class Reg
include Renderable
def render ; [self.clas... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/mips/opcodes'
require 'metasm/decode'
module Metasm
class MIPS
def build_opcode_bin_mask(op)
# bit = 0 if can be muta... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/sh4/decode'
| Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class Z80 < CPU
class Reg
class << self
attr_accessor :s_to_i, :i_to_s
end
@i_to_s = { 8 => { ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/z80/main'
module Metasm
class Z80
def addop(name, bin, *args)
o = Opcode.new name, bin
args.each { |a|
o.args <<... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/z80/opcodes'
require 'metasm/render'
module Metasm
class Z80
class Reg
include Renderable
def render ; [self.class.... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/z80/opcodes'
require 'metasm/decode'
module Metasm
class Z80
def build_opcode_bin_mask(op)
# bit = 0 if can be mutate... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class ARC < CPU
def initialize(e = :little)
super()
@endianness = e
@size = 32
end
class Reg
... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arc/main'
module Metasm
class ARC
def addop32(name, bin, *args)
addop(:ac32, name, bin, *args)
end
def addop16(name... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2010 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/arc/opcodes'
require 'metasm/decode'
module Metasm
class ARC
def major_opcode(val, sz = 16)
return val >> (sz == 16 ? ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class Dalvik < CPU
class Reg
attr_accessor :i
def initialize(i)
@i = i
end
def symbolic
... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
# the Dalvik binary format, aka android java backend bytecode
# this file was generated using the android source tree, as reference,
# specifi... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/cpu/dalvik/opcodes'
require 'metasm/decode'
module Metasm
class Dalvik
def build_bin_lookaside
end
def decode_findopcode(... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
class Metasm::MIPS < Metasm::CPU
end
require 'metasm/main'
require 'metasm/cpu/mips/parse'
require 'metasm/cpu/mips/encode'
require 'metasm/c... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/cpu/ppc/parse'
require 'metasm/cpu/ppc/encode'
require 'metasm/cpu/ppc/decode'
require 'metasm/cpu/ppc/... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/os/main'
require 'metasm/debug'
require 'metasm/dynldr'
module Metasm
class WinAPI < DynLdr
def self.api_not_found(lib, func... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/os/main'
require 'metasm/debug'
require 'socket'
module Metasm
# lowlevel interface to the gdbserver protocol
class GdbClien... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/os/main'
require 'metasm/debug'
module Metasm
class PTrace
attr_accessor :buf, :pid
def self.open(target)
ptrace = new(... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
# this module regroups OS-related functions
# (eg. find_process, inject_shellcode)
# a 'class' just to be... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
module Metasm
class GNUExports
# exported symbol name => exporting library name for common libraries
# used by ELF#automagic_symbols
EXPOR... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
module Metasm
class WindowsExports
# exported symbol name => exporting library name for common libraries
# used by PE#autoimports
EXPORT =... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/exe_format/main'
require 'metasm/encode'
require 'metasm/decode'
module Metasm
class MZ < ExeFormat
MAGIC = 'MZ' # 0x4d5a
... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/exe_format/main'
require 'metasm/encode'
require 'metasm/decode'
module Metasm
# Nintendo DS executable file format
class N... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/exe_format/main'
require 'metasm/encode'
require 'metasm/decode'
module Metasm
# BFLT is the binary flat format used by the u... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/exe_format/main'
require 'metasm/encode'
require 'metasm/decode'
module Metasm
class AOut < ExeFormat
MAGIC = { 0407 => 'OMA... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/exe_format/main'
require 'metasm/encode'
require 'metasm/decode'
module Metasm
class JavaClass < ExeFormat
MAGIC = "\xCA\xF... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/encode'
require 'metasm/exe_format/coff' unless defined? Metasm::COFF
module Metasm
class COFF
class OptionalHeader
# enc... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/exe_format/main'
module Metasm
# Similar to Shellcode, with distinct sections per memory permission (R / RW / RX)
# encoding... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
require 'metasm/parse'
require 'metasm/encode'
require 'metasm/decode'
require 'metasm/exe_format/serialstruct'
require... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.