-
Notifications
You must be signed in to change notification settings - Fork 13
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
flatc segmentation fault with FB APK version 338 #1
Comments
Hello, I've encountered this issue as well. I think it's due to Facebook having changed their FlatBuffers schema in the meantime. I don't think that graph_metadata.bin is corrupted, it extracted successfully with xz, which includes a checksum of the compressed contents. graph_metadata.fbs will have to be re-engineered again for this version of the APK. Although, a quick look with |
Hi CajuM, Thank you very much for your reply. Yes you are right it's not corrupted file, I find out that the last working version with old FlatBuffers schema is v293. Thanks a lot for your great support, I will wait for your updated version of graph_metadata.fbs if you have enough time to work on, it is greatly appreciated. |
Hi CajuM, Could you please clarify the way to re-engineer the "graph_metadata.fbs"? Thanks |
I wrote a blog post once, I'm not sure if it's explained well enough https://cajum.github.io/fbgraphql/ |
Hey @CajuM, Have you updated or re-engineered the "graph_metadata.fbs" file? If not can you please explain how to re-construct the same. Thanks |
Hello, |
Hello @CajuM , Thanks for the reply. I have just started exploring the field of reverse engineering things. If you have some time then please rewrite the blog and explain the decoding step explicitly. It will be very helpful for me and people to come. Thanks in advance! |
Hey @CajuM , Any updates? |
Hey guys, can you please help me understand the decoding process, it is really important for me to know this. Please any help/hints will be appreciated. Thanks |
Ok, untill I find the time to document this properly... https://github.com/dvidelabs/flatcc/blob/master/doc/binary-format.md and https://flatbuffers.dev/md__internals.html We'll be using the fbs.py module provided in this repo. fbs assumes that the binary is stored in a buffer. We'll call it data. As per the documentation, a FlatBuffers table begins with an offset to the root table. So far we know that at address 0 we have a uint32_t which we must de-reference to get the offset of the root table. So, to get the root table's offset we'll do The simplest assumption here would be that we have three uint32_t fields, but this need not be the case, we can also have structs, arrays, vectors, strings or other tables. In case of the later three, we can test our hypothesis by attempting to decode the data-type, if decoding fails or we get absurd values such as offsets that exceed the buffer, non utf-8 strings, we can assume our hypothesis is false. In the case of structs, they can be identified by a length that is not the power of two, however structs can also have the same length as scalars, this ambiguity can be solved by confronting it with the alternative hypothesis, instead of a So far we have discussed only table ambiguities, but these also apply to vectors, A vector begins with an A top-down approach can also be employed, if one knows the data-type of an element, one can test if there are any offsets to it. |
I'm curious, what is it that you need this so badly for? |
Hi,
Thank you very much for your effort developing this lib.
I alway got the following error when using "flatc --json --strict-json --raw-binary graph_metadata.fbs -- graph_metadata.bin
":
zsh: segmentation fault flatc --json --strict-json --raw-binary graph_metadata.fbs --
I think that the graph_metadata.bin file is corrupted in APK version 338.0.0.13.118 as it has the ext. graph_metadata.bin.xzs and uncompress it resulted in a corrupted file.
Could you please try it with latest version if you have time or give me a hint here?
Thanks,
Sayed
The text was updated successfully, but these errors were encountered: