From 70b463b2574e2d2faf64254add0a88c122c2b692 Mon Sep 17 00:00:00 2001 From: James Lee Date: Sun, 20 Nov 2011 11:39:27 +1100 Subject: [PATCH] msftidy run --- .../extensions/stdapi/net/socket.rb | 2 +- .../meterpreter/extensions/stdapi/stdapi.rb | 6 +++--- .../extensions/stdapi/sys/event_log.rb | 6 +++--- .../sys/event_log_subsystem/event_record.rb | 12 +++++------ .../stdapi/sys/process_subsystem/memory.rb | 20 +++++++++---------- .../stdapi/sys/process_subsystem/thread.rb | 4 ++-- .../sys/registry_subsystem/registry_key.rb | 6 +++--- .../sys/registry_subsystem/registry_value.rb | 4 ++-- .../registry_subsystem/remote_registry_key.rb | 6 +++--- .../extensions/stdapi/sys/thread.rb | 12 +++++------ 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb b/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb index 2f9b39ae51..a95ac226bd 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb @@ -71,7 +71,7 @@ class Socket res = create_tcp_client_channel( params ) end elsif( params.udp? ) - res = create_udp_channel( params ) + res = create_udp_channel( params ) end return res diff --git a/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb b/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb index 969af266f6..1c99e6f808 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb @@ -43,7 +43,7 @@ class Stdapi < Extension # can be directly referenced client.register_extension_aliases( [ - { + { 'name' => 'fs', 'ext' => ObjectAliases.new( { @@ -70,7 +70,7 @@ class Stdapi < Extension 'config' => Rex::Post::Meterpreter::Extensions::Stdapi::Net::Config.new(client), 'socket' => Rex::Post::Meterpreter::Extensions::Stdapi::Net::Socket.new(client) }) - }, + }, { 'name' => 'railgun', 'ext' => Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Railgun.new(client) @@ -146,4 +146,4 @@ class Stdapi < Extension end end -end; end; end; end; end \ No newline at end of file +end; end; end; end; end diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb index 86e042a090..80f9a1e1de 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb @@ -16,7 +16,7 @@ module Sys ### # -# This class provides access to the Windows event log on the remote +# This class provides access to the Windows event log on the remote # machine. # ### @@ -52,7 +52,7 @@ class EventLog attr_accessor :handle # :nodoc: attr_accessor :client # :nodoc: - public + public # # Initializes an instance of the eventlog manipulator. @@ -182,7 +182,7 @@ class EventLog response = client.send_request(request, nil) return nil end - + # Instance method def close self.class.close(self.client, self.handle) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb index 1b7c669980..45ad8f7013 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb @@ -15,15 +15,15 @@ module EventLogSubsystem ### class EventRecord - attr_reader :num, :generated, :written, :eventid, - :type, :category, :strings, :data + attr_reader :num, :generated, :written, :eventid + attr_reader :type, :category, :strings, :data protected - attr_writer :num, :generated, :written, :eventid, - :type, :category, :strings, :data + attr_writer :num, :generated, :written, :eventid + attr_writer :type, :category, :strings, :data - public + public def initialize(recnum, timegen, timewri, id, type, cat, strs, data) self.num = recnum @@ -38,4 +38,4 @@ class EventRecord end -end end end end end end end \ No newline at end of file +end end end end end end end diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb index a38b4e7d51..a127c566c4 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb @@ -22,17 +22,17 @@ class Memory # Page protection translation hash @@page_protection_map = - { + { PROT_NONE => PAGE_NOACCESS, PROT_EXEC => PAGE_EXECUTE, PROT_EXEC | PROT_READ => PAGE_EXECUTE_READ, - PROT_EXEC | PROT_READ | + PROT_EXEC | PROT_READ | PROT_WRITE => PAGE_EXECUTE_READWRITE, - PROT_EXEC | PROT_READ | + PROT_EXEC | PROT_READ | PROT_WRITE | PROT_COW => PAGE_EXECUTE_WRITECOPY, PROT_READ => PAGE_READONLY, PROT_READ | PROT_WRITE => PAGE_READWRITE, - PROT_READ | PROT_WRITE | + PROT_READ | PROT_WRITE | PROT_COW => PAGE_WRITECOPY, PROT_WRITE => PAGE_READWRITE } @@ -52,10 +52,10 @@ class Memory end # - # Allocate storage of the supplied length and returns the + # Allocate storage of the supplied length and returns the # address at which the memory was allocated. # - def allocate(length, protection = nil, base = nil) + def allocate(length, protection = nil, base = nil) allocation_type = MEM_COMMIT # If no protection was supplied, default to the most flexible @@ -225,7 +225,7 @@ class Memory end # - # Lock a region of memory into physical memory so that it can't be + # Lock a region of memory into physical memory so that it can't be # swapped to disk. This can only be done in the context of the # process that is running the meterpreter server. The instance's # handle is ignored. @@ -242,7 +242,7 @@ class Memory end # - # Unloock a region of memory into physical memory so that it can be + # Unloock a region of memory into physical memory so that it can be # swapped to disk. This can only be done in the context of the # process that is running the meterpreter server. The instance's # handle is ignored. @@ -322,7 +322,7 @@ protected # Translates specific protection flags to general protection flags. # def specific_prot_to_gen(prot) - + if (prot == nil) return PAGE_READONLY end @@ -333,4 +333,4 @@ protected attr_accessor :process # :nodoc: end -end; end; end; end; end; end; end \ No newline at end of file +end; end; end; end; end; end; end diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb index c0037df1f9..ee7c8b8303 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb @@ -97,7 +97,7 @@ class Thread request.add_tlv(TLV_TYPE_CREATION_FLAGS, creation_flags) # Transmit the request - response = process.client.send_request(request) + response = process.client.send_request(request) thread_id = response.get_tlv_value(TLV_TYPE_THREAD_ID) @@ -138,4 +138,4 @@ protected end -end; end; end; end; end; end; end \ No newline at end of file +end; end; end; end; end; end; end diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb index 1080568079..9430f6ed7d 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb @@ -29,7 +29,7 @@ class RegistryKey self.base_key = base_key self.perm = perm self.hkey = hkey - + ObjectSpace.define_finalizer( self, self.class.finalize(self.client, self.hkey) ) end @@ -110,9 +110,9 @@ class RegistryKey return client.sys.registry.close_key(hkey) end - return false + return false end - + # Instance method for the same def close() self.class.close(self.client, self.hkey) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb index a22bd0e1d4..96850a389b 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb @@ -28,7 +28,7 @@ class RegistryValue self.name = name self.type = type self.data = data - end + end # # Sets the value's data. @@ -99,4 +99,4 @@ protected attr_writer :hkey, :name, :type, :data # :nodoc: end -end; end; end; end; end; end; end \ No newline at end of file +end; end; end; end; end; end; end diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/remote_registry_key.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/remote_registry_key.rb index a8761a1c6d..fd7672bfcf 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/remote_registry_key.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/remote_registry_key.rb @@ -28,7 +28,7 @@ class RemoteRegistryKey self.root_key = root_key self.target_host = target_host self.hkey = hkey - + ObjectSpace.define_finalizer( self, self.class.finalize(self.client, self.hkey) ) end @@ -109,9 +109,9 @@ class RemoteRegistryKey return client.sys.registry.close_key(hkey) end - return false + return false end - + # Instance method for the same def close() self.class.close(self.client, self.hkey) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb index f89b4fc027..fae12eedcc 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb @@ -13,7 +13,7 @@ module Sys ## # -# This class implements the Rex::Post::Thread interface which +# This class implements the Rex::Post::Thread interface which # wrappers a logical thread for a given process. # ## @@ -123,7 +123,7 @@ class Thread < Rex::Post::Thread # Add all of the register that we're setting regs_hash.each_key { |name| t = request.add_tlv(TLV_TYPE_REGISTER) - + t.add_tlv(TLV_TYPE_REGISTER_NAME, name) t.add_tlv(TLV_TYPE_REGISTER_VALUE_32, regs_hash[name]) } @@ -139,13 +139,13 @@ class Thread < Rex::Post::Thread def pretty_regs regs = query_regs - buf = sprintf("eax=%.8x ebx=%.8x ecx=%.8x edx=%.8x esi=%.8x edi=%.8x\n", + buf = sprintf("eax=%.8x ebx=%.8x ecx=%.8x edx=%.8x esi=%.8x edi=%.8x\n", regs['eax'], regs['ebx'], regs['ecx'], regs['edx'], regs['esi'], regs['edi']) buf += sprintf("eip=%.8x esp=%.8x ebp=%.8x\n", regs['eip'], regs['esp'], regs['ebp']) buf += sprintf("cs=%.4x ss=%.4x ds=%.4x es=%.4x fs=%.4x gs=%.4x\n", regs['cs'], regs['ss'], regs['ds'], regs['es'], regs['fs'], regs['gs']) - + return buf end @@ -165,14 +165,14 @@ class Thread < Rex::Post::Thread handle = nil return true end - + # Instance method def close self.class.close(self.process.client, self.handle) end attr_reader :process, :handle, :tid # :nodoc: -protected +protected attr_writer :process, :handle, :tid # :nodoc: end