irelance / jsc-decompile-mozjs-34

A javascript bytecode decoder for mozilla spider-monkey version 34. May decompile jsc file compile by cocos-2dx
164 stars 78 forks source link

how to decompile this jsc file? #2

Closed 215090240 closed 6 years ago

215090240 commented 6 years ago

jsc.txt how to decompile this jsc file?

irelance commented 6 years ago

I am not sure if this script was compile by spider-monkey. If it does, it may compile by a higher version. This project would decompile script for magic number like this: 2C C0 73 B9 But your script is: 42 C0 73 B9

irelance commented 6 years ago

I have download the source of 45 version, and found this in js/src/vm/Xdr.h: static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 330; static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - XDR_BYTECODE_VERSION_SUBTRAHEND);

and 0xb973c0de-330==0xb973c042

that means your script may compile by spider-monkey-45

yeyiqun commented 5 years ago

jsc.txt how to decompile this jsc file?

https://github.com/yeyiqun/cocos2d-jsc-decompiler This will help u.