Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

antus/p08 #346

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
49fcedf
use a local copy of imageSize to make it easy to read only a range wh…
Jul 23, 2023
9e2f01c
add support for P08 write
Jul 23, 2023
ce64e27
Still send the user defined key, even if seed is 0000, so that users …
Jul 24, 2023
291eed6
use different syntax to set vpp for P08 and P01 so that both work. Ne…
Jul 24, 2023
d9600e8
Fix erase function scratch space initialisation, fixes P04 kernel.
Jul 29, 2023
f8ecf80
Add initial P04 write to kernel
Aug 2, 2023
7033277
Dont use word ops on the ram message buffer
Aug 9, 2023
eb8185a
Remove padding from data segment, modify word memory access for older…
Aug 9, 2023
c937df3
use byte ops to retrieve flash id for write, for P04 P08 CPU
Aug 10, 2023
1d29e7a
Fix CRC32 function for old CPU P04/P08, remove final padding byte
Aug 10, 2023
8b987e2
P04 fixes. Tested on Intel only
Aug 12, 2023
fb0c10b
Update AMD write counter register to D7
Aug 12, 2023
a51bc5b
Add initial 96/97 V6 support
Aug 19, 2023
1604d69
Merge branch 'develop' into antus/p08
May 20, 2024
e7710c5
p04 load address, warnings, unlock p04 test write, tidyups, xpro devi…
May 20, 2024
114ece2
Backport changes from Gampy's akernel test. Cleanup build system.
Jun 11, 2024
ddecce4
fix unix kernel build for github actions
Jun 11, 2024
d44c93c
PCM Hardware cleanup - define hardware information in one place.
Jun 12, 2024
b81ce2a
add some p08 OSIDs
Jun 13, 2024
6b2925e
Only attempt to run the test kernel if it exists. Maybe we can remove…
Jun 13, 2024
10cc905
remove warning notices, block operations which are unsupported on spe…
Jun 13, 2024
a88391a
Add 1996/1997 P04 256K
Jun 13, 2024
3083cf6
more p04/p08 OSIDs
Jun 13, 2024
801f078
Initial attempt at Vortec BlackBox Support.
Jun 22, 2024
005ee05
Add support for 98+ Blackbox 4 Connector service numbers 9366810 and …
Jul 16, 2024
8d58f5b
remove unused service numbers that are more likely part numbers
Jul 16, 2024
5136f37
update assembly readme to document BlackBox
Jul 16, 2024
6c01840
remvove IntermediateOutputPath to stop it changing between the projec…
Jul 16, 2024
6892dc8
credits/docs
Jul 16, 2024
df7fa98
Add unique kernel ID byte for BlackBox (88)
Jul 16, 2024
2e40689
Fix P04 OSID offset value crash
Jul 28, 2024
a30b01e
Fix crash on close of J2534 when the previous attempt to open has failed
Jul 28, 2024
6d6e362
add more P04_256k OSIDs. Use SI standard data sizes in more places
Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CheckBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# 2: Kernel Base Address
# 3: Loader Base Address or NOLOADER if a loader is not used.
#
for p in "P01 FF8000 NOLOADER" "P04 FF9090 FF9890" "P08 FFA800 FFB000" "P10 FFB800 NOLOADER" "P12 FF2000 NOLOADER" "E54 FF8F50 NOLOADER"; do
for p in "P01 FF8000 NOLOADER" "P04 FF8000 FF9890" "P04_256k FF8000 NOLOADER" "P08 FFAC00 NOLOADER" "P10 FFB800 NOLOADER" "P12 FF2000 NOLOADER" "E54 FF8F50 NOLOADER" "BlackBox FFC300 NOLOADER"; do
pcm="${p%% *}";
p="${p#* }"
address="${p%% *}"
Expand All @@ -48,7 +48,7 @@ jobs:
cp Kernel-${pcm}.bin ../TemporaryArtifactStorage/
echo " Cleanup after Kernel-${pcm}"
echo
make clean
make -f makefile-assembly clean
#
# Build the Loader if requested
#
Expand All @@ -59,7 +59,7 @@ jobs:
cp Loader-${pcm}.bin ../TemporaryArtifactStorage/
echo " Cleanup after Loader-${pcm}"
echo
make clean
make -f makefile-assembly clean
fi
done

Expand Down
129 changes: 81 additions & 48 deletions Apps/PcmHammer/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ private async void readPropertiesButton_Click(object sender, EventArgs e)

