Need to step thorugh "__objc_selrefs" segment in the segment table of IDA Pro with Python

82 views
Skip to first unread message

Mohammad Masudur Rahman

unread,
Dec 16, 2014, 12:55:34 PM12/16/14
to idap...@googlegroups.com

Hello IDA Support Team,

 

I am working with a licensed version of IDA pro And need to step through  "__objc_selrefs" segment from segment table and store the results in a file with python. I know  the start address and end address of  "__objc_selrefs" segment.

 

In a short I need to do following.

 

    1. uses the IDA API to get start and end address of the "__objc_selrefs" segment .
    2. steps through that segment and store entries in a list :  Cant find anything for this one.
    3. write that list to a temporary file.

 

 

I have solutions for 1 and 3 but cant figure out no 2 in API documentation. I need to your help if you can refer me to the APi doc where I can find the Segment details like following.

 

 

Your help will be much appreciated.

 

Cheers and Christmas greetings,

Rahman

 

segment.PNG

Elias Bachaalany

unread,
Dec 25, 2014, 11:55:15 PM12/25/14
to idap...@googlegroups.com
Hello,
  1. Use idc.SegStart / idc.SegEnd
  2. Depending on what is the segment content, you can use idc.Dword() to retrieve Dwords, etc... or idc.GetString()
  3. Writing to a file can be done using the usual Python functionality. f=open/f.write/f.close
--
Elias

Sebastian Muniz

unread,
Dec 26, 2014, 10:01:02 AM12/26/14
to idap...@googlegroups.com
Hi Mohammad,

You might want to take a look at the examples directory on IDA Python repo at:

https://code.google.com/p/idapython/source/browse/#svn%2Ftrunk%2Fexamples

Lots of code you might be interesting in!

~cheers, topo

On 26/12/14 01:55, Elias Bachaalany wrote:
> Hello,
>
> 1. Use idc.SegStart / idc.SegEnd
> 2. Depending on what is the segment content, you can use idc.Dword() to
> retrieve Dwords, etc... or idc.GetString()
> 3. Writing to a file can be done using the usual Python functionality.
> f=open/f.write/f.close
>
> --
> Elias
>
Reply all
Reply to author
Forward
0 new messages