LoRexxar / Kunlun-M

KunLun-M是一个完全开源的静态白盒扫描工具,支持PHP、JavaScript的语义扫描,基础安全、组件安全扫描,Chrome Ext\Solidity的基础扫描。
MIT License
2.24k stars 311 forks source link

TypeError: unhashable type: 'BinaryOp' #213

Open p7e4 opened 2 years ago

p7e4 commented 2 years ago

Python Environment

Python 3.8

Description

<?php
define( __NAMESPACE__ . "1", __NAMESPACE__ . "2");
 [05:42:14] [AST][Pretreatment] new define BinaryOp('.', MagicConstant('__NAMESPACE__', None), '1')=BinaryOp('.', MagicConstant('__NAMESPACE__', None), '2')
 [05:42:14] Traceback (most recent call last):
  File "/root/kunlun/core/__init__.py", line 303, in main
    cli.start(args.target, args.format, args.output, args.special_rules, sid, args.language, args.tamper_name, args.black_path, args.unconfirm, args.unprecom)
  File "/root/kunlun/core/cli.py", line 252, in start
    ast_object.pre_ast_all(main_language, is_unprecom=is_unprecom)
  File "/root/kunlun/core/pretreatment.py", line 90, in pre_ast_all
    loop.run_until_complete(asyncio.gather(*scan_list))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/root/kunlun/core/pretreatment.py", line 152, in pre_ast
    self.define_dict[key] = define_params[1].node
TypeError: unhashable type: 'BinaryOp'
LoRexxar commented 2 years ago

看上去是这个语法套娃的问题