Windows GUI for CHDK porting - page 8 - General Discussion and Assistance - CHDK Forum

Windows GUI for CHDK porting

  • 98 Replies
  • 112251 Views
Re: Windows GUI for CHDK porting
« Reply #70 on: 03 / January / 2013, 22:12:43 »
Advertisements
Quote
Another was to just let you specify the start address manually. 
I'd prefer this.
I think I agree.

How about I leave A, S, X & Y but add a 5th menu item for "custom address".  Then I hopefully won't have to revisit this again when next year's cameras come out.


Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4052
Re: Windows GUI for CHDK porting
« Reply #71 on: 04 / January / 2013, 19:17:50 »
How about I leave A, S, X & Y but add a 5th menu item for "custom address".
Sounds good. You can also consider concentrating these settings somehow (I had to do some redundant changes to implement support for this additional fw variant).

Re: Windows GUI for CHDK porting
« Reply #72 on: 04 / January / 2013, 19:46:35 »
You can also consider concentrating these settings somehow (I had to do some redundant changes to implement support for this additional fw variant).
IIRC I was pretty much in a "brute force get it done mode" using Auto-It for the first (and only) time.  Elegance takes back seat to simple in that mode - especially when you are puzzling out how things work rather than reading the manual. 

And as usual,  the "one off" hack project is the one that you end up using and patching for years rather than going back and cleaning it up.

(and thank you for not mentioning the actual dissembler code ... )

Update :  six downloads of your patch (2 of them mine).  Are there actually four people out there building their own version of CHDK-PT ?  Really ??
« Last Edit: 04 / January / 2013, 19:55:42 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Windows GUI for CHDK porting
« Reply #73 on: 13 / January / 2013, 16:45:45 »
Released 2.07 today.  Primary change was a rework to allow user specified ROM base addresses (in response to request srca_4c)

Changes include :
  • Fixed the "Select All" function in the edit menu.
  • Added a new ROM Start Address child window, launched from the File menu.  This window now allows you to pick from one of the standard ROM start addresses or to create a custom one.
  • Removed the Camera menu - use the ROM Start Address in the File menu instead.
  • Activates the ROM Start Address child window each time a new ROM file is picked.
Download available at the usual place.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline srsa_4c

  • ******
  • 4052
