Kasada's p.js partially deobfuscated, still has VM logic

Overview

Kasada's p.js Deobfuscated

The script was obfuscated by replacing most strings with a function to grab the string from an array and decode it.

Ex: _0x36f133(0x5ee,'m6n4')

0x5ee is the index and "m6n4" is a value used to decode the string from the array.

The array is not in the correct order at first and it is rearranged when the script is first executed.

Note: Identifiers were replaced with more eye friendly ones

;(function (juquana, jernae) {
    var gali = KPSDK_0x1a3a; // KPSDK_0x1a3a is the function that pulls from the array and decodes the string
    while (true) {
      try {
        var tuyetnhung = -parseInt(gali(1246, "ZrqT")) * parseInt(gali(1123, "SF8Y")) + parseInt(gali(866, "B&jL")) + parseInt(gali(488, "i&SL")) * parseInt(gali(749, "SF8Y")) + parseInt(gali(1404, "0mUP")) * parseInt(gali(1382, "VR1C")) + parseInt(gali(1566, "8%Ma")) * -parseInt(gali(937, "s$M0")) + parseInt(gali(1517, "KuSv")) * parseInt(gali(1258, "HY&U")) + -parseInt(gali(403, "s$M0")) * parseInt(gali(1201, "#jW1"));
        if (tuyetnhung === jernae) break; else juquana.push(juquana.shift());
      } catch (oshanna) {
        juquana.push(juquana.shift());
      }
    }
  }(KPSDK_0xf49f, 464424) // KPSDK_0xf49f is the array of encoded strings

The first element of the array gets sent to the back until the array is in the correct order or tuyetnhung == 464424.

After deobfuscating:

 ;(function (juquana, jernae) {
    while (true) {
      try {
        var tuyetnhung =
          -parseInt("2heZWMs") * parseInt("135654qTbABM") +
          parseInt("301063jmvAoT") +
          parseInt("11009YPscRF") * parseInt("81JRakrh") +
          parseInt("2Dxgobv") * parseInt("2215QuFPap") +
          parseInt("353049JvnAYK") * -parseInt("1tJFxcB") +
          parseInt("1201DTKmnY") * parseInt("547chHHWy") +
          -parseInt("18668hOnZuB") * parseInt("41zmWBxs");
        if (tuyetnhung === jernae) break;
        else juquana.push(juquana.shift());
      } catch (oshanna) {
        juquana.push(juquana.shift());
      }
    }
  })(KPSDK_0xf49f, 464424)

If you evaluate tuyetnhung yourself you will notice it equals 464424.

Now that the array is in the correct order all of the following calls to KPSDK_0x1a3a can be replaced with their string value like shown above.

The next step of deobfuscating this script is coming up with a strategy to make the VM logic starting at line 1508 more readable.

Currently I'm not proud of the code I wrote for the deobfuscator so that will not be open sourced yet.

To deobfuscate the script I used AST manipulation which you can learn more about here.

Humphreyyyy#0088

You might also like...

An inheritable and strong logic template front-end mvvm framework.

Intact 文档 Documents 简介 Intact作为一个可继承,并且拥有强逻辑模板的前端MVVM框架,有着如下特色: 充分利用组合与继承的思想,来最高限度地复用代码 同时支持数据驱动和组件实例化调用,来最便捷地实现功能 强逻辑模板,赋予模板更多功能和职责,来完成业务逻辑和表现逻辑分离 安装

Oct 21, 2022

Keep your Business Logic appart from your actions/loaders plumbing

Keep your Business Logic appart from your actions/loaders plumbing

Remix Domains Remix Domains helps you to keep your Business Logic appart from your actions/loaders plumbing. It does this by enforcing the parameters'

Jan 2, 2023

Play logic games and claim exclusive NFTs!

Play logic games and claim exclusive NFTs!

Bit Gaming Samruk Hackathon Winner 🏆 Play-to-earn DAO with exclusive NFT collection Idea We are bringing together curious minds and reward them with

Jun 21, 2022

Custom navigations for Solid written in Typescript. Implement custom page transition logic and ✨ animations ✨

solid-custom-navigation Get, Set, Go! Custom navigations for Solid, written in Typescript. Implement custom page transition logic and ✨ animations ✨ .

Nov 27, 2022

Starter for Next.js projects with a basic page transition logic.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Oct 27, 2022

Easy conditional if-else logic for your Cypress testsDo not use

Easy conditional if-else logic for your Cypress testsDo not use

cypress-if Easy conditional if-else logic for your Cypress tests Tested with cy.get, cy.contains, cy.find, .then, .within commands in Cypress v9 and v

Dec 14, 2022

Logic programming with JSON.

Cicada Whereabouts Logic programming with JSON. I asked the boy beneath the pines. He said, "The master’s gone alone Herb-picking, somewhere on the mo

Dec 22, 2022

A dashboard for managing orders and inventory for a wordpress e-commerce site which has woo commerce plugin installed

A dashboard for managing orders and inventory for a wordpress e-commerce site which has woo commerce plugin installed

WordPressWooCommerceDashboard - A dashboard for managing orders and inventory for a wordpress e-commerce site which has woo commerce plugin installed. This program provides shipping tracking for Delhivery.

Jan 3, 2022

🍞📅A JavaScript calendar that has everything you need.

🍞📅A JavaScript calendar that has everything you need.

A JavaScript schedule calendar that is full featured. Now your service just got the customizable calendar. 🚩 Table of Contents Collect statistics on

Jan 5, 2023
Owner
null
A quotaless, partially limitless, and fast Node.js Multiplayer Piano server implementation that efficiently makes use of the protocol and uWebSockets.js

speedymppserver A quotaless, partially limitless, and fast Node.js Multiplayer Piano server implementation that efficiently makes use of the protocol

Lapis 4 Oct 14, 2022
An api named Crypto Versus, a multiplayer versus hacking simulator. Project still in the making!

Crypto Versus A Multiplayer Versus Hacking Simulation Inspired by the Steam game Bitburner Table of content Possible ouputs for all endpoints routes /

null 3 Jan 29, 2022
Blobernize your pictures with this all-new tool! Still under development, but it works for now.

Still under development, but in a usable state image-blobernizer A very simple image-blobernizer made for the webbrowser using p5.js Live demo Require

Sen van der Heide 3 Mar 23, 2022
Vision is a complete project manager where you can colaborate with your team. Everything is still in development phase.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Nikko Abucejo 4 Jun 4, 2022
MerLoc is a live AWS Lambda function development and debugging tool. MerLoc allows you to run AWS Lambda functions on your local while they are still part of a flow in the AWS cloud remote.

MerLoc MerLoc is a live AWS Lambda function development and debugging tool. MerLoc allows you to run AWS Lambda functions on your local while they are

Thundra 165 Dec 21, 2022
🚀 A (still experimental) Lyra integration for Astro

Lyra's Astro Plugin This package is a (still experimental) Lyra integration for Astro. Usage Configuring the Astro integration // In `astro.config.mjs

Lyra 23 Dec 13, 2022
This blog is still under development! I present a project scope for science articles, it can now be used in production! But there are some details that need to be put up front.

Science-Blog ?? Attention! This blog is still under development! I present a project scope for science articles, it can now be used in production! But

Raissadev 2 Sep 19, 2022
Fitness Platform with authentication and more (still in development) 🏋️‍♂️🏋️

LB Fitness readme Fitness platform with authentication containing workout plans, diet and blogs. Explore the docs » View Demo Table of Contents About

Lucas Bendix Jolibois 10 Dec 19, 2022
Build redux logic, without getting nervous 😬

Redux Cool Build redux logic, without getting nervous ?? Description Redux Cool is an awesome tiny package that allows you to easily and intuitively w

Redux Cool 24 Nov 3, 2022