rizinorg / cutter-jupyter

Jupyter Plugin for Cutter
GNU General Public License v3.0
24 stars 5 forks source link

function cutter.cmdj() JSONDecodeError: Expecting value: line 1 column 1 (char 0) #8

Closed idandre closed 5 years ago

idandre commented 5 years ago

error stats

I am not sure if this is because I am using r2 3.6.0 ( newest is 3.8.0)

Input: import cutter cutter.cmd('s main') cutter.cmdj('pd')

Output:

JSONDecodeError Traceback (most recent call last)

in 1 import cutter 2 cutter.cmd('s main') ----> 3 cutter.cmdj('pd') :/python/cutter.py in cmdj(command) /usr/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 346 parse_int is None and parse_float is None and 347 parse_constant is None and object_pairs_hook is None and not kw): --> 348 return _default_decoder.decode(s) 349 if cls is None: 350 cls = JSONDecoder /usr/lib/python3.7/json/decoder.py in decode(self, s, _w) 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() 339 if end != len(s): /usr/lib/python3.7/json/decoder.py in raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0) ![error](https://user-images.githubusercontent.com/41512496/62834004-14d95c80-bc47-11e9-9a43-a78924897450.png)
Adikso commented 5 years ago

cutter.cmdj is decoding json output from radare but pd command is not returning json. You should use pdj if you want json or use cutter.cmd instead to get raw output.

idandre commented 5 years ago

;( This totally makes sence. Thank you :D