public static MethodRecord getMRFromFile(string mr_sha) { if (!File.Exists(methodsFolder + "\\" + mr_sha + ".txt")) { DLLServerDownloader.downloadMethodRecord(mr_sha); } string[] lines = System.IO.File.ReadAllLines(methodsFolder + "\\" + mr_sha + ".txt"); string shaR = lines[0]; string shaD = lines[1]; string m = lines[2]; string[] method = m.Split(new char[] { ' ', ')', '(' }); string returnN = method[0]; string classN = method[1]; string rootClassN = method[2]; string methodN = method[3]; string param = method[4]; MethodRecord mr = new MethodRecord(classN, rootClassN, methodN, param, returnN, shaD); return(mr); }
public static List <MethodRecord> getDehashedRecords(ConcurrentDictionary <string, MethodRecord> methodSHADictKEYSHA, CST_MSG msg) { List <MethodRecord> mrList = new List <MethodRecord>(); string[] sha_methods = msg.SymT.Split(new char[] { ' ', '(', ')' }, StringSplitOptions.RemoveEmptyEntries); foreach (string method in sha_methods) { string[] partyNameSplit = method.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries); if (partyNameSplit.Length <= 1) { continue; } string stripped_method = partyNameSplit[1]; MethodRecord mr = null; if (!methodSHADictKEYSHA.ContainsKey(stripped_method)) { if (!File.Exists(methodsFolder + @"\" + stripped_method + ".txt")) { DLLServerDownloader.downloadMethodRecord(stripped_method); } mr = MethodHasher.getMRFromFile(stripped_method); } else { mr = methodSHADictKEYSHA[stripped_method]; } if (!Directory.Exists(dllsFolder + @"\" + mr.SHA_of_DLL)) { DLLServerDownloader.downloadDLLandDep(mr.SHA_of_DLL); } mrList.Add(mr); } return(mrList); }