Sha256: a2525bb429c71c21c2c1eca3bc7617e76df0fcbe6d30f227abe6e7b9290bafb7
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
# 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 EBPF < CPU class Reg attr_accessor :v def initialize(v) @v = v end def symbolic(di=nil) ; "r#@v".to_sym ; end end class Memref attr_accessor :base, :offset, :msz def initialize(base, offset, msz) @base = base @offset = offset @msz = msz end def symbolic(di=nil) p = Expression[@base.symbolic] if base p = Expression[p, :+, @offset] if offset Indirection[p, @msz, (di.address if di)] end end class Pktref < Memref def symbolic(di=nil) p = Expression[:packet] p = Expression[p, :+, @base.symbolic] if base p = Expression[p, :+, @offset] if offset Indirection[p, @msz, (di.address if di)] end end def initialize(family = :latest, endianness = :big) super() @endianness = endianness @size = 64 @family = family end def init_opcode_list send("init_#@family") @opcode_list end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
metasm-1.0.5 | metasm/cpu/ebpf/main.rb |
metasm-1.0.4 | metasm/cpu/ebpf/main.rb |