Skip to content

Commit

Permalink
remove BinaryCache.FilepathDatabase to disable loading cache by fil…
Browse files Browse the repository at this point in the history
…e path

fix lucasg#54 lucasg#225 lucasg#231 Refresh or reopening a dll does not refresh the display
  • Loading branch information
viruscamp committed May 13, 2024
1 parent 1997a40 commit d896870
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions DependenciesLib/BinaryCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ public BinaryCacheImpl(string ApplicationAppDataPath, int _MaxBinaryCount)
{

BinaryDatabase = new Dictionary<string, PE>();
FilepathDatabase = new Dictionary<string, PE>();
BinaryDatabaseLock = new Object();
LruCache = new List<string>();

Expand Down Expand Up @@ -379,7 +378,6 @@ public override void Unload()

// flush the cache
BinaryDatabase.Clear();
FilepathDatabase.Clear();
}

public void GetBinaryAsync(string PePath, RunWorkerCompletedEventHandler Callback = null)
Expand Down Expand Up @@ -409,15 +407,6 @@ public override PE GetBinary(string PePath)
return null;
}

string Fullpath = Path.GetFullPath(PePath);
if (FilepathDatabase.ContainsKey(Fullpath))
{
// TODO : update LRU cache
PE sShadowBinary = FilepathDatabase[Fullpath];
sShadowBinary.Filepath = Fullpath;
return sShadowBinary;
}

string PeHash = GetBinaryHash(PePath);
//Debug.WriteLine(String.Format("File {0:s} hash : {1:s} ", PePath, PeHash), "BinaryCache");

Expand All @@ -443,7 +432,6 @@ public override PE GetBinary(string PePath)

LruCache.Add(PeHash);
BinaryDatabase.Add(PeHash, NewShadowBinary);
FilepathDatabase.Add(Fullpath, NewShadowBinary);
}
}

Expand Down Expand Up @@ -478,7 +466,6 @@ protected void UpdateLru(string PeHash)
#region Members
private List<string> LruCache;
private Dictionary<string, PE> BinaryDatabase;
private Dictionary<string, PE> FilepathDatabase;
private Object BinaryDatabaseLock;

private string BinaryCacheFolderPath;
Expand Down

0 comments on commit d896870

Please sign in to comment.