-
Notifications
You must be signed in to change notification settings - Fork 77
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
Python exception UnicodeDecodeError #39
Comments
Hi. Can you provide a link to the firmware you are trying to load? It seems to be specific to the firmware loading part, so without firmware, we cannot reproduce the error. That being said, it looks like a decoding error. I would throw in an |
Hi, So I did some digging and as you suspect there is something strange about the file I used. Each iteration expects there to be a sane "header" at the next location (in this case 0x152efb0 + 0x68411c). I looked there and it appears to pure binary data, definitely not the expected structure. I didn't collect that file myself so I have questions marks around its integrity. I do have an unrelated question, how important is "md1_dbginfo"? I have another couple of files which appear correct but are missing that section. Is this going to be a dealbreaker for me being able to emulate those files? |
Depending on how important it is to you to work on this specific firmware, you could either do this by hand or maybe recover symbols using Ghidra and a FunctionID database from another firmware sample, hoping that the relevant functions were not changed, such that FunctionID can detect them. Regarding the broken file headers: Mediatek changed the format of some of their log files during the 4G->5G transition. Maybe in this case they changed the format of their modem image, i.e., it might be that your file is not corrupted but uses a new format. |
FirmWire needs debug data or very good symbol patterns like in https://github.com/FirmWire/FirmWire/blob/main/firmwire/vendor/shannon/pattern.py to work properly. Some OEMs ship debug data, but others don't. To handle the others, you need to develop patterns for every symbol of interest on a per-ISA basis. |
So luckily (some of) the firmware I'm interested in has debug data. Unfortunately not all the patterns match (I assume they need to). I've loaded it up in Ghidra (using your patches because without, useless). Unfortunately I may have come to a dead end here because analyse_mtk_image.py doesn't work, it appears that the SPRAM symbols don't exist in my debug info. I will perhaps persevere with suggestions from dklischies. The issue is that I would really rather not disassemble by hand but it seems nothing can do it. |
I'm going to attempt to add a new SOC, unfortunately I wasn't expecting to hit this.
Any direction would be greatly appreciated.
panda is here:
commit 01c9989b835535f78f5bffec165a39462c361a9c
Merge: b265e4c305 e8c177eca7
Author: Marius Muench m.muench@vu.nl
Date: Wed Mar 8 11:27:28 2023 +0100
main repo is:
commit 8b540a6
Author: Grant Hernandez grant.h.hernandez@gmail.com
Date: Wed Aug 16 10:06:43 2023 -0400
The text was updated successfully, but these errors were encountered: