From 08feea1578aff6ab0f6c8e4cfe680f4d75f63d47 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Mon, 26 Sep 2022 22:02:57 -0400 Subject: [PATCH] red alert red alert red alert --- .woodpecker.yml | 1 + src/api/common.ts | 12 ++---------- src/api/utils/index.ts | 5 +++-- src/api/utils/object.ts | 17 +++++++++++++++++ src/api/webpack.ts | 34 ++++++++++++++++++---------------- src/index.ts | 10 ++++------ 6 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 src/api/utils/object.ts diff --git a/.woodpecker.yml b/.woodpecker.yml index c640571..bc9900e 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -25,3 +25,4 @@ pipeline: secrets: [ access_token ] when: event: [ push ] + branch: master \ No newline at end of file diff --git a/src/api/common.ts b/src/api/common.ts index 5489db8..51ebb42 100644 --- a/src/api/common.ts +++ b/src/api/common.ts @@ -1,18 +1,10 @@ -import webpack from "./webpack"; import * as idb from "idb-keyval"; import * as nests from "nests"; import * as nestsReact from "nests/react"; -const { findByProps } = webpack; - -const React = findByProps("createElement"); - export default { - React, - ReactDOM: findByProps("hydrate"), idb, - nests, - lodash: findByProps("sample") + nests }; -export { idb, nests, nestsReact, React }; +export { idb, nests, nestsReact }; diff --git a/src/api/utils/index.ts b/src/api/utils/index.ts index 2f10218..7e3c76d 100644 --- a/src/api/utils/index.ts +++ b/src/api/utils/index.ts @@ -1,9 +1,10 @@ import logger from "./logger"; -import modals from "./modals"; +//import modals from "./modals"; +import object from "./object" import { leak } from "./memory"; export default { logger, - modals, + object, memory: { leak } }; diff --git a/src/api/utils/object.ts b/src/api/utils/object.ts new file mode 100644 index 0000000..f2794ce --- /dev/null +++ b/src/api/utils/object.ts @@ -0,0 +1,17 @@ +function getByChildProps(obj: UnknownObject, prop: string): UnknownObject { + let m: UnknownObject = {}; + Object.values(obj).forEach(e => { + switch (typeof e) { + case "object": + if (Object.keys(e).includes(prop) || Object.values(e).includes(prop)) { + m = e + return + } + } + }) + return m +} + +export default { + getByChildProps +} \ No newline at end of file diff --git a/src/api/webpack.ts b/src/api/webpack.ts index b314c3e..f135698 100644 --- a/src/api/webpack.ts +++ b/src/api/webpack.ts @@ -54,26 +54,28 @@ let webpack = { filter: filter, find: (filter: Filter) => webpack.filter(filter, webpack.modules, true), findAll: (filter: Filter) => webpack.filter(filter, webpack.modules), - findByProps: (...props: any[]) => { - return webpack.find((module) => { - return props.every((prop) => module[prop] !== undefined); - }); + findByStrings: (...props: string[]) => { + return webpack.find((module) => + props.every((prop) => { + try { + return Object.values(module).find((e: any) => e.toString().includes(prop)) + } catch { return false } + }) + ); }, - findByPropsAll: (...props: any[]) => { + findByStringsAll: (...props: string[]) => { return webpack.findAll((module) => - props.every((prop) => module[prop] !== undefined) + props.every((prop) => { + try { + return Object.values(module).find((e: any) => e.toString().includes(prop)) + } catch { return false } + }) ); }, - findByDisplayName: (prop: any) => { - return webpack.find((m) => m?.displayName === prop); - }, - findByDisplayNameAll: (prop: any) => { - return webpack.findAll((m) => m?.displayName === prop); - }, - findByStrings: (...props: string[]) => { - return webpack.find((module) => - props.every((prop) => module.toString().contains(prop)) - ); + findByChildProps: (...props: string[]) => { + return webpack.find((module) => + props.every((prop) => Object.values(module).find((e: any) => Object.values(e).find((f: any) => f && !!f[prop]))) + ) }, reloadModules: () => { //NOTE: i have no idea why this could even feasibly need to be used, but i'm adding it anyways diff --git a/src/index.ts b/src/index.ts index bd7e427..11a60ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import webpack from "./api/webpack"; import common from "./api/common"; import utils from "./api/utils/index"; import plugins from "./api/plugin"; -import settings from "./api/ui/settings/settings"; +//import settings from "./api/ui/settings/settings"; import css from "./api/css"; import patcher from "./api/patcher"; import findByRitual from "./api/ritual"; @@ -25,16 +25,14 @@ const demon: Record = { patcher, stolas: { monologue: () => { - const username = webpack - .findByProps("getCurrentUser") - .getCurrentUser().username; + const username = "Mitigation" return _.sample([ `${username}, you know that when I'm lonely, I become hungry. And when I become hungry, I want to choke on that red **** of yours... **** your ***** and lick all of your *****, before taking out your *****, and **** with more teeth until you're screaming ********** like a FUCKING baby--!`, `Ohhh, ${username}! I'm so excited! I cannot wait to feel your slimy c**k inside of my ****. To ***** the— ...**** use while you and I and **** and jelly sandwiches all night...!` ]); } }, - settings + //settings }; function summon(mod: string) { @@ -55,4 +53,4 @@ window.demon = { }; plugins.init(); -settings.init(); +//settings.init();