@@ -110,7 +110,11 @@ def activate(self, ctx):
110
110
if vdui .item .is_citem () and vdui .item .it .is_expr ():
111
111
target_item = vdui .item .e
112
112
if target_item .opname == "num" :
113
- struct_size = ida_kernwin .str2ea (idaapi .tag_remove (target_item .cexpr .print1 (None )))
113
+ size_str = idaapi .tag_remove (target_item .cexpr .print1 (None ))
114
+ # if size_str.is_numeric():
115
+ # struct_size = int(size_str, 10)
116
+ # else:
117
+ # struct_size = ida_kernwin.str2ea(idaapi.tag_remove(target_item.cexpr.print1(None)))
114
118
class SimpleCreateStructForm (idaapi .Form ):
115
119
def __init__ (self ):
116
120
idaapi .Form .__init__ (self , r"""STARTITEM 0
@@ -127,11 +131,11 @@ def __init__(self):
127
131
'gAlign' : idaapi .Form .ChkGroupControl (("ckAlign" ,)),
128
132
})
129
133
130
- def Go (self , size = 0 ):
134
+ def Go (self , size_str = "0" ):
131
135
self .Compile ()
132
136
self .ckAlign .checked = True
133
137
# f.numFieldSize.value = 4
134
- self .numSize .value = str ( size )
138
+ self .numSize .value = size_str
135
139
ok = self .Execute ()
136
140
# print "Ok = %d"%ok
137
141
if ok == 1 :
@@ -149,7 +153,7 @@ def Go(self, size=0):
149
153
self .ckAlign .checked )
150
154
return None
151
155
152
- ret = SimpleCreateStructForm ().Go (struc_size )
156
+ ret = SimpleCreateStructForm ().Go (size_str )
153
157
if ret is not None :
154
158
self .create_struct_type (* ret )
155
159
return 1
0 commit comments