Re: Windows GUI for CHDK porting
« Reply #74 on: 01 / February / 2013, 13:27:01 »
Since I got fed up seeing tiny letters in the disassembly box (note that I'm running CHDK-PT on Wine, not Windows)



I decided to implement setting the font, so that I can choose one according to my taste



The code isn't perfect, but it works. Menu: Format -> Choose Font (disassembly)

Re: Windows GUI for CHDK porting
« Reply #75 on: 01 / February / 2013, 18:39:49 »
Since I got fed up seeing tiny letters in the disassembly box (note that I'm running CHDK-PT on Wine, not Windows)
I had the same issue - but being lazy I just I tweaked Wine settings.

Quote
The code isn't perfect, but it works. Menu: Format -> Choose Font (disassembly)
Thanks.   I'll take a look this weekend and roll it into a 2.08 release.   Might be enough to put the package past its 500th download.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Windows GUI for CHDK porting
« Reply #76 on: 07 / February / 2013, 22:40:06 »
Updated to release level 2.08 to  include srsa_4c's font selection menu item.
« Last Edit: 10 / February / 2013, 10:24:14 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Windows GUI for CHDK porting
« Reply #77 on: 10 / February / 2013, 10:23:54 »
    What next ?

    Given the continued use of this tool for porting and recent activity to add features to make it easier to use (props to srsa_4c),  I had a couple of other ideas but want to see what people think.
    • nafraf has developed some scripts for porting the C tasks between different firmware versions :
           http://chdk.wikia.com/wiki/GPL:hex2task.sh?rcid=31932
            http://chdk.setepontos.com/index.php?topic=7180.msg90526#msg90526
      Might make sense to integrate that into CHDK-PT?
    • The strings.txt file included with each f/w dump in the repository seems to have a lot of usefull information ? Is it worth adding some sort of lookup function to spot string references in CHDK-PT dissassembly ?
    • If we knew a bit more about the files used to setup IDA for CHDK dissassembly we might be able to find useful information there.  I tried googling the format of those files but they seem to be proprietary.
    • When translating between firmware versions that do not have the
      //** FUNCTION_NAME  @ START_ADDRESS
      comments generated by CHDK-PT,  I frequently look for labels in each function that contain address information and then count backwards by 4 through the listing to get the start address of the routine.  Would it be worth adding a feature to "auto label" existing C task files as part of generating the address.txt file ?

    Other thoughts ?
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline srsa_4c

  • ******
  • 4052
Re: Windows GUI for CHDK porting
« Reply #78 on: 10 / February / 2013, 13:28:03 »
 :-[ Well, I have to admit that I'm only using the "get a nicely formatted assembly function from a given address" facility of the program.

Seeing descriptive names of known functions makes work a bit easier. nafraf's solution relies on standard (GNU) utilities, you would have to include them or you could choose to do the parse/replace operation in a different way. Also, you need to be sure to have a reliable source of those address-name pairs The output of finsig_dryos is close to perfect, but I don't know whether it still has false positives in certain cases. You could check some "signature" in that file, to avoid loading sigs generated by the earlier finsig. Or, you could combine stubs_entry.S and stubs_entry_2.S if the user swears that every false entry is corrected in the latter.

Quote
  • The strings.txt file included with each f/w dump in the repository seems to have a lot of usefull information ? Is it worth adding some sort of lookup function to spot string references in CHDK-PT dissassembly ?
Can you give an example? The string dump contains lots of false positives and localized strings.Oh, I read "differences" instead of "references". Yes, it's a good idea to include useful strings as comment.

Quote
  • If we knew a bit more about the files used to setup IDA for CHDK dissassembly we might be able to find useful information there.  I tried googling the format of those files but they seem to be proprietary.
Which files?
« Last Edit: 10 / February / 2013, 13:30:46 by srsa_4c »

Re: Windows GUI for CHDK porting
« Reply #79 on: 10 / February / 2013, 13:38:45 »
:-[ Well, I have to admit that I'm only using the "get a nicely formatted assembly function from a given address" facility of the program.
That's what I started out to do so its okay with me.  If you have access to IDA then its going to be a much better tool for exploring the ROM dump itself.

Quote
Seeing descriptive names of known functions makes work a bit easier. nafraf's solution relies on standard (GNU) utilities, you would have to include them or you could choose to do the parse/replace operation in a different way.
He sent me something with it recoded into standard C - that's part of what prompted my recent post.

Quote
Also, you need to be sure to have a reliable source of those address-name pairs The output of finsig_dryos is close to perfect, but I don't know whether it still has false positives in certain cases. You could check some "signature" in that file, to avoid loading sigs generated by the earlier finsig. Or, you could combine stubs_entry.S and stubs_entry_2.S if the user swears that every false entry is corrected in the latter.
Yea - using a false positive in the code could be a nasty thing to find during initial camera porting.  Might make more sense to leave dissassembled addresses in hex and add the name as a comment only ?

Quote
Can you give an example? The string dump contains lots of false positives and localized strings.
Again, adding a "hit" as a comment seems safe enough.  Question is does anything in there tell you much?

Quote
Which files?
These ones :  http://www.definethis.org/temp/chdk/CanonFW_A-Series_Signatures_for_IDA.rar

Somehow that seems to be enough to turn a raw dissassembly into something much more readable if I understand the instructions here correctly : http://chdk.wikia.com/wiki/Loading_dump_to_IDA
« Last Edit: 10 / February / 2013, 13:40:31 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics