Giter Club home page Giter Club logo

hijacker's Introduction

起源

以前玩单机游戏的时候,因为数值因素导致的卡关,使用【金山游侠/八门神器】魔改一波数值,就能轻松过关。现在网页H5游戏那么多,却没有这么一个好用的工具(虽然有更高级的方法),于是想着造个轮子,整个toy project,于是先新建个文件夹!

这是什么

在chrome扩展环境下,使用Babel基于AST将页面引用的script标签的内容进行篡改注入hook方法,通过hook方法对运行时中的数据进行查询或更改。

起初技术调研想到用的是esprima重新造轮子,后面发现Babel更流行,分别对esprima和Babel进行了解析时长对比,发现差异不大,另外Babel的工具链比较完善;同时找到[ast-hook-for-js-RE]这个项目,于是拿来主义,虽然Babel基于nodejs环境,但是一波StackOverflow后,成功在chrome环境跑起来了~

全局API

注入hook方法中,提供了一下全局API进行操作[纯控制台操作~~(写UI界面好麻烦呀)~~]

方法 说明
search(arg:string|number) 检索出现过某个值的所有堆栈信息
view(execOrder:number) 通过堆栈调用序号查看查看该堆栈信息详情
hijack(execOrder:number,newValue:string|number) 劫持堆栈调用中的值篡改为指定的值
cancelHijack(execOrder:number) 取消劫持
clearHijack() 清空所有劫持记录

怎么使用

扩展地址

hijacker

写在最后

本扩展属于toy project,仅仅是为了验证个人的一个想法并为之实现它,该项目并不能适配所有H5游戏哦~

感谢

License

MIT

hijacker's People

Contributors

krapnikkk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.