wizguin/slippers

Help modifying chat___.swf for the 2007 version

Closed this issue · 3 comments

Kafva commented

Hi, I was able to get the 2005 version working but I'm having issues modifying the world setup for the 2007 version via the chat___.swf file as described in the wiki. I've used flasm to decompile the .swf file and there is at least one interesting function which I assume has control over where the client tries to connect:

    function2 makeServer (r:3='name', r:4='crumb', r:5='isSafe') ()
      push r:crumb
      setRegister r:2
      pop
      push '|', 1, r:2, 'split'
      callMethod
      setRegister r:2
      pop
      push 0.0, 'Object'
      new
      setRegister r:1
      pop
      push r:1, 'Name', r:name
      setMember
      push r:1, 'IP', 'mySetup'
      getVariable
      push 'Sockets'
      getMember
      push r:2, 0.0
      getMember
      getMember
      setMember
      push r:1, 'Port', 'mySetup'
      getVariable
      push 'Ports'
      getMember
      push r:2, 1
      getMember
      getMember
      setMember
      push r:1, 'IsSafeMode', r:isSafe
      setMember
      push r:1, 'IsOnline', TRUE
      setMember
      push r:1, 'Pop', 0.0
      setMember
      push r:1
      return
    end // of function makeServer

Sadly I don't have any experience with this type of code and don't know how to change this function (and recompile) so that it points the client to my servers IP and Port so any help with this would be greatly appreciated. If anyone knows about other ways of modifying the chat___.swf file to configure where the client connects I would of course also be interested.

full decompile of chat___.swf

Kafva commented

After some trial and error I was able to solve this by replacing all the IP addresses in the decompiled .flm file with the address of my server and changing the port for the Blizzard World to 843 (both inside chat506.swf and in config.json).

        <     push FALSE, 6114, 0.0, 'Blizzard', 100, 5, 'addServer'
        ---
        >     push FALSE, 843, 0.0, 'Blizzard', 100, 5, 'addServer'

I changed the server port to 843 since whenever I tried to logon this port on the server was receiving requests. To create the new version of chat506.swf I used flasm -d chat506.swf > chat506.flm, made the necessary edits to the .flm file and recompiled it with flasm -a chat506.flm.

For the future JPEXS decompiler is probably easier, lets you edit the swf file directly.

I'm not sure why the server was receiving requests on 843 though, you should only have to change the ip addresses.