alterakey / trueseeing

Non-decompiling Android app vulnerability scanner (DC25 demo lab, CB17)
GNU General Public License v3.0
60 stars 14 forks source link

Text search should not fail on non-UTF-8 data #523

Closed alterakey closed 6 months ago

alterakey commented 6 months ago

It seems like we crash on matches in binary (non-UTF-8) data in searching.

ts[./target.apk]> /s Changed
[*] searching: Changed
...
[-] fatal: unhandled exception
Traceback (most recent call last):
  File "/Users/alterakey/works/trueseeing/wc/.venv/lib/python3.9/site-packages/trueseeing/app/inspect.py", line 199, in run
    await self._run(s)
  File "/Users/alterakey/works/trueseeing/wc/.venv/lib/python3.9/site-packages/trueseeing/app/inspect.py", line 219, in _run
    if not await self._run_cmd(o, line=s):
  File "/Users/alterakey/works/trueseeing/wc/.venv/lib/python3.9/site-packages/trueseeing/app/inspect.py", line 257, in _run_cmd
    await self._as_cmd(ent['e'](args=tokens))
  File "/Users/alterakey/works/trueseeing/wc/.venv/lib/python3.9/site-packages/trueseeing/app/inspect.py", line 265, in _as_cmd
    await coro
  File "/Users/alterakey/works/trueseeing/wc/.venv/lib/python3.9/site-packages/trueseeing/app/cmd/search.py", line 74, in _search_string
    ui.info('{}:{:d}:{:d}: {}'.format(path, nr+1, m.start(), t.decode('utf-8')))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 24: invalid continuation byte