Giter Site home page Giter Site logo

wfjsvmp's Introduction

jsvmp

遇到的一些问题:

问题1:从左到右赋值 已解决. 2022-12-27, 保留旧的(从右边开始运行)和新的(从左边开始运行). (vm_parser是旧的, new_vm_parser是新的.) 因为有些语句确实是需要从左边先运行的,解决了某些语法问题 (b = se.aa = {'a':1,'c':'aaa','dd':{'ccc':'123'}}).dd.m = b.dd.ccc;

遇到的一些坑:

if ((a = 1)) 目前在赋值语句后,会将堆栈索引+1, 然后不去判断会不会使用这个值, 可能存在bug. var target = arguments[0] || {};

(e = function a(){console.log(a);})(); 闭包里的a对象是匿名函数.之前匿名函数遍历的时候都直接无视他的名称.

var a = b = 1; 这里的b是没有作用域的,是突然出现的,就直接默认定义在window下.

var a = {a : 1} => var a = {'a': 1};

一些思路:

思路1: 复制 push,slice,vm_call 函数, 且改变函数代码命名, 插入不同的奇怪代码. 最后改变bind, 达到抹去toString效果.

思路2: 复制字节码里的运行内容,插入死代码等方式混淆视听. 然后生成多个字节码对应这个指令, 这样的话, 就不能单独插桩某个地方.

思路3: 复制几份计算代码,然后后续push堆栈的垃圾函数和正确函数都会传入不同值.

思路4: 怎么给普通函数加垃圾代码.

简单说明:

直接在new_vm_parser.js里选择要加密的js, 在代码最下面. 然后会在out文件夹里得到一个js文件, 即混淆后的解释器.

可能存在运行不了的问题, 因为有些特殊语句我没碰到...

重点可以看new_vm_parser.js里的generate函数, 遍历节点生成字节码, 对应new_vm_enter.js里的功能.

还有得把js里的es6语法转成es5在使用, 教程链接: https://blog.csdn.net/qq_46013295/article/details/128481895

解析的时候用了jsdom的window对象, 用来判断个别无作用域的对象是否是在window下的, 但是jsdom的window对象拥有的属性没有浏览器全.

赞助:

By: 挽风 q/v: 1491025307.

ps: 和陈不不大佬的cyjsvmp不一样...

我、陈不不大佬、泰迪大佬一起合作的星球 : https://t.zsxq.com/06bIUvBEM

wfjsvmp's People

Contributors

bnmgh1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.