try
{
PcmInfo pcmInfo = null;
OSIDInfo pcmInfo = null;

this.DisableUserInput();

Expand All @@ -812,17 +812,9 @@ private async void readPropertiesButton_Click(object sender, EventArgs e)
var osResponse = await this.Vehicle.QueryOperatingSystemId(CancellationToken.None);
if (osResponse.Status == ResponseStatus.Success)
{
this.AddUserMessage("OS ID: " + osResponse.Value.ToString());
pcmInfo = new PcmInfo(osResponse.Value);
this.AddUserMessage("Hardware Type: " + pcmInfo.HardwareType.ToString());
if (pcmInfo.HardwareType == PcmType.P04)
{
this.AddUserMessage("**********************************************");
this.AddUserMessage("WARNING: P04 Support is still in development.");
this.AddUserMessage("It may or may not read your P04 correctly.");
this.AddUserMessage("There is currently no ETA for P04 Write.");
this.AddUserMessage("**********************************************");
}
this.AddUserMessage("OSID: " + osResponse.Value.ToString());
pcmInfo = new OSIDInfo(osResponse.Value);
this.AddUserMessage("Description: " + pcmInfo.Description);
}
else
{
Expand Down Expand Up @@ -863,8 +855,8 @@ private async void readPropertiesButton_Click(object sender, EventArgs e)
this.AddUserMessage("Serial Number query failed: " + serialResponse.Status.ToString());
}

// Disable BCC lookup for the P04
if (pcmInfo != null && pcmInfo.HardwareType != PcmType.P04 && pcmInfo.HardwareType != PcmType.P08)
// Disable BCC lookup for those that do not provide it
if (pcmInfo != null && pcmInfo.HardwareType != PcmType.P04 && pcmInfo.HardwareType != PcmType.P04_256k && pcmInfo.HardwareType != PcmType.P08)
{
var bccResponse = await this.Vehicle.QueryBCC();
if (bccResponse.Status == ResponseStatus.Success)
Expand Down Expand Up @@ -912,7 +904,7 @@ private async void modifyVinButton_Click(object sender, EventArgs e)
return;
}

PcmInfo info = new PcmInfo(osidResponse.Value);
OSIDInfo info = new OSIDInfo(osidResponse.Value);

var vinResponse = await this.Vehicle.QueryVin();
if (vinResponse.Status != ResponseStatus.Success)
Expand Down Expand Up @@ -1160,16 +1152,6 @@ private async void readFullContents_BackgroundThread()
string path = "";
this.Invoke((MethodInvoker)delegate ()
{
this.AddUserMessage($"WARNING: This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!");
string msg = $"WARNING!{Environment.NewLine}This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!" +
$"{Environment.NewLine}{Environment.NewLine}Are you willing to accept the responsibility ?";
DialogResult warnDialogResult = MessageBox.Show(msg, "Continue?", MessageBoxButtons.YesNo);
if (warnDialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}

path = this.ShowSaveAsDialog();

if (path == null)
Expand Down Expand Up @@ -1210,12 +1192,13 @@ private async void readFullContents_BackgroundThread()
}
}

PcmInfo pcmInfo;
OSIDInfo pcmInfo;
if (osidResponse.Status == ResponseStatus.Success)
{
// Look up the information about this PCM, based on the OSID;
this.AddUserMessage("OSID: " + osidResponse.Value);
pcmInfo = new PcmInfo(osidResponse.Value);
pcmInfo = new OSIDInfo(osidResponse.Value);
this.AddUserMessage("Description: " + pcmInfo.Description);
}
else
{
Expand All @@ -1235,12 +1218,29 @@ private async void readFullContents_BackgroundThread()
});
await Vehicle.ForceSendToolPresentNotification();

pcmInfo = new PcmInfo(OperatingSystemId); // osid
pcmInfo = new OSIDInfo(OperatingSystemId); // osid

AddUserMessage($"Using OsID: {pcmInfo.OSID}");
}

if (pcmInfo.HardwareType == PcmType.P04 || pcmInfo.HardwareType == PcmType.P08 || pcmInfo.HardwareType == PcmType.E54)
// Pre flight checks to block invalid write operations by PCM type.
if (!pcmInfo.IsSupported)
{
string msg = $"Abort: The connected {pcmInfo.HardwareType.ToString()} PCM is not supported.";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Abort");
return;
}

