samples/elfencode.rb in metasm-1.0.2 vs samples/elfencode.rb in metasm-1.0.3
- old
+ new
@@ -12,14 +12,29 @@
__END__
.pt_gnu_stack rw
// .nointerp // to disable the dynamic section, eg for stuff with int80 only
.text
.entrypoint
+#if defined __i386__
push bla
push fmt
call printf
+
push 0
call exit
+
+#elif defined __amd64__
+lea rsi, [rip+bla-$_]
+lea rdi, [rip+fmt-$_]
+xor rax, rax
+call printf
+
+mov rdi, 0
+call exit
+
+#else
+unsupported architecture!
+#endif
.data
bla db "world", 0
fmt db "Hello, %s !\n", 0