-
Notifications
You must be signed in to change notification settings - Fork 32
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
collect rm2 panel IDs #35
Comments
@tadfisher: please use this issue or post in https://github.com/ddvk/remarkable2-framebuffer regarding waveforms and panel IDs. the panel identifier also needs some massaging in order to figure out which waveform to use. @jinnovation: please be careful with what you post as that contains your rM serial number. if you don't mind, feel free to repost. |
|
Do you know which WBF file was loaded? (It should be in xochitl or remarkable-shutdown output, I think) |
i believe the format of mmcblk2boot1 is like so:
separator is three bytes of 0, then
|
I'm not precisely sure how to check which is loaded, but I made some guesses:
Let me know if you'd like me to check anything else. I'm familiar with linux and such but less so with reMarkable specifically so expanding on device specific details will help ensure turnaround time is quick. |
The "separators" appear to be length prefixes of 4 bytes: |
The function inspecting An early glance suggests that |
sounds like a mystery solved, thank you! :) hopefully that's enough for @tadfisher to start on the native fb drivers |
Interestingly I think the code also checks for wbf files at The function at I'm poking and making educated guesses (so this may be wrong) but it seems the lot code is looked for in the WBF file at offset 0xe. Within the WBF offset 0x04 (bytes 5-8) is required to match the file length (in this case 0x000459dd == 285149 bytes). Within the WBF offset 0x0e (bytes 15-16) is the
|
Figured it out: The function is It takes as input the fourth length-prefixed field from The type it decodes into looks something like:
The code is a bit strange:
if ((serial[6] > 0x41 & 0xff) < 8) {
fpl_lot_id = serial[6] - 0x41 & 0xff
} else {
if ((serial[6] - 0x4a & 0xff) < 5) {
fpl_lot_id = (serial[6] - 0x4a) * 10 + 0xb4;
} else {
if ((serial[6] - 0x51 & 0xff) < 10) {
fpl_lot_id = (serial[6] - 0x51) * 10 + 0xe6;
} else if (serial[6] != '0') {
// bad serial
}
}
Here's how it works out with my serial: serial = "ERLA8RW21UBV008MNAT -1.52"
// serial[6] == W == 87 == 0x57
// serial[7] == 2
// first condition fails, 0x57 > 0x41
// second condition fails, 0x57 - 0x4a = 0x16; 0x16 > 5
// third condition passes, 0x57 - 0x51 & 0xff = 6; 6 < 10
fpl_lot_id = (0x57 - 0x51) * 10 + 0xe6 // = 0x122
// adjust lot because serial[7] is 2:
fpl_lot_id += 2
// thus fpl_lot_id == 0x124 So the calculated 0x124 from my serial matches the 0x124 result within the WBF file at offset 0x0e as mentioned in #35 (comment) Thus the algorithm will let you pick the correct wbf just as xochitl does:
|
@EBNull This is excellent, I've been messing with this function in ghidra for hours. FWIW, /var/lib/uboot/zplash is a gzipped raw binary loaded to display the splash screen, and it contains five functions and a very simplified waveform. It could be useful to study this to determine how they apply the waveform to the bitmap data. LMK if you would like a ghidra export. |
for further reversing discussion, please open an issue in ddvk/remarkable2-framebuffer (or any other channel you are comfortable with) |
Originally posted by @tadfisher in #34 (comment)
The text was updated successfully, but these errors were encountered: