At 10:13 PM 8/7/2004, you wrote:
In order to protect my program from being altered by hackers, I want to
check the checksum of one of the code segments. If the checksum is different
from expected, then the program knows someone tampered with it and the
program aborts. For this to work, the binary code in the segment must be
exactly the same no matter which OS version it runs on. From my
experiements, it does seem to work (on Emulators and Simulators.) But what I
don't understand is: Supposedly, theoretically, it shouldn't work! I mean
when the program is loaded (or installed?), the OS would fix up addresses in
code segments, and supposedly different OS versions will generate different
addresses. That is, the binary code would be different on different OS and
the checksum should fail! Am I right?

In Palm OS 68K programming, no fixup are performed to the program text. All of the fixups are done to the data sections, but the code remains as compiled. This is because Palm OS uses an execute-in-place architecture, and references within a code module are either PC-relative or A5-relative (to the data section). Intersection jumps are handled using a jumptable stored in the data section.


Palm OS Protein development is different -- there, your code is still execute-in-place, but the OS does do code fixups, and those get adjusted when the OS moves the chunks of code around in memory.

-- Ben Combee, DTS technical lead, PalmSource, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Palm OS Dev Fourm Archives: http://news.palmos.com/read/all_forums/



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to