Sha256: 201b04e4f0454ebfe403c50e7d8f484e4d007b9dccf130cc77232e32d4ecb813

Contents?: true

Size: 751 Bytes

Versions: 3

Compression:

Stored size: 751 Bytes

Contents

#    This file is part of Metasm, the Ruby assembly manipulation suite
#    Copyright (C) 2015 Google
#
#    Licence is LGPL, see LICENCE in the top-level directory

require 'test/unit'
require 'metasm'


class TestMCS51 < Test::Unit::TestCase
	def test_mcs51_dec
		hex_stream =  "\x09\x00\x1F" # inc; nop; dec
		hex_stream += "\x58\xF9\xEC\x32\x36\xc4\xa5\x24\x02\x45\x03"
		hex_stream += "\x84\xa4\xc5\xa5\x70\xfe"
		hex_stream += "\xba\x04\x08"
		hex_stream += "\xc0\x04"
		hex_stream += "\x11\x23"
		hex_stream += "\xa1\x88"
		hex_stream += "\x62\x88"
		hex_stream += "\x53\x79\x66"
		hex_stream += "\x02\x12\x34"

		dasm = Metasm::Shellcode.disassemble(Metasm::MCS51.new, hex_stream)
		#puts dasm
		assert_equal(23, dasm.decoded.length)
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metasm-1.0.5 tests/mcs51.rb
metasm-1.0.4 tests/mcs51.rb
metasm-1.0.3 tests/mcs51.rb