Skip to content

Commit

Permalink
Add P10+P12 OSIDs, thanks spyder09 @ PCMHacking.net. Add P08 as a typ…
Browse files Browse the repository at this point in the history
…e. Fix P04 File validation picking up P08 bins. Add OSID 1273057.
  • Loading branch information
antus committed Apr 17, 2023
1 parent fe63b5c commit 9a7cb73
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Apps/PcmHammer/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
FileValidator validator = new FileValidator(image, this);
if (!validator.IsValid())
{
this.AddUserMessage("This file is corrupt. It would render your PCM unusable.");
this.AddUserMessage("This file is corrupt or its format is unknown to PCMHammer. It would render your PCM unusable.");
return;
}

Expand Down Expand Up @@ -1638,7 +1638,7 @@ private async void testFileChecksumsToolStripMenuItem_Click(object sender, Event
}
else
{
this.AddUserMessage("This file is corrupt. It would render your PCM unusable.");
this.AddUserMessage("This file is corrupt or its format is unknown to PCMHammer. It would render your PCM unusable.");
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions Apps/PcmLibrary/Misc/FileValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,22 @@ private PcmType ValidateSignatures()

// P04 512Kb
this.logger.AddDebugMessage("Trying P04 512Kb");
if (((image[0x7FFFE] == 0xA5) && (image[0x7FFFF] == 0x5A)) || // most
((image[0x7FFFC] == 0xA5) && (image[0x7FFFD] == 0x5A))) // some 1998 eg Malibu L82 09369193
// Last 4 bytes:
// A5 5A FF FF = P04
// XX XX XX XX A5 5A = P04 (XX is the OSID)
if (((image[0x7FFFE] == 0xA5) && (image[0x7FFFF] == 0x5A)) || // most P04 OR
((image[0x7FFFC] == 0xA5) && (image[0x7FFFD] == 0x5A) && (image[0x7FFFE] == 0xFF) && (image[0x7FFFF] == 0xFF))) // Most 1998 512Kb eg Malibu 09369193, Olds 09352676‬, LeSabre 09379801...
{
return PcmType.P04;
}

// P08 512Kb
this.logger.AddDebugMessage("Trying P08 512Kb");
if ((image[0x7FFFC] == 0xA5) && (image[0x7FFFD] == 0x5A) && (image[0x7FFFE] == 0xA5) && (image[0x7FFFF] == 0xA5))
{
return PcmType.P08;
}

this.logger.AddDebugMessage("Trying P10 512Kb");
if ((image[0x17FFE] == 0x55) && (image[0x17FFF] == 0x55))
{
Expand Down
47 changes: 30 additions & 17 deletions Apps/PcmLibrary/Misc/PcmInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public enum PcmType
Undefined = 0, // required for failed osid test on binary file
P01_P59,
P04,
P08,
P10,
P12,
E54,
Expand Down Expand Up @@ -356,6 +357,12 @@ public PcmInfo(uint osid)
this.ImageSize = 512 * 1024;
break;

case 1273057:
this.KeyAlgorithm = 40;
this.Description = "VCM Suite COS 1M";
this.ImageBaseAddress = 0x0;
this.ImageSize = 1024 * 1024;
break;
//------- HPT COS -----------
case 1250013:
case 1250018:
Expand Down Expand Up @@ -2126,31 +2133,37 @@ public PcmInfo(uint osid)
case 12589166:
case 12589312:
case 12589586:
case 12592070: //2004 Saturn Ion Redline 2.0L
case 12593533:
case 12596925: //2005 Saturn Ion Redline 2.0L
case 12597778:
case 12597978:
case 12601774:
case 12601321: // 2006 LX9
case 12601904: // Saturn I4
case 12605256:
case 12605261:
case 12610624:
case 12597978: //2004 Saturn Ion Redline 2.0L
case 12598275: //2006 Chevy Cobalt SS 2.0L (Need to verify)
case 12598284: //2006 Saturn Ion Redline 2.0L
case 12601321: //2006 LX9
case 12601774: //2005 Chevy Cobalt SS 2.0L
case 12601904: //2005 Saturn Ion Redline 2.0L
case 12605256: //2006 Chevy Cobalt SS 2.0L
case 12605261: //2006 Chevy Cobalt SS 2.0L
case 12610624: //2007 Chevy Cobalt SS 2.0L & 2007 Saturn Ion Redline 2.0L
case 12610641: //GMS3 OS (04 Ion Redline GMS3)
case 12610642: //GMS3 OS (05 Ion Redline GMS3)
case 12610643: //GMS3 OS (06-07 Ion Redline GMS3)
case 12610644: //GMS3 OS (05 Cobalt SS GMS3)
case 12610645: //GMS3 OS (06-07 Cobalt SS GMS3)
case 12623279:
case 12627882:
case 12627884:
case 12631085:
// LL8 - Atlas I6 (4200) P12
case 12604440:
case 12606400:
// L52 - Atlas I5 (3500) P12
case 12606374:
case 12606375:
// LK5 - Atlas I4 (2800) P12
case 12604440: //LL8 - Atlas I6 (4200) P12
case 12606400: //2006 Chevy Trailblazer 4.2L (Atlas I6)
case 12606374: //L52 - Atlas I5 (3500) P12
case 12606375: //L52 - Atlas I5 (3500) P12
case 12627883:
// Saturn 1mb P12
// Saturn 1mb P12
this.KernelFileName = "Kernel-P12.bin";
this.KernelBaseAddress = 0xFF2000; // or FF0000? https://pcmhacking.net/forums/viewtopic.php?f=42&t=7742&start=450#p115622
this.RAMSize= 0x6000;
this.RAMSize = 0x6000;
this.IsSupported = true;
this.KeyAlgorithm = 91;
this.Description = "P12 1m (Atlas I4/I5/I6)";
Expand All @@ -2163,7 +2176,7 @@ public PcmInfo(uint osid)
// P12 2m - See: https://pcmhacking.net/forums/viewtopic.php?f=42&t=7742&start=470#p115747
case 12609805:
case 12611642:
case 12613422:
case 12613422: //2007 Chevy Trailblazer 4.2L
case 12618164:
case 12627885:
this.KernelFileName = "Kernel-P12.bin";
Expand Down

0 comments on commit 9a7cb73

Please sign in to comment.