Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[REL] [v5-v39] Decompiled Lingo from Shockwave Habbo

Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
I've been improving my decompiler in several ways, now global properties are automatically added to the top. The decompiler now can distinguish between dictionary and list initializations, and it now reads 4 byte integers and floats, which the bytecode was unsupported before. And also more code that was omitted due to an error encountered is now dumped inside the script so there's less information lost, but still may encounter errors

For example pool_a Class.ls the array was completely hidden:

Code:
  repeat while me <= undefined

And now it's:

Code:
  repeat while ["pool_clickarea", "floor", "hiliter", "vesi1", "portaat0"] <= undefined

Which, while still code that cannot be compiled, you now know what the loop is with the correct information and it can be rewritten to successfully turn back into a .cct for the Habbo client.

For example:

Code:
  repeat while me <= undefined
    tid = getAt(undefined, undefined)
    tSpr = getThread(#room).getInterface().getRoomVisualizer().getSprById(tid)
    registerProcedure(tSpr, #poolTeleport, me.getID(), #mouseDown)
  end repeat

Turns into:

Code:
  tSprList = ["pool_clickarea", "floor", "hiliter", "vesi1", "portaat0"]
  i = 1
  repeat while i <= count(tSprList)
    tid = tSprList.getAt(i)
    tSpr = getThread(#room).getInterface().getRoomVisualizer().getSprById(tid)
    registerProcedure(tSpr, #poolTeleport, me.getID(), #mouseDown)
	i = i + 1
  end repeat

All of the improved decompiled source with the updates I've mentioned are now on GitHub:

Here's a few before/after for a few methods that have been fixed with the updates:

checkCS in Photo Component Class.ls/hh_photo.cct:

Before:

Code:
on countCS(me, tImg)
  tL = [3, 2, 73, 28, 83, 21, 43, 90, 92, 91, 37, 4, 3, 84, 12, 102, 103, 108, 97, 43, 44, 89, 109, 65, 61, -4, 76]
  tA = 0
  tW = tImg.width
  tH = tImg.height
  i = 1
  repeat while i <= 100
    tA = ERROR mod ERROR mod tA + tImg.getPixel(i mod tW, i * i mod tH).paletteIndex * tL.getAt(i mod tL.count + 1).undefined
    i = 1 + i
  end repeat
  return(tA)
  exit
end

After:

Code:
on countCS me, tImg 
  tL = [3, 2, 73, 28, 83, 21, 43, 90, 92, 91, 37, 4, 3, 84, 12, 102, 103, 108, 97, 43, 44, 89, 109, 65, 61, -4, 76]
  tA = 0
  tW = tImg.width
  tH = tImg.height
  i = 1
  repeat while i <= 100
    tA = tA + tImg.getPixel(i mod tW, i * i mod tH).paletteIndex * tL.getAt(i mod tL.count + 1) mod 85000
    i = 1 + i
  end repeat
  return(tA)
end

NotKeyDown from Jumping Pelle Class.ls/hh_room_pool.cct

Before:

Code:
on NotKeyDown(me)
  -- UNK_C8 331925
  -- UNK_6A 138
  exit
  -- UNK_AB 35330
  if ERROR > ERROR or ERROR then
    pStatus = #Run
    jumpAction = "run"
    pSpeed = 2
  end if
  if not voidp(pJumpData) then
    if pJumpData.getProp(#char, length(pJumpData)) = "a" then
      presskey = "d"
    else
      presskey = "a"
    end if
    me.MykeyDown(presskey, void(), 1)
  else
    pJumpData = pJumpData & "a"
  end if
  pJumpData = pJumpData & "0"
  pJumpMode = #inactive
  me.JumpingExitFrame()
  exit
end

After:

Code:
on NotKeyDown me 
  if the milliSeconds > pRemoveJumperTime + 45000 then
    if pMyLoc.locH > pjumpBoardEnd then
      pStatus = #Run
      jumpAction = "run"
      pSpeed = 2
    end if
    if not voidp(pJumpData) then
      if pJumpData.getProp(#char, length(pJumpData)) = "a" then
        presskey = "d"
      else
        presskey = "a"
      end if
      me.MykeyDown(presskey, void(), 1)
    else
      pJumpData = pJumpData & "a"
    end if
  else
    pJumpData = pJumpData & "0"
    pJumpMode = #inactive
    me.JumpingExitFrame()
  end if
end
 
Last edited:
Newbie Spellweaver
Joined
Mar 9, 2008
Messages
47
Reaction score
10
This is great! Got hh_interface decrypted and fixed up all the lingo errors and syntax issues, now we can edit the dialogue windows without breaking the purse & help button among other things.

Everything seems to work, here's the link if anyone wants it: (V14 I think)


Here's an example (not very pretty, am not an artist lol, just changed the shading a bit and made it gold)

Quackster - [REL] [v5-v39] Decompiled Lingo from Shockwave Habbo - RaGEZONE Forums



Quackster - [REL] [v5-v39] Decompiled Lingo from Shockwave Habbo - RaGEZONE Forums


Also, when I try to open the CST files uploaded to this thread, it says they are for a newer version? (I believe adobe director 11.5 or something worked, but couldn't get the client working after publishing the CCT files) Not really an issue though, just decrypted the supplied CCT files.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
This is great! Got hh_interface decrypted and fixed up all the lingo errors and syntax issues, now we can edit the dialogue windows without breaking the purse & help button among other things.

Everything seems to work, here's the link if anyone wants it: (V14 I think)


Here's an example (not very pretty, am not an artist lol, just changed the shading a bit and made it gold)

Quackster - [REL] [v5-v39] Decompiled Lingo from Shockwave Habbo - RaGEZONE Forums



Quackster - [REL] [v5-v39] Decompiled Lingo from Shockwave Habbo - RaGEZONE Forums


Also, when I try to open the CST files uploaded to this thread, it says they are for a newer version? (I believe adobe director 11.5 or something worked, but couldn't get the client working after publishing the CCT files) Not really an issue though, just decrypted the supplied CCT files.

The .cst files uploaded are just my unprotected ones with the bytecode still in them, they shouldn't be opened with Director because they're too recent to be created back into .cct files that the Habbo client will support.

It's best to just use recover-cct, unprotect them yourself and paste back in the scripts and fix them.

Also remember to use the Lingo from here:
 
Newbie Spellweaver
Joined
Mar 9, 2008
Messages
47
Reaction score
10
Yep I did, made it much easier. No more issues with comparing "me" with stuff. But still some undefined things, and also it doesn't seem to like if statements with "or", so was missing a load of them.

for example, it was like:

if something <> somethingelse then
if something <> somethingelse then
if something = somethingelse then

when it should have been like:

if something = somethingelse or something = somethingelse or something = somethingelse then
 
Newbie Spellweaver
Joined
Feb 17, 2007
Messages
75
Reaction score
129
Finally someone achieved this! Very interesting seeing some of the techniques Sulake used to use to block us debugging crypto / client functions....
Code:
[TABLE="class: highlight tab-size js-file-line-container"]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][COLOR=#D73A49]if[/COLOR] _player.traceScript [COLOR=#D73A49]then[/COLOR][/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]      [COLOR=#D73A49]return[/COLOR]([COLOR=#005CC5]0[/COLOR])[/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]    end [COLOR=#D73A49]if[/COLOR][/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]end [COLOR=#D73A49]if[/COLOR][/TD]
[/TR]
[/TABLE]
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Finally someone achieved this! Very interesting seeing some of the techniques Sulake used to use to block us debugging crypto / client functions....
Code:
[TABLE="class: highlight tab-size js-file-line-container"]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][COLOR=#D73A49]if[/COLOR] _player.traceScript [COLOR=#D73A49]then[/COLOR][/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]      [COLOR=#D73A49]return[/COLOR]([COLOR=#005CC5]0[/COLOR])[/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]    end [COLOR=#D73A49]if[/COLOR][/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]end [COLOR=#D73A49]if[/COLOR][/TD]
[/TR]
[/TABLE]

Yup! I knew you had something sort of working but I didn't hear anything more? Anyways, I'm glad I finally did it but the issue is that it's kind of late into Shockwave's lifespan, after all it's declared as end of life now - it doesn't mean it's totally useless though. :p:
 
Software Engineer
Loyal Member
Joined
Feb 19, 2008
Messages
1,055
Reaction score
492
Finally someone achieved this! Very interesting seeing some of the techniques Sulake used to use to block us debugging crypto / client functions....
Code:
[TABLE="class: highlight tab-size js-file-line-container"]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"][COLOR=#D73A49]if[/COLOR] _player.traceScript [COLOR=#D73A49]then[/COLOR][/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]      [COLOR=#D73A49]return[/COLOR]([COLOR=#005CC5]0[/COLOR])[/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]    end [COLOR=#D73A49]if[/COLOR][/TD]
[/TR]
[TR]
[TD="class: blob-num js-line-number, align: right"][/TD]
[TD="class: blob-code blob-code-inner js-file-line"]end [COLOR=#D73A49]if[/COLOR][/TD]
[/TR]
[/TABLE]

There may or may not be a Discord server from which vast knowledge of Shockwave bytecode and other Habbo ramblings occur.

Great release @Quackster, dont forget to give a shoutout to our loving friend ThuGie. ;)
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
The decompilation process has been improved slightly to fix order of operations decompilation.

Sums that do division/modulo/multiplication will now put brackets around such statements to indicate the correct way to interpret these statements.

Lets say you decompile "5 + (10 * 30)" it would decompile as:

5 + 10 * 30 which could give the result:

15 * 30 = 450

When it's actually 5 + (10 * 30) which is 5 + 300 which gives you 305 instead, this is why order of operations is important! :):

Commit:

XeMKqgy - [REL] [v5-v39] Decompiled Lingo from Shockwave Habbo - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Joined
Feb 7, 2010
Messages
1,850
Reaction score
1,004
The decompilation process has been improved slightly to fix order of operations decompilation.

Sums that do division/modulo/multiplication will now put brackets around such statements to indicate the correct way to interpret these statements.

Lets say you decompile "5 + (10 * 30)" it would decompile as:

5 + 10 * 30 which could give the result:

15 * 30 = 450

When it's actually 5 + (10 * 30) which is 5 + 300 which gives you 305 instead, this is why order of operations is important! :):

Commit:

You went a bit overkill on some of them, but hey ... :D

Code:
 tTemp = ((1 * pTempPercent + pLoadedSoFar) / pCastcount)
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
You went a bit overkill on some of them, but hey ... :D

Code:
 tTemp = ((1 * pTempPercent + pLoadedSoFar) / pCastcount)

Sigh, I need to update it again, in theory it should be instead:

Code:
 tTemp = ((1 * (pTempPercent + pLoadedSoFar)) / pCastcount)

And yes they are overkill, but that's one of the downsides of reinterpreting bytecode to ensure the sums are the same.

I have other bytecode fixes shortly, fixing more 'undefined' variables etc. :):
 
Joined
Feb 7, 2010
Messages
1,850
Reaction score
1,004
Sigh, I need to update it again, in theory it should be instead:

Code:
 tTemp = ((1 * (pTempPercent + pLoadedSoFar)) / pCastcount)

And yes they are overkill, but that's one of the downsides of reinterpreting bytecode to ensure the sums are the same.

I have other bytecode fixes shortly, fixing more 'undefined' variables etc. :):

Aue, you’re working hard!
Soon we’ll be able to customise everything ❤️❤️
 
Last edited:
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
I'm going to redo all of the source code for every Habbo version with as there's been improvements over my own decompiler.

Not to mention, of the improvements was a pull request recently by me as well!

Stay tuned.
 
Last edited:
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
I'm going to redo all of the source code for every Habbo version with as there's been improvements over my own decompiler.

Not to mention, of the improvements was a pull request recently by me as well!

Stay tuned.

Apologies for the double post, but every single Habbo version has now been updated with the new decompiler.

Link for those who aren't aware:

Enjoy!
 
Last edited:
Newbie Spellweaver
Joined
Jun 29, 2009
Messages
88
Reaction score
3
Hey Quackster, Director MX question, I decompiled the hh_registrat cct, I opened it in Director MX, I can see the scripts, but there is no movie, when I press play, shouldn't I be able to see the "register" interface on DirectorMX? (The crosses are the places im saying)

1692268044129 - [REL] [v5-v39] Decompiled Lingo from Shockwave Habbo - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Back
Top