import idc
import idautils
import ida_offset

reftype = ida_offset.get_default_reftype(next(idautils.Segments()))

for segea in idautils.Segments():
    for head in idautils.Heads(idc.SegStart(segea), idc.SegEnd(segea)):
        if not idc.isCode(idc.GetFlags(head)):
            continue

        for i in range(2):
            if idc.SegStart(idc.GetOperandValue(head, i)) == idc.BADADDR:
                continue
            ida_offset.op_offset(head, i, reftype)

print("ok")

@@ -173,28 +173,34 @@
 s.Heads(idc.
-SegS
+get_segm_s
 tart(segea),
@@ -208,12 +208,18 @@
 idc.
-SegE
+get_segm_e
 nd(s
@@ -247,25 +247,44 @@
 t id
-c.isC
+a_bytes.is_c
 ode(id
-c.GetF
+a_bytes.get_full_f
 lags
@@ -364,12 +364,18 @@
 idc.
-SegS
+get_segm_s
 tart
@@ -383,19 +383,21 @@
 idc.
-GetO
+get_o
 perand
-V
+_v
 alue

Add files via upload