LegacyNsfw / PcmHacks

PCM Hammer & PCM Logger, tools for General Motors Powertrain Control Modules (PCMs).
http://pcmhammer.org
171 stars 64 forks source link

Send correct address for loader in Mode34 request. Required for some P08 #309

Closed antuspcm closed 1 year ago

antuspcm commented 1 year ago

Fixes read on Antus' P08 which is the first PCM we've seen that enforces the address provided in the Mode34 permission to upload. This patch allows the loader to load, and with this in place, the main kernel loads correctly through the loader, too.

[09:08:00:442] PCM Hammer (26/04/2023, 9:07 PM) [09:08:00:447] Wednesday, April 26 2023 @09:08:00:44 [09:08:00:531] AVT 852 Reset OK [09:08:00:546] AVT Firmware 1.5 [09:08:00:818] Thanks for using PCM Hammer. [09:08:07:555] Will save to C:\Users\a\Documents\test.bin [09:08:08:478] Querying operating system of current PCM. [09:08:08:570] OSID: 12206029 [09:08:08:731] Unlock succeeded. [09:08:08:809] Attempting switch to VPW 4x [09:08:08:832] Module 0x10 (engine controller) has agreed to enter high-speed mode. [09:08:12:068] Failed to load loader from file. [09:08:12:151] Clearing trouble codes. [09:08:13:286] Elapsed time 00:00:04.5482854 [09:08:13:290] Read failed, Error [09:08:43:233] Will save to C:\Users\antus\Documents\test.bin [09:08:44:086] Querying operating system of current PCM. [09:08:44:197] OSID: 12206029 [09:08:44:361] Unlock succeeded. [09:08:44:435] Attempting switch to VPW 4x [09:08:44:462] Module 0x10 (engine controller) has agreed to enter high-speed mode. [09:08:47:655] PCM uses a kernel loader. [09:08:47:988] Loader upload 100% complete. [09:08:48:009] Loader Version: 69000108 [09:08:48:013] Loader uploaded to PCM succesfully. [09:08:48:234] Kernel upload 12% complete. [09:08:48:417] Kernel upload 56% complete. [09:08:48:606] Kernel upload 100% complete. [09:08:49:747] Kernel Version: 82400108 [09:08:49:751] Kernel uploaded to PCM succesfully. Requesting data... [09:08:49:844] Flash chip: Intel 28F400B, 512kb [09:10:47:807] Read complete. [09:10:47:812] All read-request messages succeeded on the first try. You have an excellent connection to the PCM. [09:10:47:817] We're not sure how much retrying is normal for a read operation on a 512kb PCM. [09:10:47:821] Please help by sharing your results in the PCM Hammer thread at pcmhacking.net. [09:10:47:825] Starting verification... [09:10:47:840] Calculating CRCs from file. [09:10:47:857] Requesting CRCs from PCM. [09:10:47:861] Range File CRC PCM CRC Verdict Purpose [09:10:50:913] 060000-07FFFF 1ECD92DB 1ECD92DB Same OperatingSystem [09:10:53:997] 040000-05FFFF FBAC35E8 FBAC35E8 Same OperatingSystem [09:10:57:091] 020000-03FFFF 0C105B8C 0C105B8C Same OperatingSystem [09:10:59:457] 008000-01FFFF 00309B4C 00309B4C Same Calibration [09:10:59:807] 006000-007FFF 1BA3E32E 1BA3E32E Same Parameter [09:11:00:154] 004000-005FFF 85B5BB36 85B5BB36 Same Parameter [09:11:00:686] 000000-003FFF 776E2FA3 776E2FA3 Same Boot [09:11:00:766] The contents of the file match the contents of the PCM. [09:11:00:906] Clearing trouble codes. [09:11:02:196] Clearing trouble codes. [09:11:03:360] Elapsed time 00:02:18.9951177 [09:11:03:367] Saving contents to C:\Users\antus\Documents\test.bin

