1 # ScratchABit - interactive disassembler
3 # Copyright (c) 2015 Paul Sokolovsky
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 from scratchabit
import engine
24 def GetSegmentAttr(ea
, attr
):
25 assert attr
== SEGATTR_PERM
26 off
, area
= engine
.ADDRESS_SPACE
.addr2area(addr
)
27 props
= engine
.area_props(area
)
30 ret |
= idaapi
.SEGPERM_READ
32 ret |
= idaapi
.SEGPERM_WRITE
34 ret |
= idaapi
.SEGPERM_EXEC
38 def MakeAlign(ea
, cnt
, align
):
39 engine
.ADDRESS_SPACE
.make_filler(ea
, cnt
)