Skip to content

Commit 802b778

Browse files
committed
Add support for K3 2.4.0 firmware
1 parent cbf2202 commit 802b778

File tree

5 files changed

+42
-44
lines changed

5 files changed

+42
-44
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Latest version will likely support the two latest firmwares from Anycubic, unles
1717
Here are the suported printers and firmwares with latest Rinkhals release:
1818
| Model | Tested firmwares | Notes |
1919
| -- | -- | -- |
20-
| Kobra 3 (+ combo) | `2.3.8.9` `2.3.9.3` | `2.3.7` and `2.3.7.1` have some instabilities |
20+
| Kobra 3 (+ combo) | `2.3.9.3` `2.4.0` |
2121
| Kobra 2 Pro | `3.1.2.3` | Only with mainboard [Trigorilla Spe **B** v1.0.x](https://1coderookie.github.io/Kobra2ProInsights/hardware/mainboard/#trigorilla_spe_b_v10x-stock-new-revision). `3.1.4` is buggy |
2222
| Kobra S1 (+ combo) | `2.5.1.6` `2.5.2.3` |
2323

files/3-rinkhals/opt/rinkhals/patches/K3SysUi.K3_2.3.8.9.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
# This script was automatically generated, don't modify it directly
4+
# Before MD5: 9ae93aa475d994aeba1a9e38013b0db8
5+
# After MD5: f613618e901a9850c38e0bad386d0be0
6+
7+
TARGET=$1
8+
9+
MD5=$(md5sum $TARGET | awk '{print $1}')
10+
if [ "$MD5" = "f613618e901a9850c38e0bad386d0be0" ]; then
11+
echo $TARGET is already patched, skipping...
12+
exit 0
13+
fi
14+
if [ "$MD5" != "9ae93aa475d994aeba1a9e38013b0db8" ]; then
15+
echo $TARGET hash does not match, skipping patch...
16+
exit 1
17+
fi
18+
19+
PATCH_FILE=/tmp/patch-$RANDOM.bin
20+
echo 'AKDjDvCg4R8EAOoO8KDhL3VzZXJlbWFpbi9yaW5raGFscy8uY3VycmVudC9vcHQvcmlua2hhbHMvdWkvcmlua2hhbHMtdWkuc2ggJiBlY2hvICQhID4gL3RtcC9yaW5raGFscy9yaW5raGFscy11aS5waWR0aW1lb3V0IC10IDIgc3RyYWNlLXFxcSAtZSB0cmFjZT1ub25lIC1wICQoY2F0IC90bXAvcmlua2hhbHMvcmlua2hhbHMtdWkucGlkKSAyPiAvZGV2L251bGwAcm0gLWYgL3RtcC9yaW5raGFscy9yaW5raGFscy11aS5waWQAAACf5QAAAOoU4g8A/KD862QAoONls/zrAACfAAAA6nriDwD2oPzrDwBQ4/f//woAAJ/lAADq1uIPAPCg/OsIABvlAJDlBCCg4wEQoOMc8v7rCAAb5QCQBBCg49Tz/uvQ+//qUmlua2hhbHMAUmlua2hhbA==' | base64 -d > $PATCH_FILE
21+
22+
dd if=$PATCH_FILE skip=0 ibs=1 of=$TARGET seek=118197 obs=1 count=7 conv=notrunc # 0x1cdb5 / 0x2cdb5 > 0x00a0e30ef0a0e1
23+
dd if=$PATCH_FILE skip=7 ibs=1 of=$TARGET seek=971384 obs=1 count=4 conv=notrunc # 0xed278 / 0xfd278 > 0x1f0400ea
24+
dd if=$PATCH_FILE skip=11 ibs=1 of=$TARGET seek=975376 obs=1 count=105 conv=notrunc # 0xee210 / 0xfe210 > 0x0ef0a0e12f75736572656d61696e2f72696e6b68616c732f2e63757272656e742f6f70742f72696e6b68616c732f75692f72696e6b68616c732d75692e73682026206563686f202421203e202f746d702f72696e6b68616c732f72696e6b68616c732d75692e706964
25+
dd if=$PATCH_FILE skip=116 ibs=1 of=$TARGET seek=975482 obs=1 count=19 conv=notrunc # 0xee27a / 0xfe27a > 0x74696d656f7574202d74203220737472616365
26+
dd if=$PATCH_FILE skip=135 ibs=1 of=$TARGET seek=975502 obs=1 count=108 conv=notrunc # 0xee28e / 0xfe28e > 0x2d717171202d652074726163653d6e6f6e65202d70202428636174202f746d702f72696e6b68616c732f72696e6b68616c732d75692e7069642920323e202f6465762f6e756c6c00726d202d66202f746d702f72696e6b68616c732f72696e6b68616c732d75692e70696400
27+
dd if=$PATCH_FILE skip=243 ibs=1 of=$TARGET seek=975612 obs=1 count=27 conv=notrunc # 0xee2fc / 0xfe2fc > 0x00009fe5000000ea14e20f00fca0fceb6400a0e365b3fceb00009f
28+
dd if=$PATCH_FILE skip=270 ibs=1 of=$TARGET seek=975640 obs=1 count=25 conv=notrunc # 0xee318 / 0xfe318 > 0x000000ea7ae20f00f6a0fceb0f0050e3f7ffff0a00009fe500
29+
dd if=$PATCH_FILE skip=295 ibs=1 of=$TARGET seek=975666 obs=1 count=15 conv=notrunc # 0xee332 / 0xfe332 > 0x00ead6e20f00f0a0fceb08001be500
30+
dd if=$PATCH_FILE skip=310 ibs=1 of=$TARGET seek=975682 obs=1 count=19 conv=notrunc # 0xee342 / 0xfe342 > 0x90e50420a0e30110a0e31cf2feeb08001be500
31+
dd if=$PATCH_FILE skip=329 ibs=1 of=$TARGET seek=975702 obs=1 count=1 conv=notrunc # 0xee356 / 0xfe356 > 0x90
32+
dd if=$PATCH_FILE skip=330 ibs=1 of=$TARGET seek=975704 obs=1 count=12 conv=notrunc # 0xee358 / 0xfe358 > 0x0410a0e3d4f3feebd0fbffea
33+
dd if=$PATCH_FILE skip=342 ibs=1 of=$TARGET seek=2793676 obs=1 count=16 conv=notrunc # 0x2aa0cc / 0x2ba0cc > 0x52696e6b68616c730052696e6b68616c
34+
35+
rm $PATCH_FILE

files/3-rinkhals/opt/rinkhals/patches/create-patches.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# From a Windows machine:
2-
# docker run --rm -it -v .\files:/files ghcr.io/jbatonnet/rinkhals/build python3 /files/3-rinkhals/opt/rinkhals/scripts/create-patches.py
2+
# docker run --rm -it -v .\files:/files ghcr.io/jbatonnet/rinkhals/build python3 /files/3-rinkhals/opt/rinkhals/patches/create-patches.py
33

44
import os
55
import json
@@ -107,14 +107,14 @@ def patch_K3SysUi(binaryPath, modelCode, version):
107107
# bl QStackedWidget::setCurrentIndex
108108
# b 0xfaf4c < patchReturnAddress
109109

110-
elif modelCode == 'K3' and version == '2.3.8.9':
111-
buttonCallback = k3sysui.symbols['_ZZN10MainWindow19AcSettingPageUiInitEvENKUlvE_clEv']
112-
patchJumpAddress = 0xfaf14
113-
patchReturnAddress = 0xfaf44
114110
elif modelCode == 'K3' and version == '2.3.9.3':
115111
buttonCallback = k3sysui.symbols['_ZZN10MainWindow19AcSettingPageUiInitEvENKUlvE_clEv']
116112
patchJumpAddress = 0xfd3bc
117113
patchReturnAddress = 0xfd3ec
114+
elif modelCode == 'K3' and version == '2.4.0':
115+
buttonCallback = k3sysui.symbols['_ZZN10MainWindow19AcSettingPageUiInitEvENKUlvE_clEv']
116+
patchJumpAddress = 0xfd278
117+
patchReturnAddress = 0xfd2a8
118118

119119
# KS1 - Settings > General > Service Support (4th button)
120120

files/3-rinkhals/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ is_verified_firmware() {
5151
return
5252
fi
5353
elif [ "$KOBRA_MODEL_CODE" = "K3" ]; then
54-
if [ "$KOBRA_VERSION" = "2.3.8.9" ] || [ "$KOBRA_VERSION" = "2.3.9.3" ]; then
54+
if [ "$KOBRA_VERSION" = "2.3.9.3" ] || [ "$KOBRA_VERSION" = "2.4.0" ]; then
5555
echo 1
5656
return
5757
fi

0 commit comments

Comments
 (0)