# 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 # shows the compilation phase step by step: c, simplified c, asm require 'metasm' require 'optparse' opts = { :cpu => 'Ia32', :exe => 'Shellcode' } OptionParser.new { |opt| opt.on('--pic', 'generate position-independant code') { opts[:pic] = true } opt.on('--cpu cpu') { |c| opts[:cpu] = c } opt.on('--exe exe') { |e| opts[:exe] = e } opt.on('-v') { $VERBOSE = true } opt.on('-d') { $VERBOSE = $DEBUG = true } }.parse!(ARGV) src = ARGV.empty? ? <