wapiflapi / binglide

Visual reverse engineering tool. Veles is better, use it. Don't use this.
MIT License
585 stars 65 forks source link

IndexError on opening file #13

Open mishaturnbull opened 6 years ago

mishaturnbull commented 6 years ago

I've just installed binglide on Debian 4.18 (specifically, Kali Linux) and am having an error whenever I try to open a file. Binglide opens fine, and I can click the Open button and select a file, but as soon as I try to load the file I get the following error message in the console.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/binglide/gui.py", line 108, in open_file
    self.read_file(f)
  File "/usr/local/lib/python3.6/dist-packages/binglide/gui.py", line 102, in read_file
    self.update_data()
  File "/usr/local/lib/python3.6/dist-packages/binglide/gui.py", line 116, in update_data
    self.calc_entropy.set_data(self.data)
  File "/usr/local/lib/python3.6/dist-packages/binglide/calcs.py", line 241, in set_data
    calc_entropy(data, self.s, shannon, hist, window, increments, decrements)
  File "/usr/local/lib/python3.6/dist-packages/binglide/calcs.py", line 201, in calc_entropy
    ent += increments[fo]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

I'm not entirely convinced this isn't related to issue #8, but I'm also not convinced it is. They're both errors on startup, but applying the patch in PR #11 didn't help me. I'd be happy to open a PR to fix this, but I'm not quite familiar enough with binglide to do so.