Added a second script to find paths with above 260 characters.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
22
source/filepath.rb
Normal 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
|
||||
Reference in New Issue
Block a user