if (!pcmInfo.IsSupportedRead)
{
string msg = $"Abort: The connected {pcmInfo.HardwareType.ToString()} PCM is not supported for read operations.";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Abort");
return;
}

if (pcmInfo.HardwareType == PcmType.E54)
{
string msg = $"WARNING: {pcmInfo.HardwareType.ToString()} Support is still in development.";
this.AddUserMessage(msg);
Expand Down Expand Up @@ -1362,16 +1362,6 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
this.DisableUserInput();
this.cancelButton.Enabled = true;

this.AddUserMessage($"WARNING: This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!");
string msg = $"WARNING!{Environment.NewLine}This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!" +
$"{Environment.NewLine}{Environment.NewLine}Are you willing to accept the responsibility ?";
DialogResult warnDialogResult = MessageBox.Show(msg, "Continue?", MessageBoxButtons.YesNo);
if (warnDialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}

if (string.IsNullOrWhiteSpace(path))
{
path = this.ShowOpenDialog();
Expand Down Expand Up @@ -1426,7 +1416,7 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
bool needUnlock;
int keyAlgorithm = 1;
bool shouldHalt;
PcmInfo pcmInfo = null;
OSIDInfo pcmInfo = null;
bool needToCheckOperatingSystem =
(writeType != WriteType.OsPlusCalibrationPlusBoot) &&
(writeType != WriteType.Full) &&
Expand All @@ -1436,7 +1426,7 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
Response<uint> osidResponse = await this.Vehicle.QueryOperatingSystemId(this.cancellationTokenSource.Token);
if (osidResponse.Status == ResponseStatus.Success)
{
pcmInfo = new PcmInfo(osidResponse.Value);
pcmInfo = new OSIDInfo(osidResponse.Value);
keyAlgorithm = pcmInfo.KeyAlgorithm;
needUnlock = true;

Expand Down Expand Up @@ -1482,7 +1472,7 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
this.AddUserMessage("Unlock may not work, but we'll try...");
needUnlock = true;
}
pcmInfo = new PcmInfo(validator.GetOsidFromImage()); // Prevent Null Reference Exceptions from breaking Recovery Mode
pcmInfo = new OSIDInfo(validator.GetOsidFromImage()); // Prevent Null Reference Exceptions from breaking Recovery Mode
}
else
{
Expand All @@ -1508,30 +1498,73 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
return;
}

pcmInfo = new PcmInfo(osidResponse.Value);
pcmInfo = new OSIDInfo(osidResponse.Value);
}

needToCheckOperatingSystem = false;
}
}

