One thing that I don't think I see though is CHDK-PT's ability to use an addresses.txt file for an existing port to search for the equivalent code is a different firmware version. Typically not a big deal for boot.c but sometimes video_rec.c and capt_seq.c get offset somewhat it memory so you would need to hand edit your instructions_file to create a new port.
Thinking about possible GUI functionality to roll this into CHDK-PT :Enable CHDK-PT read the instructions_file and ROMfile and produce a dissassembly in the text window. Add color coding to dissassembly lines that have been edited or added by the instructions_file.Enable CHDK-PT to read the instructions_file and create one for a new firmware version.Create an edit mode where the tag lines in the instructions_file can be created in the dissassemly window. Right click on a line in the raw dissassembly and you get a pop-menu that allows you to tag the line or add a new tagged line. Color code the edit as you go. Dump the final result to a file (overwrite or append options).I'm sure there are other things - these are just my first thoughts.
That's why I added the ability to lookup function addresses using the names found in the stubs_entry.S and stubs_entry_2.S files.
In attachment an example of PATCHSUB use, I'm getting unexpected results, maybe a bug, maybe an error in input file:file0: patch to task_FileWrite, last instruction patched. second function is disassembled without problems.file2: patch to task_FileWrite, use of multiple patch references second function is disassembled wrong, function start some instructions later.file4: patch to task_FileWrite, use of multiple patch without references second function is disassembled wrong, function start some instructions later.I'm using remote capture v3 branch, sx240/100c files as input.Thanks
File2.txt & file4.txt is a bug - attached source should fix it.
//mod start "LDR R3, =current_write_ignored\n" "LDR R3, [R3]\n" "CMP R3, #0\n" "BNE loc_FFA5229C\n" // jump over the next block <==== BRANCH //mod end " BL sub_FF83015C \n". " B loc_FFA522A0 \n"."loc_FFA5229C:\n" " BL fwt_close\n" // mod! sub_FF830158 Close
Quote from: philmoz on 04 / June / 2013, 20:51:31File2.txt & file4.txt is a bug - attached source should fix it.Thanks, it worked.In attachment, the commands to port remote capture functions for SX260, the same file seems to work with R50 Axxxx cameras. I have not tested it in any camera yet, it was only a code_gen command exercise. remote capture function uses an uncommon patch, a branch instruction is added. a810.100b capt_seq.c:Code: [Select]//mod start "LDR R3, =current_write_ignored\n" "LDR R3, [R3]\n" "CMP R3, #0\n" "BNE loc_FFA5229C\n" // jump over the next block <==== BRANCH //mod end " BL sub_FF83015C \n". " B loc_FFA522A0 \n"."loc_FFA5229C:\n" " BL fwt_close\n" // mod! sub_FF830158 Close Maybe a new command for a future release?
FUNC ref=2 length=102ASMFW 14>>>//mod start" LDR R3, =current_write_ignored\n"" LDR R3, [R3]\n"" CMP R3, #0\n"" BNE loc_skip\n" // jump over the next block" BL sub_FF83015C \n"." B loc_FFA522A0 \n"."loc_skip:\n"//mod end<<<SKIP 2PATCHSUB name=fwt_closeFW $ENDASMENDFUNC
FUNC ref=2 length=102ASMFW 14>>>//mod start" LDR R3, =current_write_ignored\n"" LDR R3, [R3]\n"" CMP R3, #0\n"" BNE loc_B\n" // jump over the next block//mod end<<<FW 2>>>"loc_B:\n"<<<PATCHSUB name=fwt_closeFW $ENDASMENDFUNC
Started by jefflee3170 General Discussion and Assistance
Started by zeno « 1 2 3 4 » General Help and Assistance on using CHDK stable releases
Started by tony22 General Help and Assistance on using CHDK stable releases
Started by andyroo Firmware Dumping
Started by kidtree « 1 2 » Script Writing