GP-253, GP-725 Gfilesystem ByteProviders, obfuscated temp files, passwords

Migrate GFilesystem methods to use ByteProviders instead of java Files for their source, and to produce ByteProviders instead of InputStreams.

Refactor file info query method to return a structured collection of enum specified meta data instead of a free-form multiline string.

Add locked icon badge to files in the file system browser that are password protected.

Reduces the number of temp files created on disk, and obfuscates files that are created to avoid the wrath of virus scanners (in the same manner that ghidra db files are obfuscated).

Add support for filesystems to query for passwords to decrypt files.

Refactor the SevenZipFileSystem implementation to decrypt files embedded inside zips that were created with passwords.

Fix Ext4 to support 128 byte inodes.
This commit is contained in:
dev747368 2021-10-01 10:09:38 -04:00
parent a0afc0b8c2
commit 72fe7b89d2
156 changed files with 7948 additions and 4714 deletions

View file

@ -15,12 +15,12 @@
*/
package ghidra.util;
import ghidra.util.exception.IOCancelledException;
import ghidra.util.task.TaskMonitor;
import java.io.IOException;
import java.io.OutputStream;
import ghidra.util.exception.IOCancelledException;
import ghidra.util.task.TaskMonitor;
/**
* An OutputStream which utilizes a TaskMonitor to indicate output progress and
* allows the operation to be cancelled via the TaskMonitor.
@ -32,20 +32,13 @@ public class MonitoredOutputStream extends OutputStream {
protected OutputStream out;
private TaskMonitor monitor;
private int smallCount = 0;
private int count = 0;
private long count = 0;
public MonitoredOutputStream(OutputStream out, TaskMonitor monitor) {
this.out = out;
this.monitor = monitor;
}
/**
* Reset the current progress count to the specified value.
*/
public void setProgress(int count) {
this.count = count;
}
/**
* Writes the specified <code>byte</code> to this output stream.
* <p>
@ -63,8 +56,9 @@ public class MonitoredOutputStream extends OutputStream {
out.write(b);
++smallCount;
if (smallCount >= PROGRESS_INCREMENT) {
if (monitor.isCancelled())
if (monitor.isCancelled()) {
throw new IOCancelledException();
}
count += smallCount;
smallCount = 0;
monitor.setProgress(count);
@ -118,8 +112,9 @@ public class MonitoredOutputStream extends OutputStream {
smallCount += len;
if (smallCount >= PROGRESS_INCREMENT) {
if (monitor.isCancelled())
if (monitor.isCancelled()) {
throw new IOCancelledException();
}
count += smallCount;
smallCount = 0;
monitor.setProgress(count);