Author Topic: How to copy functions from IDA  (Read 1728 times)

Offline noname

  • Newbie
  • *
  • Posts: 4
How to copy functions from IDA
« on: 03 / April / 2008, 18:03:59 »
  • Publish

  •  I'm not very familiar to IDA,so please bear with me as I ask the following silly question.

    When I try to copy a function into my code from the IDB file,I just select the portion and right click to get
    copy option and then copy and paste it in wordpad. But what annoying thing happens is that before each
    line, the ROM locations are also copied,so I've to manually remove those from hundreds of line. Also copied
    are IDA comments like "; CODE XREF ...." which I don't want to copy.

    What is the proper way of copying a function?(I'm sure this is not!)

    Offline ewavr

    • Developers
    • Hero Member
    • ****
    • Posts: 1057
    • A710IS
    Re: How to copy functions from IDA
    « Reply #1 on: 03 / April / 2008, 18:27:34 »
  • Publish
  • Look to asmify.sh script in trunk/tools (for Windows). For Linux - same script in vitalyb branch.

    Offline noname

    • Newbie
    • *
    • Posts: 4
    Re: How to copy functions from IDA
    « Reply #2 on: 03 / April / 2008, 18:28:53 »
  • Publish
  • I just found out another way,by changing preferences in Options->General tab of IDA.

    Edit: But it does not insert quotation marks and newline symbols (that is needed by gcc)
    which asmify.sh does. So using 'asmify.sh' will be best.
    « Last Edit: 03 / April / 2008, 18:49:33 by noname »

    Offline ilovechdk

    • Newbie
    • *
    • Posts: 2
    Re: How to copy functions from IDA
    « Reply #3 on: 03 / April / 2008, 22:58:09 »
  • Publish
  • But what is the command to run asmify.sh? Should it be run on bash.exe supplied in the gcc environment
    for CHDK? What is the actual syntax?

    Offline ewavr

    • Developers
    • Hero Member
    • ****
    • Posts: 1057
    • A710IS
    Re: How to copy functions from IDA
    « Reply #4 on: 04 / April / 2008, 00:01:02 »
  • Publish
  • But what is the command to run asmify.sh? Should it be run on bash.exe supplied in the gcc environment
    for CHDK? What is the actual syntax?

    sh.exe asmify.sh < in.txt > out.txt

    Offline ilovechdk

    • Newbie
    • *
    • Posts: 2
    Re: How to copy functions from IDA
    « Reply #5 on: 04 / April / 2008, 00:11:43 »
  • Publish
  • Thanks a lot,ewavr. Now I can get the required things by typing those commands at 'sh.exe' prompt.

    Offline bongo_bingo

    • Full Member
    • ***
    • Posts: 167
      • My photos at DA
    Re: How to copy functions from IDA
    « Reply #6 on: 04 / June / 2008, 22:59:28 »
  • Publish
  • Thanks a lot even from me :)

     


    SimplePortal 2.3.3 © 2008-2010, SimplePortal