|
2 | 2 | using System.Diagnostics; |
3 | 3 | using System.Threading; |
4 | 4 | using ZenStates.Core; |
5 | | -using ZenTimings.Decompressor; |
6 | 5 |
|
7 | 6 | namespace ZenTimings |
8 | 7 | { |
@@ -59,40 +58,40 @@ public static byte[] DumpImage() |
59 | 58 | /// <summary> |
60 | 59 | /// Finds the AGESA version string in a BIOS image. |
61 | 60 | /// </summary> |
62 | | - public static string FindAgesaVersion(byte[] image) |
63 | | - { |
64 | | - const string AGESA_UNKNOWN = AppSettings.AGESA_UNKNOWN; |
| 61 | + //public static string FindAgesaVersion(byte[] image) |
| 62 | + //{ |
| 63 | + // const string AGESA_UNKNOWN = AppSettings.AGESA_UNKNOWN; |
65 | 64 |
|
66 | | - if (image == null || image.Length == 0) |
67 | | - return AGESA_UNKNOWN; |
| 65 | + // if (image == null || image.Length == 0) |
| 66 | + // return AGESA_UNKNOWN; |
68 | 67 |
|
69 | | - try |
70 | | - { |
71 | | - // Find the GUID in the BIOS data |
72 | | - byte[] fileGuid = new Guid("9E21FD93-9C72-4C15-8C4B-E77F1DB2D792").ToByteArray(); |
73 | | - int fileOffset = Utils.FindSequence(image, 0, fileGuid); |
74 | | - if (fileOffset == -1) return AGESA_UNKNOWN; |
| 68 | + // try |
| 69 | + // { |
| 70 | + // // Find the GUID in the BIOS data |
| 71 | + // byte[] fileGuid = new Guid("9E21FD93-9C72-4C15-8C4B-E77F1DB2D792").ToByteArray(); |
| 72 | + // int fileOffset = Utils.FindSequence(image, 0, fileGuid); |
| 73 | + // if (fileOffset == -1) return AGESA_UNKNOWN; |
75 | 74 |
|
76 | | - // Read compressed size |
77 | | - int compressedSize = BitConverter.ToInt32(image, fileOffset + HeaderSize) & 0xFFFFFF; |
78 | | - //int decompressedSize = BitConverter.ToInt32(image, fileOffset + 0x35) & 0xFFFFFF; |
79 | | - // Start of lzma block |
80 | | - int lzmaStart = fileOffset + 0x30; |
| 75 | + // // Read compressed size |
| 76 | + // int compressedSize = BitConverter.ToInt32(image, fileOffset + HeaderSize) & 0xFFFFFF; |
| 77 | + // //int decompressedSize = BitConverter.ToInt32(image, fileOffset + 0x35) & 0xFFFFFF; |
| 78 | + // // Start of lzma block |
| 79 | + // int lzmaStart = fileOffset + 0x30; |
81 | 80 |
|
82 | | - byte[] compressedData = new byte[compressedSize]; |
83 | | - Array.Copy(image, lzmaStart, compressedData, 0, compressedSize); |
| 81 | + // byte[] compressedData = new byte[compressedSize]; |
| 82 | + // Array.Copy(image, lzmaStart, compressedData, 0, compressedSize); |
84 | 83 |
|
85 | | - byte[] decompressedData = LZMACompressor.Decompress(compressedData); |
| 84 | + // byte[] decompressedData = LZMACompressor.Decompress(compressedData); |
86 | 85 |
|
87 | | - return AgesaUtils.ParseVersion(decompressedData); |
88 | | - } |
89 | | - catch (Exception ex) |
90 | | - { |
91 | | - Console.WriteLine($"FindAgesaVersion error: {ex.Message}"); |
92 | | - } |
| 86 | + // return AgesaUtils.ParseVersion(decompressedData); |
| 87 | + // } |
| 88 | + // catch (Exception ex) |
| 89 | + // { |
| 90 | + // Console.WriteLine($"FindAgesaVersion error: {ex.Message}"); |
| 91 | + // } |
93 | 92 |
|
94 | | - return AGESA_UNKNOWN; |
95 | | - } |
| 93 | + // return AGESA_UNKNOWN; |
| 94 | + //} |
96 | 95 |
|
97 | 96 | public static string FindAgesaVersionInMemory() |
98 | 97 | { |
|
0 commit comments