mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 18:16:55 +01:00
idc.py: Fixed AskSelector() and FindSelector()
This commit is contained in:
parent
187f75d329
commit
565a80c62e
@ -2705,12 +2705,14 @@ def AskSelector(sel):
|
|||||||
|
|
||||||
@note: selector values are always in paragraphs
|
@note: selector values are always in paragraphs
|
||||||
"""
|
"""
|
||||||
sel = idaapi.getn_selector(sel)
|
s = idaapi.sel_pointer()
|
||||||
|
base = idaapi.ea_pointer()
|
||||||
|
res,tmp = idaapi.getn_selector(sel, s.cast(), base.cast())
|
||||||
|
|
||||||
if not sel:
|
if not res:
|
||||||
return sel
|
return sel
|
||||||
else:
|
else:
|
||||||
return sel.base
|
return base.value()
|
||||||
|
|
||||||
|
|
||||||
def FindSelector(val):
|
def FindSelector(val):
|
||||||
@ -2724,12 +2726,7 @@ def FindSelector(val):
|
|||||||
|
|
||||||
@note: selector values are always in paragraphs
|
@note: selector values are always in paragraphs
|
||||||
"""
|
"""
|
||||||
sel = idaapi.find_selector(val)
|
return idaapi.find_selector(val) & 0xFFFF
|
||||||
|
|
||||||
if not sel:
|
|
||||||
return val & 0xffff
|
|
||||||
else:
|
|
||||||
return sel.n
|
|
||||||
|
|
||||||
|
|
||||||
def SetSelector(sel, value):
|
def SetSelector(sel, value):
|
||||||
|
Loading…
Reference in New Issue
Block a user