-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlast_modified.patch
41 lines (36 loc) · 1.53 KB
/
last_modified.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From c351c931f274e973555dc16274493ec29ef8b695 Mon Sep 17 00:00:00 2001
From: Matthieu CHARETTE <[email protected]>
Date: Fri, 29 Sep 2023 23:09:31 +0200
Subject: [PATCH] Add support for OSTree's lack of mtime
See https://github.com/NationalSecurityAgency/ghidra/pull/4107
---
.../src/main/java/generic/jar/ResourceFile.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Ghidra/Framework/Utility/src/main/java/generic/jar/ResourceFile.java b/Ghidra/Framework/Utility/src/main/java/generic/jar/ResourceFile.java
index 022b16c7a5ee..7e514f4158f9 100644
--- a/Ghidra/Framework/Utility/src/main/java/generic/jar/ResourceFile.java
+++ b/Ghidra/Framework/Utility/src/main/java/generic/jar/ResourceFile.java
@@ -33,6 +33,7 @@ public class ResourceFile implements Comparable<ResourceFile> {
private static final String JAR_FILE_PREFIX = "jar:file:";
private Resource resource;
private static Map<String, JarResource> jarRootsMap = new HashMap<>();
+ private long lastModifiedTime;
/**
* Construct a ResourceFile that represents a normal file in the file system.
@@ -185,7 +186,14 @@ public class ResourceFile implements Comparable<ResourceFile> {
* @return the time that this file was last modified.
*/
public long lastModified() {
- return resource.lastModified();
+ long modTime = resource.lastModified();
+ if (modTime == 0) {
+ if (lastModifiedTime == 0) {
+ lastModifiedTime = System.currentTimeMillis();
+ }
+ modTime = lastModifiedTime;
+ }
+ return modTime;
}
/**
--
2.41.0