Added a second script to find paths with above 260 characters.

This commit is contained in:
2015-04-01 07:52:32 -04:00
parent cbb5de439a
commit 7f92619623
6 changed files with 56 additions and 7 deletions

View File

@@ -26,10 +26,7 @@ class Cryptowallfinder
def writeMyFile(whatToWrite)
if !isDecryptInstructions(whatToWrite) && !isTorInstructions(whatToWrite)
whatToWrite = infectedFileExpandedPath(whatToWrite)
whatToWrite = whatToWrite.gsub("/","\\")
@openFile = self.outputFile.open
@openFile.puts(whatToWrite)
@openFile.close
self.outputFile.writeWindowsFilePath(whatToWrite)
end
end

View File

@@ -12,4 +12,10 @@ class Filecreate
openFile = File.open(self.filename,"a")
return openFile
end
def writeWindowsFilePath(whatToWrite)
whatToWrite = whatToWrite.gsub("/","\\")
self.open.puts(whatToWrite)
self.open.close
end
end

22
source/filepath.rb Normal file
View File

@@ -0,0 +1,22 @@
require_relative 'windowsFileSystem'
require_relative 'filesUtil'
require_relative 'filecreate'
@outputFile = Filecreate.new
@outputFile.filename = "files.txt"
@outputFile.create
@filesUtil = Filesutil.new
@fileSystem = Windowsfilesystem.new
@drives = @fileSystem.allDrives
@drives.each do |drive|
#puts drive.DriveLetter
#puts drive.DriveType
if drive.DriveType == 2
@files = @filesUtil.findFilesByFileName(drive.Path,'*.*')
@filesTooLong = @files.select{|f| @filesUtil.getExpandedPathByFileName(f).length > 260}
@filesTooLong.each do |file|
@whatToWrite = @filesUtil.getExpandedPathByFileName(file)
@outputFile.writeWindowsFilePath(@whatToWrite)
end
end
end