Files
metasploit-gs/lib/metasm/samples/elfencode-c.rb
T
HD Moore 7a04d3fbad Merge metasm back in (fresh copy, no HG stuff)
git-svn-id: file:///home/svn/framework3/trunk@5356 4d416f70-5f16-0410-b530-b9f4589650da
2008-01-26 09:57:05 +00:00

23 lines
420 B
Ruby

#!/usr/bin/env ruby
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2007 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm'
elf = Metasm::ELF.compile_c(Metasm::Ia32.new, DATA.read)
elf.encode_file('sampelf-c')
__END__
int printf(char *fmt, ...);
void exit(int);
int main(void)
{
printf("Hello, %s !\n", "world");
exit(0x28);
}