TransWikia.com

idapython: getting a list of all segments

Reverse Engineering Asked by ericg on September 12, 2020

If I open the Segments subview in IDA, I can get a list of all of the segments.

I would like to access this list so I can enumerate through all of the segments.

How can I do this with idapython?

One Answer

Try to use the Segments() from idautils.

from idautils import *
from idc import *
from idaapi import *

for ea in Segments():
    print '%x-%x'%(SegStart(ea),SegEnd(ea))

Correct answer by ebux on September 12, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP