🐛Fix static method on hashes not being declared as such.

This commit is contained in:
2018-02-03 19:11:41 +00:00
parent c06fc84348
commit 4194566a20
36 changed files with 194 additions and 271 deletions

View File

@@ -704,7 +704,6 @@ namespace DiscImageChef.Filesystems
ulong rootDirectorySector = 0;
string extraInfo = null;
string bootChk = null;
Sha1Context sha1Ctx = new Sha1Context();
// This is needed because for FAT16, GEMDOS increases bytes per sector count instead of using big_sectors field.
uint sectorsPerRealSector;
@@ -1036,9 +1035,9 @@ namespace DiscImageChef.Filesystems
{
XmlFsType.VolumeName = Encoding.ASCII.GetString(fat32Bpb.volume_label);
sb.AppendFormat("Filesystem type: {0}", Encoding.ASCII.GetString(fat32Bpb.fs_type)).AppendLine();
bootChk = sha1Ctx.Data(fat32Bpb.boot_code, out _);
bootChk = Sha1Context.Data(fat32Bpb.boot_code, out _);
}
else bootChk = sha1Ctx.Data(shortFat32Bpb.boot_code, out _);
else bootChk = Sha1Context.Data(shortFat32Bpb.boot_code, out _);
// Check that jumps to a correct boot code position and has boot signature set.
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
@@ -1426,7 +1425,7 @@ namespace DiscImageChef.Filesystems
else if(useAtariBpb && XmlFsType.VolumeSerial != null)
sb.AppendFormat("Volume Serial Number: {0}", XmlFsType.VolumeSerial).AppendLine();
bootChk = sha1Ctx.Data(fakeBpb.boot_code, out _);
bootChk = Sha1Context.Data(fakeBpb.boot_code, out _);
// Workaround that PCExchange jumps into "FAT16 "...
if(XmlFsType.SystemIdentifier == "PCX 2.0 ") fakeBpb.jump[1] += 8;
@@ -1525,9 +1524,7 @@ namespace DiscImageChef.Filesystems
int sigSize = bpbSector[510] == 0x55 && bpbSector[511] == 0xAA ? 2 : 0;
byte[] bootCode = new byte[512 - sigSize - bpbSector[1] - 2];
Array.Copy(bpbSector, bpbSector[1] + 2, bootCode, 0, bootCode.Length);
sha1Ctx = new Sha1Context();
sha1Ctx.Update(bootCode);
bootChk = sha1Ctx.End();
Sha1Context.Data(bootCode, out _);
}
// Intel big jump
else if(bpbSector[0] == 0xE9 && BitConverter.ToUInt16(bpbSector, 1) < 0x1FC)
@@ -1536,9 +1533,7 @@ namespace DiscImageChef.Filesystems
byte[] bootCode = new byte[512 - sigSize - BitConverter.ToUInt16(bpbSector, 1) - 3];
Array.Copy(bpbSector, BitConverter.ToUInt16(bpbSector, 1) + 3, bootCode, 0,
bootCode.Length);
sha1Ctx = new Sha1Context();
sha1Ctx.Update(bootCode);
bootChk = sha1Ctx.End();
Sha1Context.Data(bootCode, out _);
}
sb.AppendLine("Volume is bootable");

View File

@@ -186,8 +186,7 @@ namespace DiscImageChef.Filesystems
hpfsBpb.signature2 == 0xAA55)
{
XmlFsType.Bootable = true;
Sha1Context sha1Ctx = new Sha1Context();
string bootChk = sha1Ctx.Data(hpfsBpb.boot_code, out byte[] sha1_out);
string bootChk = Sha1Context.Data(hpfsBpb.boot_code, out byte[] _);
sb.AppendLine("Volume is bootable");
sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine();
}

View File

@@ -567,8 +567,7 @@ namespace DiscImageChef.Filesystems.ISO9660
if(torito != null)
{
vdSector = imagePlugin.ReadSector(torito.Value.catalog_sector + partition.Start);
Sha1Context sha1Ctx = new Sha1Context();
vdSector = imagePlugin.ReadSector(torito.Value.catalog_sector + partition.Start);
int toritoOff = 0;
@@ -642,7 +641,7 @@ namespace DiscImageChef.Filesystems.ISO9660
isoMetadata.AppendFormat("\tSystem type: 0x{0:X2}", initialEntry.system_type).AppendLine();
if(bootImage != null)
isoMetadata.AppendFormat("\tBootable image's SHA1: {0}", sha1Ctx.Data(bootImage, out _))
isoMetadata.AppendFormat("\tBootable image's SHA1: {0}", Sha1Context.Data(bootImage, out _))
.AppendLine();
}
else isoMetadata.AppendLine("\tNot bootable");
@@ -725,7 +724,7 @@ namespace DiscImageChef.Filesystems.ISO9660
.AppendLine();
if(bootImage != null)
isoMetadata.AppendFormat("\t\tBootable image's SHA1: {0}",
sha1Ctx.Data(bootImage, out _)).AppendLine();
Sha1Context.Data(bootImage, out _)).AppendLine();
}
else isoMetadata.AppendLine("\t\tNot bootable");

View File

@@ -122,9 +122,8 @@ namespace DiscImageChef.Filesystems
if(ntfsBb.jump[0] == 0xEB && ntfsBb.jump[1] > 0x4E && ntfsBb.jump[1] < 0x80 && ntfsBb.signature2 == 0xAA55)
{
XmlFsType.Bootable = true;
Sha1Context sha1Ctx = new Sha1Context();
string bootChk = sha1Ctx.Data(ntfsBb.boot_code, out _);
XmlFsType.Bootable = true;
string bootChk = Sha1Context.Data(ntfsBb.boot_code, out _);
sb.AppendLine("Volume is bootable");
sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine();
}