From 2fd4bf15798cd7ba82f96f0b41e36efd7d5cb485 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 16 Jul 2007 01:23:17 +0000 Subject: [PATCH] Adds support for array arguments to Rex::Arch.endian(). This solves a problem where some exploits choose the wrong unescape method. git-svn-id: file:///home/svn/framework3/trunk@5050 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/arch.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/rex/arch.rb b/lib/rex/arch.rb index 806a3e5903..33d1a2df4c 100644 --- a/lib/rex/arch.rb +++ b/lib/rex/arch.rb @@ -50,6 +50,11 @@ module Arch # This routine reports the endianess of a given architecture # def self.endian(arch) + + if ( arch.is_a?(::Array)) + arch = arch[0] + end + case arch when ARCH_X86 return ENDIAN_LITTLE @@ -60,6 +65,9 @@ module Arch when ARCH_SPARC return ENDIAN_BIG end + + p "XXXXXXXXXXXXXXXXXXX" + p arch return ENDIAN_LITTLE end