Written by Igor Nesterov (C) 2003
Download SDK http://yahm.palmoid.com/yahm_dev.zipYAHM is a hack manager for executing native hacks, written in native ARM code.
YAHM for PalmOS 5 based on YAHM hack manager. YAHM works as usual hack manager, running on top of PalmOS 3.x-4.x with m68k code resources. YAHM can't patch m68k syscalls under PalmOS5, like any other 'legacy' hack manager. You can read about hacks and PalmOS5 in excellent article "Hacks on PalmOS 5" by Daniel Seifert at http://www.dseifert.de/hacks/hack5.html.
Instead YAHM offers completely new approach to writing hacks for PalmOS5. This approach allow you to write syscall patches in native ARM code.
Pros:
Contras:
ARM hacks looks like old-style hacks. It is resource database with type 'HACK'. Resources:
struct ArmTrapInfo{ UInt32 baseTableOffset; // offset of table from R9 (without negative sign) UInt32 offset; // offset into table UInt32 thumb; // 0 for ARM code, 1 for thumb code UInt32 zero0; // should be zero UInt32 zero1; // should be zero }; |
HEX "TRA5" ID 1000 00 00 00 12 00 00 02 04 00 00 00 00 00 00 00 00 00 00 00 00 |
LDR R12, [R9,-12] MOV LR,PC LDR PC, [R12,#516] |
Complete list of syscalls you can found in file SysTables.txt inside archive.
12 encoded in the first word and 516 == 0x204 in second word. Note, that keyword HEX in pilrc doesn't interpret all bytes inside as hex, you should use prefix 0x for it.
#include <standalone.h> #include "../Include/endianutils.h" #include "../Include/os5.h" #include <palmos.h> #define RESID 1000 STANDALONE_CODE_RESOURCE_TYPESTR_ID("armc", RESID); typedef UInt32 (*pfnFrmCustomAlert)(UInt32 alertId, const char * s1, const char * s2, const char * s3); UInt32 MyFrmCustomAlert1(UInt32 alertId, char * s1, const char * s2, const char * s3){ pfnFrmCustomAlert oldTrap; if (alertId == 11730){ //turn on beam receive after beaming. return 1; } FtrGet('BEAM', RESID, (UInt32 *)&oldTrap); return oldTrap(alertId, s1, s2, s3); } |
#define DmDatabaseInfo DmDatabaseInfoV40 #define SysCurAppDatabase SysCurAppDatabaseV40 #define DmGetNextDatabaseByTypeCreator DmGetNextDatabaseByTypeCreatorV40 #define SysUIAppSwitch SysUIAppSwitchV40 #define DmCreateDatabase DmCreateDatabaseV40 #define DmFindDatabase DmFindDatabaseV40 #define DmSetDatabaseInfo DmSetDatabaseInfoV40 #define DmOpenDatabaseInfo DmOpenDatabaseInfoV40 |
arm-palmos-gcc -Wall -Wno-multichar -fshort-enums -fpack-struct -O1 -DMY_CRID='BEAM' -nostartfiles \ -c -o code03e8.o code03e8.c arm-palmos-gcc -O2 -Wall -nostartfiles -o code03e8 code03e8.c libarmboot.a libarmui.a build-prc --no-check-resources -o NoBeamDialog.prc -n "NoBeamDialog" \ -c BEAM -t 'HACK' NoBeamDialog.ro code03e8 |