jsc-decompile-mozjs-34 icon indicating copy to clipboard operation
jsc-decompile-mozjs-34 copied to clipboard

Undefined offset, Decompilation error

Open PutterPlace opened this issue 6 years ago • 14 comments

When attempting to decompile this file, I only receive a bunch of errors:

Notice: Undefined offset: 3277386 in C:\Tools\jsc-decompile-mozjs-34-master\src\Xdr\Atom.php on line 25  
Notice: Undefined offset: 3277385 in C:\Tools\jsc-decompile-mozjs-34-master\src\Xdr\Atom.php on line 25  
Notice: Undefined offset: 3277388 in C:\Tools\jsc-decompile-mozjs-34-master\src\Xdr\Atom.php on line 25  
...

I receive similar errors when attempting to decompile this file:

Notice: Undefined offset: 452315 in C:\Tools\jsc-decompile-mozjs-34-master\src\Xdr\Common.php on line 46  
Notice: Undefined offset: 452316 in C:\Tools\jsc-decompile-mozjs-34-master\src\Xdr\Common.php on line 46  
Notice: Undefined offset: 452317 in C:\Tools\jsc-decompile-mozjs-34-master\src\Xdr\Common.php on line 46  
...

I've double-checked to make sure these two files are in accordance to a previously-posted issue. These files share the magic number you mentioned that this tool can decompile: 2C C0 73 B9

Any help would be greatly appreciated.

PutterPlace avatar May 30 '18 22:05 PutterPlace

Right! We're all trying to decompile cash show...

Quantum64 avatar May 31 '18 01:05 Quantum64

Welcome to the club!

discoli-zz avatar May 31 '18 01:05 discoli-zz

Tell me about it. I can connect to their websocket, but I can't figure out, for the life of me, how to communicate with it properly. I need the JS! :-P

PutterPlace avatar May 31 '18 04:05 PutterPlace

I'm in exactly the same spot. Just looks like a stream of binary data in Wireshark, so there isn't much hope of blackboxing it.

Quantum64 avatar May 31 '18 08:05 Quantum64

The data is definitely hexadecimal, but I'm not sure of the formatting is all. You can read the strings inside the messages sent and received, but there's other data being sent and received along with it.

PutterPlace avatar May 31 '18 08:05 PutterPlace

I mean you can represent binary data as hexadecimal digits. One byte can be represented as two characters from 0 to f. There's no such thing as "hexadecimal data". Typically when people refer to binary data, they mean "non-ascii" data, or not plaintext.

Quantum64 avatar May 31 '18 08:05 Quantum64

I know that. It's definitely being transmitted as binary data. I just mean that it's not completely unreadable if switched to hex or ascii. Just enough so to not be able to replicate it without more info. :-P

PutterPlace avatar May 31 '18 08:05 PutterPlace

While we await @irelance's reply, I've done some research into this issue myself.

It appears that $parseIndex is extending past the number of bytes in the file, causing the undefined offsets in the $bytecodes array, which is just the file as a byte array. I'm still not sure what's causing this though.

Quantum64 avatar May 31 '18 08:05 Quantum64

I'll probably take a look into as well tomorrow. Much too tired atm. :-P

PutterPlace avatar May 31 '18 09:05 PutterPlace

Any progress on the issue ? I'm not able to decompile JSC files too..

WalkyRG avatar Jun 06 '18 13:06 WalkyRG

None thus far. Sorry.

PutterPlace avatar Jun 06 '18 21:06 PutterPlace

That means my script do not work on your bytecode:

  1. Maybe my script decompile has some bugs (I am trying to rewrite the generate code process in the free time)
  2. Maybe your bytecode compile by different engine or different version (see issue2)

irelance avatar Jun 07 '18 09:06 irelance

Have you had a chance to look into this @irelance?

Quantum64 avatar Jul 17 '18 16:07 Quantum64