Files
metasploit-gs/lib/metasm/samples/dasm-backtrack.rb
T
HD Moore 4a204efaa1 Import the new METASM code
git-svn-id: file:///home/svn/framework3/trunk@5008 4d416f70-5f16-0410-b530-b9f4589650da
2007-06-30 21:53:26 +00:00

36 lines
541 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
#
# quick demonstration that the disassembler's backtracker works
#
require 'metasm-shell'
puts <<EOS.encode.decode
.base_addr 0
; compute jump target
mov ebx, 0x12345678
mov eax, ((toto + 12) ^ 0x12345678)
xor eax, ebx
sub eax, 12
; jump
call eax
; trap
add eax, 42
; die, you vile reverser !
db 0e9h
; real target
toto:
mov eax, 28h
EOS