[09:08:47:655] PCM uses a kernel loader. [09:08:47:659] Sending upload request for loader size 645, loadaddress FFB000 [09:08:47:731] TX: 6C 10 F0 34 00 02 85 FF B0 00 [09:08:47:748] RX: 6C F0 10 74 00 44 [09:08:47:758] Going to load a 645 byte loader to 0xFFB000 [09:08:47:767] Sending end block payload with offset 0x0, start address 0xFFB000, length 0x285. [09:08:47:842] TX: 6D 10 F0 36 80 02 85 FF B0 00 00 7C 07 00 20 7C 00 FF B2 85 42 68 00 03 61 00 00 46 61 00 01 EA 61 00 00 90 0C 68 3D 00 00 03 67 00 00 90 0C 28 00 34 00 03 67 00 00 9C 0C 28 00 36 00 03 67 00 00 A2 0C 28 00 20 00 03 66 00 FF C4 20 7C 00 FF B2 81 70 04 61 00 01 50 61 00 00 58 4E 70 60 FE 13 FC 00 55 00 FF FA 27 13 FC 00 AA 00 FF FA 27 0A 39 00 80 00 FF C0 06 4E 75 2A 3C 00 00 27 10 61 00 FF DE 61 00 00 2C 61 00 00 28 61 00 00 24 61 00 00 20 61 00 00 1C 61 00 00 18 61 00 00 14 61 00 00 10 61 00 00 0C 61 00 00 08 51 CD FF D2 4E 75 4E 71 4E 71 4E 71 4E 71 4E 75 20 7C 00 FF B2 6B 11 7C 00 08 00 08 70 09 61 00 00 DA 4E FA FF 3E 20 7C 00 FF B2 75 70 06 61 00 00 CA 4E FA FF 2E 42 80 41 F9 00 FF B2 8F 80 39 00 FF B2 8C E1 88 80 39 00 FF B2 8D E1 88 80 39 00 FF B2 8E 22 40 24 40 42 80 80 39 00 FF B2 8A E1 88 80 39 00 FF B2 8B 53 80 47 F9 00 FF B2 89 42 84 26 00 5C 83 14 1B D8 82 51 CB FF FA 42 83 86 1B E1 8B 86 1B B8 83 60 26 20 7C 00 FF B2 7B 11 7C 00 7F 00 03 11 79 00 FF B2 88 00 04 11 79 00 FF B2 89 00 05 70 06 61 00 00 50 4E FA FE B4 12 D8 51 C8 FF FC 20 7C 00 FF B2 7B 18 39 00 FF B2 89 13 C4 00 FF B2 7F 70 06 61 00 00 2E 02 04 00 80 0C 04 00 80 66 00 FE 8A 4E D2 61 00 FE D6 14 39 00 FF F6 0E 02 02 00 03 0C 02 00 03 67 EC 13 FC 00 04 00 FF F6 0C 4E 75 13 FC 00 14 00 FF F6 0C 55 80 61 00 FE AE 13 D8 00 FF F6 0D 61 00 FE F6 61 00 FF C8 51 C8 FF EC 13 FC 00 0C 00 FF F6 0C 13 D8 00 FF F6 0D 61 00 FE DC 13 FC 00 03 00 FF F6 0C 13 FC 00 00 00 FF F6 0D 61 00 FE 76 61 00 FE C4 10 39 00 FF F6 0E 02 00 00 E0 0C 00 00 E0 66 E8 10 39 00 FF F6 0F 4E 75 20 7C 00 FF B2 85 61 00 FE 50 10 39 00 FF F6 0E 02 00 00 E0 4A 00 67 EE 0C 00 00 80 6E 08 10 F9 00 FF F6 0F 60 E0 10 F9 00 FF F6 0F 20 7C 00 FF B2 85 10 10 02 00 00 FE 0C 00 00 6C 66 C2 0C 28 00 10 00 01 67 00 00 0C 0C 28 00 FE 00 01 66 00 FF B0 4E 75 00 00 0D 28 63 29 32 30 32 33 20 70 63 6D 68 61 63 6B 69 6E 67 2E 6E 65 74 6C F0 10 7D 00 69 00 01 00 AA 6C F0 10 74 00 00 6C F0 10 76 00 00 6C F0 10 60 E8 2B [09:08:47:980] RX: 6D F0 10 76 80 78 [09:08:47:984] Found response, Success [09:08:47:988] Loader upload 100% complete. [09:08:47:994] TX: 6C 10 F0 3D 00 [09:08:48:005] RX: 6C F0 10 7D 00 69 00 01 08 [09:08:48:009] Loader Version: 69000108 [09:08:48:013] Loader uploaded to PCM succesfully.