From b7fb95b3024d81932a72fc7f92e7831dc0c32f90 Mon Sep 17 00:00:00 2001 From: Stephen Fewer Date: Mon, 25 Jan 2010 10:49:51 +0000 Subject: [PATCH] fix for ps bug on OSX git-svn-id: file:///home/svn/framework3/trunk@8220 4d416f70-5f16-0410-b530-b9f4589650da --- .../meterpreter/extensions/stdapi/sys/process.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb index 202bf28ce2..e9f4741762 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb @@ -26,12 +26,7 @@ module Sys class Process < Rex::Post::Process include Rex::Post::Meterpreter::ObjectAliasesContainer - - PROCESS_ARCH_UNKNOWN = 0 - PROCESS_ARCH_X86 = 1 - PROCESS_ARCH_X64 = 2 - PROCESS_ARCH_IA64 = 3 - + ## # # Class methods @@ -212,7 +207,7 @@ class Process < Rex::Post::Process # # Returns an array of processes with hash objects that have - # keys for 'pid', 'name', and 'path'. + # keys for 'pid', 'parentid', 'name', 'path', 'user' and 'arch'. # def Process.get_processes request = Packet.create_request('stdapi_sys_process_get_processes') @@ -225,9 +220,9 @@ class Process < Rex::Post::Process pa = p.get_tlv_value( TLV_TYPE_PROCESS_ARCH ) if( pa != nil ) - if pa == PROCESS_ARCH_X86 + if pa == 1 # PROCESS_ARCH_X86 arch = ARCH_X86 - elsif pa == PROCESS_ARCH_X64 + elsif pa == 2 # PROCESS_ARCH_X64 arch = ARCH_X86_64 end end