24
2024
04
15:29:30

[Web逆向] 网页版抓猫代码分析



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

看到这个大佬的帖子https://www.52pojie.cn/thread-1391583-1-1.html 我就想起来网页版的抓猫, 搞一下
网页版抓猫地址 https://www.52pojie.cn/404.html
发现点击重置就是触发了这个reset

[JavaScript] 纯文本查看 复制代码
1
2
3
4
5
6
7
e.prototype.reset = function() {
    this.cat.reset(),
    this.resetBlocks(),
    this.randomWall(),
    this.state = i.PLAYING,
    this.setStatusText(f.default("点击小圆点,围住小猫"))
}



进一步看到随机创建墙体的代码

[JavaScript] 纯文本查看 复制代码
1
2
3
4
5
6
7
e.prototype.randomWall = function() {
    for (var t = 0; t < 8; t++) {
        var e = Math.floor(this.w * Math.random())
          , n = Math.floor(this.h * Math.random());
        e === this.cat.i && n === this.cat.j || (this.getBlock(e, n).isWall = !0)
    }
}




按F12打开控制台, 复制以下代码到控制台并执行

[JavaScript] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
game.mainScene.randomWall= function(){
    this.getBlock(4,5).isWall=!0;
    this.getBlock(5,4).isWall=!0;
    this.getBlock(6,4).isWall=!0;
    this.getBlock(2,5).isWall=!0;
    this.getBlock(5,2).isWall=!0;
    this.getBlock(6,6).isWall=!0;
    this.getBlock(6,5).isWall=!0;
    this.getBlock(2,4).isWall=!0;
}



然后点击"重置"按钮 然后就可以一步抓到了
ac1935e1b9154d6dc310d8c62a5d32fb_170850yesr1xooii81ow71.png



想一步也不点? 复制这个到控制台 执行后点重置

[JavaScript] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
game.mainScene.randomWall = function(){
    this.getBlock(4,5).isWall=!0;
    this.getBlock(5,4).isWall=!0;
    this.getBlock(6,4).isWall=!0;
    this.getBlock(2,5).isWall=!0;
    this.getBlock(5,2).isWall=!0;
    this.getBlock(6,6).isWall=!0;
    this.getBlock(6,5).isWall=!0;
    setTimeout(()=>{
       this.playerClick(5,6);
    },0)
};


b2e5f1da60d9d5aa61e78233fdf22d00_170748hwicycz6i6crznat.png


本文链接:https://hqyman.cn/post/5896.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: