airbus-seclab / bincat

Binary code static analyser, with IDA integration. Performs value and taint analysis, type reconstruction, use-after-free and double-free detection
1.68k stars 162 forks source link

Encoding issues between IDA/bincat plugin/ini file #52

Closed CrackerCat closed 6 years ago

CrackerCat commented 6 years ago

environment: win10 + IDA7.0 x86 can work,but armv7 is error.

error info

Using FLIRT signature: ARM library little endian Propagating type information... Function argument information has been propagated The initial autoanalysis has been finished. WARNING:bincat.gui.pluginoptions:IDAUSR not defined, using C:\Users\CKCat\AppData\Roaming\Hex-Rays\IDA Pro Note: FormToPyQtWidget: importing 'sip' module into <module 'main' from ''> INFO:bincat.plugin:IDABinCAT ready. DEBUG:bincat-cfg:Reading config from C:\Users\CKCat\AppData\Roaming\Hex-Rays\IDA Pro\idabincat\conf\default.ini DEBUG:bincat-cfg:Reading OS config from C:\Users\CKCat\AppData\Roaming\Hex-Rays\IDA Pro\idabincat\conf\linux-armv7.ini INFO:bincat.gui:Launching the analyzer Traceback (most recent call last): File "C:/Users/CKCat/AppData/Roaming/Hex-Rays/IDA Pro/plugins\idabincat\gui.py", line 265, in launch_analysis self.s.configurations[config_name] = self.s.edit_config File "C:/Users/CKCat/AppData/Roaming/Hex-Rays/IDA Pro/plugins\idabincat\analyzer_conf.py", line 553, in wrap f(self, *args, **kwargs) File "C:/Users/CKCat/AppData/Roaming/Hex-Rays/IDA Pro/plugins\idabincat\analyzer_conf.py", line 599, in setitem self._configs[name] = str(config) File "C:/Users/CKCat/AppData/Roaming/Hex-Rays/IDA Pro/plugins\idabincat\analyzer_conf.py", line 407, in str self._config.write(sio) File "C:\python27-x64\Lib\ConfigParser.py", line 412, in write key = " = ".join((key, str(value).replace('\n', '\n\t'))) UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-13: ordinal not in range(128)

CrackerCat commented 6 years ago

I know the cause because i use the old remap file, but the bincat plugin seem clash with Lighthouse plugin. when two plugin is installed ,the ida will crash.

trou commented 6 years ago

Thank you for your report.

Two questions:

CrackerCat commented 6 years ago
  1. BinCAT version : 0.7.
  2. binary path have non ASCII characters. the plugin is good ,thank you work.
trou commented 6 years ago

OK it's probably a pb with non ASCII chars, I'll try to fix it tomorrow.

trou commented 6 years ago

For reference, making this work is definitely not as easy as I initially thought:

So lots of fun things involved...

trou commented 6 years ago

and of course, OCaml's Unix.openfile on Windows fails if the path is in UTF-8 because it should use whatever stuff Windows uses.

trou commented 6 years ago

Should be fixed in 98cc155604619df3cc9ab6689f3779035952d1e5