1 " STMFD SP!, {R0}\n" 2 //R3 = Pointer to task function to create 3 4 /*** INSTALL capt_seq_task() hook ***/ 5 " LDR R0, =task_CaptSeq\n" // DryOS original code function ptr. 6 " CMP R0, R3\n" // is the given taskptr equal to our searched function? 7 " LDREQ R3, =capt_seq_task\n" // if so replace with our task function base ptr. 8 " BEQ exitHook\n" // below compares not necessary if this check has found something. 9 10 /*** INSTALL exp_drv_task() hook ***/ 11 //" LDR R0, =task_ExpDrv\n" 12 //" CMP R0, R3\n" 13 //" LDREQ R3, =exp_drv_task\n" 14 //" BEQ exitHook\n" 15 16 /*** INSTALL filewrite() hook ***/ 17 //" LDR R0, =task_FileWrite\n" 18 //" CMP R0, R3\n" 19 //" LDREQ R3, =filewritetask\n" 20 //" BEQ exitHook\n" 21 22 /*** INSTALL movie_record_task() hook ***/ 23 //" LDR R0, =task_MovieRecord\n" 24 //" CMP R0, R3\n" 25 //" LDREQ R3, =movie_record_task\n" 26 //" BEQ exitHook\n" 27 28 /*** INSTALL liveimage_task() hook ***/ 29 //" LDR R0, =task_LiveImageTask\n" 30 //" CMP R0, R3\n" 31 //" LDREQ R3, =liveimage_task\n" 32 //" BEQ exitHook\n" 33 34 /*** INSTALL init_file_modules_task() hook ***/ 35 " LDR R0, =task_InitFileModules\n" 36 " CMP R0, R3\n" 37 " LDREQ R3, =init_file_modules_task\n" 38 39 "exitHook:\n" 40 // restore overwritten registers 41 " LDMFD SP!, {R0}\n" 42 // Execute overwritten instructions from original code, then jump to firmware