wechaty / puppet-xp

Wechaty Puppet WeChat Windows Protocol
http://wechaty.js.org/docs/puppet-providers/xp
Apache License 2.0
460 stars 112 forks source link

Fail to run demo. #17

Closed lprintf closed 2 years ago

lprintf commented 3 years ago

environment:

windows 10
wechat 3.2.1.121
node v14.17.5
Python 3.9.6

log:

PS C:\Users\ylin\wechaty-puppet-xp> npm start

> wechaty-puppet-xp@0.4.8 start C:\Users\ylin\wechaty-puppet-xp
> ts-node examples/ding-dong-bot.ts

Puppet Version: 0.4.8

Please wait... I'm trying to login in...

11:55:13 ERR SidecarBody [SCRIPT_MESSAGRE_HANDLER_SYMBOL]() MessageType.Error: Error: access violation accessing 0x605d9728
    at <anonymous> (frida/runtime/core.js:127)
    at <eval> (/script1.js:222)
C:\Users\ylin\wechaty-puppet-xp\node_modules\sidecar\src\sidecar-body\sidecar-body.ts:400
          const e = new Error(message.description)
                    ^
Error: Error: access violation accessing 0x605d9728
    at WeChatSidecar.SidecarBody.<computed> (C:\Users\ylin\wechaty-puppet-xp\node_modules\sidecar\src\sidecar-body\sidecar-body.ts:400:21)
    at C:\Users\ylin\wechaty-puppet-xp\node_modules\frida\dist\script.js:95:21

Error: access violation accessing 0x605d9728
    at <anonymous> (frida/runtime/core.js:127)
    at <eval> (/script1.js:222)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wechaty-puppet-xp@0.4.8 start: `ts-node examples/ding-dong-bot.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wechaty-puppet-xp@0.4.8 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ylin\AppData\Roaming\npm-cache\_logs\2021-08-17T03_55_13_350Z-debug.log
cixingguangming55555 commented 3 years ago

pls run right version: wechat 3.3.0.115

lprintf commented 3 years ago

Oh, it can be started. But it logged into a robot named "filehelper". I cannot use it to process messages. logs:

23:52:02 VERB PuppetXp start()
23:52:02 VERB StateSwitch <PuppetXp> on(pending) <- (false)
23:52:02 VERB SidecarBody [ATTACH_SYMBOL]()
23:52:02 VERB SidecarBody [INIT_SYMBOL]()
23:52:02 VERB Sidecar buildAgentSource("{"initAgentScript":"...")
23:52:04 VERB SidecarBody<SidecarAgent> init()
23:52:04 VERB PuppetXp login()
23:52:04 VERB Puppet login(filehelper)
23:52:04 VERB Contact load(filehelper) init pool
23:52:04 VERB WeChatSidecar<Sidecar> getContact()
23:52:04 VERB StateSwitch <PuppetXp> on(true) <- (pending)
23:52:04 VERB Wechaty on(heartbeat, listener) registering... listenerCount: 0
23:52:04 VERB StateSwitch <Wechaty> on(true) <- (pending)
23:52:04 INFO StarterBot Starter Bot Started.
23:52:04 VERB SidecarBody<SidecarAgent> getContact()
23:52:04 INFO StarterBot Contact<文件传输助手> login
23:52:24 VERB SidecarBody<SidecarAgent> Interceptor.attach(recvMsgNativeCallback) onEnter()
23:52:24 VERB SidecarBody [HOOK_EVENT_HANDLER]("{"args":{"0":1,"1":"filehelper","2":"ding","3":null,"4":null},"method":"recvMsg"}")
23:52:24 VERB Message static load(ckshob6n800019wtxg4s83pob)
23:52:24 VERB Message constructor(ckshob6n800019wtxg4s83pob) for class WechatifiedMessage
23:52:24 VERB Message ready()
23:52:24 VERB Puppet messagePayload(ckshob6n800019wtxg4s83pob)
23:52:24 VERB PuppetXp messageRawPayload(ckshob6n800019wtxg4s83pob)
23:52:24 VERB Contact load(null) init pool
23:52:24 VERB WeChatSidecar<Sidecar> getContact()
23:52:24 VERB SidecarBody<SidecarAgent> getContact()
23:52:24 VERB Puppet selfId()
23:52:24 INFO StarterBot Message#Text[🗣Contact<null>]   ding
23:52:24 VERB Puppet selfId()
WechatifiedContact {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  id: 'null',
  payload: {},
  [Symbol(kCapture)]: false
}

23:52:24 VERB Message say(dong)
23:52:24 VERB Puppet selfId()
23:52:24 VERB Puppet selfId()
23:52:24 VERB Message mentionList()
23:52:24 VERB Puppet selfId()
23:52:24 VERB WeChatSidecar<Sidecar> sendMsg(null, dong)
23:52:24 VERB SidecarBody<SidecarAgent> sendMsg(null, dong)
23:53:34 VERB SidecarBody<SidecarAgent> Interceptor.attach(recvMsgNativeCallback) onEnter()
23:53:34 VERB SidecarBody [HOOK_EVENT_HANDLER]("{"args":{"0":1,"1":"wxid_3kgoet7g5b3822","2":"ding","3":null,"4":"<msgsource />\n"},"method":"recvMsg"}")
23:53:34 VERB Message static load(ckshoco4s00029wtx989g04fx)
23:53:34 VERB Message constructor(ckshoco4s00029wtx989g04fx) for class WechatifiedMessage
23:53:34 VERB Message ready()
23:53:34 VERB Puppet messagePayload(ckshoco4s00029wtx989g04fx)
23:53:34 VERB PuppetXp messageRawPayload(ckshoco4s00029wtx989g04fx)
23:53:34 VERB WeChatSidecar<Sidecar> getContact()
23:53:34 VERB SidecarBody<SidecarAgent> getContact()
23:53:34 VERB Puppet selfId()
23:53:34 INFO StarterBot Message#Text[🗣Contact<null>]   ding
23:53:34 VERB Puppet selfId()
WechatifiedContact {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  id: 'null',
  payload: {},
  [Symbol(kCapture)]: false
}
lprintf commented 3 years ago

Does my operating system (win10) meet the requirements?

huan commented 3 years ago

I believe your operating system (win10) is good.

About the filehelper, see:

https://github.com/wechaty/wechaty-puppet-xp/blob/226eb9405cf940e6c36afff6962594403af4b28f/src/puppet-xp.ts#L199-L200

This puppet is under heavy developing, so please feel free to join and improve it by submitting PRs.

atorber commented 2 years ago

@lprintf you can run npm install wechaty-puppet-xp@next try the latest version,it has fixed.