如何反编译 cocos creator 生成 的jsc文件/反编译jsc文件(二) , 反编译jsc的变量名

    jsc 是加密后的js代码, js是脚本代码, 不是编译型语言, 理论上也是可以反编译出来变量名的.

 

仔细研究了下js的编译引擎代码, 得出以下结论:

1. 变量名分为两种局部变量名和全局变量名.

2. 局部变量名作用域只在函数内部, 全局变量名作用域在全局范围内.

3. javascript是弱类型语言, 局部变量和全局变量分的不是太清楚, 其实都可以算为全局变量名, 递归作用域.

4. 所有的变量都放在函数上下文

var CuoPaiLayerNew;
CuoPaiLayerNew = cc.Layer.extend({
	sprite: null,
	ctor: function(cardIds) {
		this._super();
		var size = cc.winSize;
		this.posX = (cc.winSize.width / 2);
		this.posY = ((cc.winSize.height / 2) - 80);
		this.initCardInfo(cardIds);
		this.ratioVal = 0;
		this.CuoPaiLayer_State_Move = 0;
		this.CuoPaiLayer_State_Smooth = 1;
		var CuoPaiLayer_Pai = 3.141592;
		this.CuoPaiLayer_RotationFrame = 10;
		this.CuoPaiLayer_RotationAnger = (CuoPaiLayer_Pai / 3);
		this.CuoPaiLayer_SmoothFrame = 10;
		this.CuoPaiLayer_SmoothAnger = (CuoPaiLayer_Pai / 6);
		this.state = this.CuoPaiLayer_State_Move;
		this.__createSprites();
		this.__registTouchEvent();
		return true;
	},
	getPaiBmSStr: function() {
		var str = "";
		cc.error("newCuoPaiLayerNew");
		switch (DNRoomModel.pbYanse) {
		case - 1 : case 1:
			str = "res/ui/nmw/cuopaiZm/cardbm4.png";
			break;
		case 2:
			str = "res/ui/nmw/cuopaiZm/cardbm3.png";
			break;
		case 3:
			str = "res/ui/nmw/cuopaiZm/cardbm1.png";
			break;
		case 4:
			str = "res/ui/nmw/cuopaiZm/cardbm2.png";
			break;
		default:
		}

 

  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值