aioqzone / pychaosvm

A Python envirionment for Tencent ChaosVM.
GNU Affero General Public License v3.0
67 stars 50 forks source link

Err: TypeError: undefined is not a function #38

Closed anilken closed 9 months ago

anilken commented 9 months ago

It gives an error when it tries to parse more than once.

from chaosvm import prepare
from urllib.parse import unquote

with open("js/vm.js.bak", encoding="utf8") as f:
    tdc = prepare(f.read(), ip="", mouse_track=[(50, 42), (50, 55)])
    print( tdc.getInfo().__dict__ )             # a python dict
    print( unquote(tdc.getData(None, True)) )   # a python str
{'info': "'8+Zjzy9Ja2GgOsYJI7XywVwk3GS2LpII4INv+GUIsxoFnEpa2ztg4urIC/g6EVgeWWAtxntCGjL4UXw/U8yay19z5meR4VQadVxPIgkmfHW/WxzNKwe/YYbvYSVXvevHszP1GJvxRrFQsEEXnVdoJFIDB/JAS0/+2GZ74rDV2k2yOT/k8KCXcZ1sFXE1GblEmNuDjOdWUGtf6SzUek3NfsO3qaIYLutf70Qn0pDBdqc='", 'tokenid': 1316394588}

UjvDnMOFw5PDscKqw7N/woFaw6LClsOgN8K5fXgHBkzCpC5bwqJDw6jDh8Khwq7DgcOiwoLCkMKywofDp8KsZgHCpSzCksKKHsKpQ8O6w5HCh3Biwo7DpGnDvXbDrsKaw4RbV8OwHsOKw4bDvMKvwr0dw7LDtcKaw5/Ds8OewqJ2woYzOMKzNsO8w6IJFVrDmsKTAsOiUMOBwp/.....

Trying to parse second time with same code

with open("js/vm.js.bak", encoding="utf8") as f:
    tdc = prepare(f.read(), ip="", mouse_track=[(50, 42), (50, 55)])
    print( tdc.getInfo().__dict__ )             # a python dict
    print( unquote(tdc.getData(None, True)) )   # a python str

Result

{'info': "'8+Zjzy9Ja2GgOsYJI7XywVwk3GS2LpII4INv+GUIsxoFnEpa2ztg4urIC/g6EVgeWWAtxntCGjL4UXw/U8yay19z5meR4VQadVxPIgkmfHW/WxzNKwe/YYbvYSVXvevHszP1GJvxRrFQsEEXnVdoJFIDB/JAS0/+2GZ74rDV2k2yOT/k8KCXcZ1sFXE1GblEmNuDjOdWUGtf6SzUek3NfsO3qaIYLutf70Qn0pDBdqc='", 'tokenid': ''}

Err: TypeError: undefined is not a function