mirror of
https://github.com/DMaroo/GhidRust.git
synced 2025-09-10 04:53:36 +02:00
Remove local file logging
This commit is contained in:
@@ -28,14 +28,9 @@ import ghidra.util.task.TaskMonitor;
|
|||||||
import ghidra.feature.fid.db.FidFileManager;
|
import ghidra.feature.fid.db.FidFileManager;
|
||||||
import ghidra.framework.Application;
|
import ghidra.framework.Application;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
public class RustStdAnalyzer extends AbstractAnalyzer {
|
public class RustStdAnalyzer extends AbstractAnalyzer {
|
||||||
private static final String filePath = "/home/dhruv/Education/CS4900/Work/GhidRust/tmp/logs";
|
|
||||||
private static BufferedWriter writer;
|
|
||||||
private static final byte[][] rust_artifacts = {
|
private static final byte[][] rust_artifacts = {
|
||||||
"run with `RUST_BACKTRACE=1` environment variable".getBytes(),
|
"run with `RUST_BACKTRACE=1` environment variable".getBytes(),
|
||||||
"called `Option::unwrap()` on a `None` value".getBytes(),
|
"called `Option::unwrap()` on a `None` value".getBytes(),
|
||||||
@@ -56,12 +51,6 @@ public class RustStdAnalyzer extends AbstractAnalyzer {
|
|||||||
* with our own Function ID databases.
|
* with our own Function ID databases.
|
||||||
*/
|
*/
|
||||||
setPriority(AnalysisPriority.FUNCTION_ID_ANALYSIS.before().before());
|
setPriority(AnalysisPriority.FUNCTION_ID_ANALYSIS.before().before());
|
||||||
|
|
||||||
try {
|
|
||||||
writer = new BufferedWriter(new FileWriter(filePath, true));
|
|
||||||
} catch (IOException exc) {
|
|
||||||
// pass
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -112,12 +101,6 @@ public class RustStdAnalyzer extends AbstractAnalyzer {
|
|||||||
@Override
|
@Override
|
||||||
public void analysisEnded(Program program) {
|
public void analysisEnded(Program program) {
|
||||||
super.analysisEnded(program);
|
super.analysisEnded(program);
|
||||||
|
|
||||||
try {
|
|
||||||
writer.close();
|
|
||||||
} catch (IOException exc) {
|
|
||||||
// pass
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For exposing the Rust checking code */
|
/* For exposing the Rust checking code */
|
||||||
@@ -127,7 +110,7 @@ public class RustStdAnalyzer extends AbstractAnalyzer {
|
|||||||
* https://github.com/mandiant/capa-rules/blob/master/compiler/rust/compiled-
|
* https://github.com/mandiant/capa-rules/blob/master/compiler/rust/compiled-
|
||||||
* with-rust.yml
|
* with-rust.yml
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Address start_search = program.getMinAddress();
|
Address start_search = program.getMinAddress();
|
||||||
for (byte[] search_string : rust_artifacts) {
|
for (byte[] search_string : rust_artifacts) {
|
||||||
Address found_addr = program.getMemory().findBytes(start_search, search_string, null, true, null);
|
Address found_addr = program.getMemory().findBytes(start_search, search_string, null, true, null);
|
||||||
|
Reference in New Issue
Block a user