4 ms·
If the author is here, thanks for writing this up. I did something similar years ago, but I neglected to write it up. My process was essentially the same as you
by dunham 6y ago
If the author is here, thanks for writing this up. I did something similar years ago, but I neglected to write it up. My process was essentially the same as yours, although I used some thrown-together python code to analyze the protobuf data.
After I finished, I found out that the raw .proto files were embedded in the web app, which would have have saved a bit of time, but also taken away some of the fun. So if you want the official schema, you can look there, but it might not be legal to redistribute as-is.
Also, if anyone is poking around with protobuf forensics with ObjectiveC code, I once threw together a script to reverse engineer protobuf definitions from ObjectiveC executables. I haven't tested it recently, but it should work for ObjetiveC code generated by protoc (i.e. if _PBDataWriterWriteInt shows up in nm output):
https://gist.github.com/dunhamsteve/224e26a7f56689c33cea4f0fa7632c3d https://gist.github.com/dunhamsteve/224e26a7f56689c33cea4f0f...
- alynn 6y agoI never would have thought to check the webapp. Grepping for loadProto or .proto" does it. Thanks for sharing.
- jeremiahlee 6y agoSpecifically, loadProto in https://www.icloud.com/applications/notes3/2017Project42/en-us/main.js https://www.icloud.com/applications/notes3/2017Project42/en-... looks promising.
- thesnarky1 6y agoI was not here, but wanted to create an account to thank you for the work you did years ago. Your work was really critical to my understanding of tables and I wish I had found it sooner! I keep meaning to go back and add in the drawing code, but since I can export the fallback image directly, I just use that for now in the parser. Glad you liked the article and really glad to see you specifically comment on it. Thank you!
- dunham 6y agoThat project sent me down a rabbit hole learning about CRDTs. I'd love to learn more about the history of the Notes implementation. Who did it? What background did they have? Their "topotext" construct is similar to RGA, but different from any paper that I can find. I think it was invented by the developers. The drawing thing I did because it was interesting - the kind of data that would be fun to have to play around with character / shape recognition. I export it as SVG for my "notes2html". But since my output doesn't take into account the pen angle, pressure, and velocity, it isn't going to be as good as Apple's PNG. The actual raw data for the stroke is a series of PKCompressedStrokePoint structures that contain timestamp, position, radius, aspectRatio, edgeWidth, force, azimuth (scaled radians), altitude, and opacity. I had to look at disassembled libraries to figure that part out. Peeking at PencilKit again with Hopper makes me think that the structure layout may have changed since I wrote that code.