However it does report 4 other locations (which have the same structure). Not sure what these ones are for, but the one selected is the one referenced in GetFocusLensSubjectDistanceFromLens.
I suppose that this is where not limiting the signature length can help in differentiating the correct one.
Actually, in this particular example, extending the signature length fails. In all the reference builds (and even the SX10 dump) the GetFocusLensSubjectDistance function is followed immediately by another function instruction (either a STM or LDR then STM instruction set), but in the 200 dump, it is followed by a literal pool. So allowing the reference function to extend beyond the initial 10 instructions actually disqualifies the correct function.
Right, but in this case I decided that 1 bad match is better than 17 (and many more sub-versions) with 4+ partial matches. If I remember right, the 10 instruction limit meant that actually only 3 instructions were actually used (because as mentioned earlier, the sig finder ignores some instructions).
One question about the sig finder. This function ends in a non-returning branch instruction (ie. the function is continued elsewhere). Does/can the sig finder be made to follow this branch instruction to build and compare function signatures?
No, it doesn't follow branches at all. Updating it means re-working the whole system, because it will affect all existing files. The ability to branches has long been on my list of things for a "next generation" sig finder. Really, we shouldn't use the automatically generated files directly. Once a function is found and known correct, it should be "frozen" and only updated if needed (but somehow, we should maintain the information of how it was found in the first place). The whole thing is a hack and doesn't really scale to the number of cameras variants we have. It is also horribly inefficient, meaning that a full build of all the platforms, with sig matching takes well over an hour on my windows system.
Re-working this is major undertaking, but the more I try to do these updates to all the cameras, the more convinced I am of the need. As it is, it's extremely tedious, time consuming and error prone. Changes that are trivial for one camera become a multi-day project </rant>