Index: platform/g10/sub/102a/boot.c===================================================================--- platform/g10/sub/102a/boot.c (revision 3359)+++ platform/g10/sub/102a/boot.c (working copy)@@ -5,6 +5,7 @@ #include "stdlib.h" #include "gui.h" #include "../../../../core/gui_draw.h"+#include "dryos31.h" const char * const new_sa = &_end; @@ -457,6 +458,9 @@ " BLNE sub_FF87CD38 \n" //" BL sub_FF878098 \n" " BL sub_FF878098_my\n" //----------->++"BL replace_catfshandlers \n"+ " BL core_spytask_can_start\n" // + " CMP R4, #0 \n" " MOVEQ R0, R5 \n" @@ -808,3 +812,26 @@ " B loc_FF84B25C \n" ); }++static int (*orig_catfsopen)(int handle, char *name, int flags, int mode, int stuff);++static int my_catfsopen(int handle, char *name, int flags, int mode, int stuff) {+ task_t** tt = (task_t**)0x1958;+ extern void _LogCameraEvent(int,char*,int,int);+ _LogCameraEvent(0x20,"open: %s, 0x%x",(int)name,(int)name);+ _LogCameraEvent(0x20,"open in task %s 0x%x",(*tt)->name,(int)((*tt)->name));+ return orig_catfsopen(handle, name, flags, mode, stuff);+}++static int my_catfshandlers[9];++void replace_catfshandlers() {+ // copy handlers+ _memcpy(my_catfshandlers,(void*)0xFFB0FFA8,9*4);+ // get orignal open handler+ orig_catfsopen = (void*) my_catfshandlers[0];+ // replace open handler with our wrapper+ my_catfshandlers[0] = (int) my_catfsopen;+ // replace handler list pointer+ *(int*)0x10cec = (int)&my_catfshandlers[0];+}Index: platform/g10/sub/102a/stubs_entry_2.S===================================================================--- platform/g10/sub/102a/stubs_entry_2.S (revision 3359)+++ platform/g10/sub/102a/stubs_entry_2.S (working copy)@@ -16,3 +16,4 @@ NHSTUB(Mount_FileSystem, 0xFF81093C ) NHSTUB(SetZoomActuatorSpeedPercent, 0xFF81093C ) +NHSTUB(LogCameraEvent, 0xFF874ABC)
Started by bluelen General Discussion and Assistance
Started by panic General Discussion and Assistance
Started by mary Feature Requests
Started by atomtwelve General Help and Assistance on using CHDK stable releases
Started by jdstech « 1 2 3 » General Help and Assistance on using CHDK stable releases