if (writeType != WriteType.Compare && (pcmInfo.HardwareType == PcmType.P04 || pcmInfo.HardwareType == PcmType.P08))
// Pre flight checks to block invalid write operations by PCM type.
if (!pcmInfo.IsSupported)
{
string msg = $"PCMHammer currently does not support writing to the {pcmInfo.HardwareType.ToString()}";
string msg = $"Abort: The connected {pcmInfo.HardwareType.ToString()} PCM is not supported.";
this.AddUserMessage(msg);
MessageBox.Show(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Abort");
return;
}

if (pcmInfo.HardwareType == PcmType.P04 || pcmInfo.HardwareType == PcmType.P08 || pcmInfo.HardwareType == PcmType.E54)
if (!pcmInfo.IsSupportedWrite)
{
string msg = $"WARNING: {pcmInfo.HardwareType.ToString()} Support is still in development.";
string msg = $"Abort: The connected {pcmInfo.HardwareType.ToString()} PCM is not supported for write operations.";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Abort");
return;
}

// If the factory binary is not paritioned we cant write by segment, block the non-full write types
if (!pcmInfo.IsSupportedWriteBySegment && (writeType == WriteType.Calibration || writeType == WriteType.OsPlusCalibrationPlusBoot || writeType == WriteType.Parameters))
{
string msg = $"Error: The connected {pcmInfo.HardwareType.ToString()} PCM binary format is not partitioned and does not support partial write." + Environment.NewLine +
"You will need to do a Write Full Flash (Clone) instead.";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Error");
return;
}

// If we cant write the slave, warn the user of operating system changes
if (pcmInfo.HardwareSlaveCPU == true && !pcmInfo.IsSupportedWriteSlaveCPU && (writeType == WriteType.Full || writeType == WriteType.OsPlusCalibrationPlusBoot))
{
string msg = $"Warning: Writes to the {pcmInfo.HardwareType.ToString()} slave CPU are not supported." + Environment.NewLine +
"You must have another way to update the slave CPU to match when you change operating system, else electroncic throttle may not work." + Environment.NewLine +
"Restore this PCM to its original operating system if this happens.";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Warning!", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}
else
{
this.AddUserMessage("User chose to proceed.");
}
}

if (pcmInfo.HardwareType == PcmType.E54)
{
string msg = $"WARNING: {pcmInfo.HardwareType.ToString()} support is insufficiently tested, but believed to be working." + Environment.NewLine +
"Please report success or failure on pcmhacking.net." + Environment.NewLine +
"Do you accept the risk of damage to your hardware?";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Continue?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}else
{
this.AddUserMessage("User accepts the risk of running insufficiently tested code.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Apps/PcmHammer/PcmHammer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IntermediateOutputPath>C:\Users\Jouko\AppData\Local\Temp\vsD06A.tmp\Debug\</IntermediateOutputPath>
<IntermediateOutputPath>C:\Users\a\AppData\Local\Temp\vs9D89.tmp\Debug\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -46,7 +46,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IntermediateOutputPath>C:\Users\Jouko\AppData\Local\Temp\vsD06A.tmp\Release\</IntermediateOutputPath>
<IntermediateOutputPath>C:\Users\a\AppData\Local\Temp\vs9D89.tmp\Release\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>0411_256px.ico</ApplicationIcon>
Expand Down
24 changes: 11 additions & 13 deletions Apps/PcmHammer/credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,41 @@ <h1>Who To Thank For What</h1>
<p>
<b>Antus</b>
-
He and Dimented24x7 created the first free tool for reading and writing (LS1Flash) and he contributed enormously to this one. More recently helping extend it to P10, P12 and P04.
He and Dimented24x7 created the first free tool for reading and writing (LS1Flash) and he contributed enormously to this one. More recently helping extend it to P10, P12, P04 and P08
</p>

<P>
<b>Dimented24x7</b>
-
For his work on LS1Flash, for sharing his disassembly of a 411 operating system, and for the first free definition of a 411 operating system's calibration data.
</P>

<p>
<b>NSFW</b>
-
Tried to write PCM Hammer despite knowing far too little about the hardware side of things... Was rescued by everyone else listed here (Antus says he's too modest)
</p>

<b>Gampyg28</b>
-
Gampy joined the project through the PCMHacking.net forums. First he contributed usability improvements, code tidyups, new features. Then improved build systems and pipelines. He has also developed the assembly kernels with Antus and worked on P10, P12 and P04 support.
Gampy joined the project through the PCMHacking.net forums. First he contributed usability improvements, code tidyups, new features. Then improved build systems and pipelines. Has been working with Antus on the assembly kernels, originaly born out of LS1 Flash kernel but now developed much further. As of this build all PCMs are using this work.
</p>

<p>
<b>PeteS</b>
-
He speaks J1850 VPW like a native, and tortures PCMs for sadistic pleasure. His troubleshooting and testing has been invaluable.
He speaks J1850 VPW like a native, and tortures PCMs for sadistic pleasure. His early troubleshooting and testing was invaluable.
</p>

<p>
<b>Tazzi</b>
-
His code made it possible for PCM Hammer to support J2534 devices.
</p>

<P>
<b>Dimented24x7</b>
-
For his work on LS1Flash, for sharing his disassembly of a 411 operating system, and for the first free definition of a 411 operating system's calibration data.
</P>


<p>Tazzi and PeteS have also built hardware that we recommend. That's the "OBD Xpro" that you see in the list of supported interfaces. It's Available from <a href="https://obdxpro.com/shop/">obdxpro.com</a>. GT, VX and VT are compatible with PCMHammer.</p>

<p>
And last but not least, thanks to the whole car-hacking community - to everyone who has looked under their hoods or into their OBD2 messages, and posted about it on the internet. And especially to everyone who has sent us words of encouragement along the way. It's always nice to be reminded that there are plenty more people out there who are just as stoked about this as we are!
</p>
<p>And last but not least, thanks to the whole car-hacking community - to everyone who has looked under their hoods or into their OBD2 messages, and posted about it on the internet. And especially to everyone who has sent us words of encouragement along the way. It's always nice to be reminded that there are plenty more people out there who are just as stoked about this as we are!</p>


</body>
Expand Down
Loading
Loading