Files
metasploit-gs/lib/metasm/samples/elfencode.rb
T

26 lines
548 B
Ruby
Raw Normal View History

2009-03-29 07:30:54 +00:00
#!/usr/bin/env ruby
# This file is part of Metasm, the Ruby assembly manipulation suite
2010-09-09 18:19:35 +00:00
# Copyright (C) 2006-2009 Yoann GUILLOT
2009-03-29 07:30:54 +00:00
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm'
2010-09-09 18:19:35 +00:00
$opts = { :execlass => Metasm::ELF, :exetype => :lib }
2009-03-29 07:30:54 +00:00
load File.join(File.dirname(__FILE__), 'exeencode.rb')
__END__
.pt_gnu_stack rw
2010-09-09 18:19:35 +00:00
// .nointerp // to disable the dynamic section, eg for stuff with int80 only
2009-03-29 07:30:54 +00:00
.text
.entrypoint
2010-09-09 18:19:35 +00:00
push bla
push fmt
call printf
push 0
call exit
2009-03-29 07:30:54 +00:00
2010-09-09 18:19:35 +00:00
.data
bla db "world", 0
fmt db "Hello, %s !\n", 0