Skip to content

Commit

Permalink
python: cast skipdata function inside binding to simplify the API
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Oct 1, 2016
1 parent 0662879 commit 5b80627
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/python/capstone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def skipdata_setup(self, opt):
_skipdata_opt = _cs_opt_skipdata()
_mnem, _cb, _ud = opt
_skipdata_opt.mnemonic = _mnem.encode()
_skipdata_opt.callback = ctypes.cast(_cb, CS_SKIPDATA_CALLBACK)
_skipdata_opt.callback = CS_SKIPDATA_CALLBACK(_cb)
_skipdata_opt.user_data = ctypes.cast(_ud, ctypes.c_void_p)
status = _cs.cs_option(self.csh, CS_OPT_SKIPDATA_SETUP, ctypes.cast(ctypes.byref(_skipdata_opt), ctypes.c_void_p))
if status != CS_ERR_OK:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/test_skipdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_class():
# NOTE: This example ignores SKIPDATA's callback (first None) & user_data (second None)

# To customize the SKIPDATA callback, uncomment the line below.
# md.skipdata_setup = (".db", CS_SKIPDATA_CALLBACK(testcb), None)
# md.skipdata_setup = (".db", testcb, None)

for insn in md.disasm(code, 0x1000):
#bytes = binascii.hexlify(insn.bytes)
Expand Down

0 comments on commit 5b80627

Please sign in to comment.