Repository navigation
Make the blue chat message fix work on 0.35.x - #50
Merged
MisterGatto merged 1 commit intoOct 17, 2026
Merged
Conversation
The chat fix hooked libBootloader + 0x13f23b8, the chat-record builder on Sky 0.34.5 only. From 0.35.0 the builder moved to 0x1466d60 and that offset lands mid-function, where the hook was still installed. The builder assembles the record's flag byte (+0x14) bit by bit and never writes bits 5-7, and its callers pass an uninitialised stack record, so those bits carry stack garbage. ChatFlagFix finds the builder's mask `and wA, wA, #0xffffffe3` by data flow (the "chat" call, the flag byte read-modify-writes) and rewrites it to `and wA, wA, #0x3`, which gives the same bits 0-4 and clears 5-7, as the hook did. Registers and the flag offset are decoded, not pinned; anything but exactly one site, or an instruction that is no longer the expected one, is left unpatched. Found on 0.33.5 (Huawei) and 0.33.7 through 0.35.1; refused on 0.33.0 and 0.33.2, whose flag layout differs. Host tests: cmake -S app/src/test/cpp -B <dir> && cmake --build <dir> && ctest --test-dir <dir>. Set CHAT_FLAG_FIX_IMAGES to a ;-separated list of libBootloader.so paths to also scan real images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old fix hooked a fixed address that is only right on 0.34.5. On 0.35.0 and later that address lands mid-function, and the hook was still being installed there.
The fix now finds its own patch site in libBootloader, so it needs no per-build address. If it doesn't find exactly one match, it patches nothing.