mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 05:29:53 +00:00
python: fix NEO's get_arch_info()
This commit is contained in:
parent
c6902f0f4d
commit
3d5095a2c4
@ -657,7 +657,7 @@ class CsInsn(object):
|
||||
elif arch == CS_ARCH_EVM:
|
||||
(self.pop, self.push, self.fee) = evm.get_arch_info(self._raw.detail.contents.arch.evm)
|
||||
elif arch == CS_ARCH_NEO:
|
||||
(self.pop, self.push, self.fee) = neo.get_arch_info(self._raw.detail.contents.arch.neo)
|
||||
(self.op_size, self.pop, self.push, self.fee) = neo.get_arch_info(self._raw.detail.contents.arch.neo)
|
||||
|
||||
|
||||
def __getattr__(self, name):
|
||||
|
@ -7,11 +7,22 @@ from .neo_const import *
|
||||
# define the API
|
||||
class CsNeo(ctypes.Structure):
|
||||
_fields_ = (
|
||||
('op_size', ctypes.c_byte),
|
||||
('pop', ctypes.c_byte),
|
||||
('push', ctypes.c_byte),
|
||||
('fee', ctypes.c_uint),
|
||||
)
|
||||
|
||||
def get_arch_info(a):
|
||||
return (a.pop, a.push, a.fee)
|
||||
if a.fee == NEO_FEE_0:
|
||||
return (a.op_size, a.pop, a.push, 0)
|
||||
if a.fee == NEO_FEE_01:
|
||||
return (a.op_size, a.pop, a.push, 0.1)
|
||||
if a.fee == NEO_FEE_001:
|
||||
return (a.op_size, a.pop, a.push, 0.01)
|
||||
if a.fee == NEO_FEE_002:
|
||||
return (a.op_size, a.pop, a.push, 0.02)
|
||||
if a.fee == NEO_FEE_0001:
|
||||
return (a.op_size, a.pop, a.push, 0.001)
|
||||
return None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user