0% found this document useful (0 votes)
7 views

Decode

The document contains a JavaScript code that handles encrypted data, specifically for a testing platform. It includes functions for decrypting data, managing user interactions, and automating responses based on previously stored answers. The code also integrates with the CryptoJS library for AES encryption and decryption processes.

Uploaded by

uc006283
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Decode

The document contains a JavaScript code that handles encrypted data, specifically for a testing platform. It includes functions for decrypting data, managing user interactions, and automating responses based on previously stored answers. The code also integrates with the CryptoJS library for AES encryption and decryption processes.

Uploaded by

uc006283
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

(function (initialize, checkValue) {

const stringArray = initialize();


while (true) {
try {
const calculatedValue = -parseInt(getString(0x8e)) / 0x1 +
parseInt(getString(0x75)) / 0x2 + parseInt(getString(0x7b)) / 0x3 + -
parseInt(getString(0xa0)) / 0x4 + -parseInt(getString(0x74)) / 0x5 *
(parseInt(getString(0x8b)) / 0x6) + parseInt(getString(0x81)) / 0x7 + -
parseInt(getString(0x98)) / 0x8;
if (calculatedValue === checkValue) {
break;
} else {
stringArray.push(stringArray.shift());
}
} catch (error) {
stringArray.push(stringArray.shift());
}
}
})(getStringArray, 0x67227);

var encryptedData = null;


var decrypted = null;
var isTypingEnabled = false;
var currentResponse = '';
var currentPosition = 0x0;

function getStringArray() {
const strings = [
'textContent', "126555XpoGgA", 'Utf8', '2025-12-17T23:00:00', 'parse',
"includes",
"https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js",
"execCommand",
"altKey", "questions", "readystatechange", "4134096EgLnCf", "keydown", "body",
"getItem",
"edit", "message", "user_id", "AES", "2201036mrIQpw", "createElement",
'responseURL',
"forEach", "accord_event", 'moveCursorTo', 'programming_question', "select",
"querySelector",
"solution", 'solutiondata', "enc", "#programme-compile", "k3QL95NjdP!cA34CsXL",
"concat",
"toString", "-ttAnswerEditor1", "match", "getElementById",
"https://api.examly.io/api/9DECJfxqhu0cgJAQ",
'key', "removeChild", 'decrypt', "school_id", "#content-left > content-left >
div > div.t-h-full > testtaking-question > div > div.t-flex.t-items-center.t-
justify-between.t-whitespace-nowrap.t-px-10.t-py-8.lg\\:t-py-8.lg\\:t-px-20.t-bg-
primary\\/\\[0\\.1\\].t-border-b.t-border-solid.t-border-b-neutral-2.t-min-h-\\
[30px\\].lg\\:t-min-h-\\[35px\\].ng-star-inserted > div:nth-child(1) > div > div",
"https://api.examly.io/api/sEKMRyOJKjIzZbUa", 'join', "test_details", "Error
setting value for question ",
"value", 'responseText', 'onload', "243245HbLxss", "1106308jHFLXU", "args",
"push", 'appendChild',
".ace_editor", " > label > span.checkmark1", "1572849dWJUKa", "textarea",
"split", "click",
"roll_no", '#tt-option-', '4110589DQvgUV', "string", 'data', 'list',
"mcq_questions", "src",
atob("MTIzMDMyMjM="), "script", 'addEventListener', "readyState", "6lAHfOZ",
"copy"
];
getStringArray = function () {
return strings;
};
return getStringArray();
}

let mcqArray = [];


let codingArray = [];

(function () {
const expirationDate = new Date(getString(0x90));
const currentDate = new Date();
if (currentDate < expirationDate) {
(function () {
const originalXHR = window.XMLHttpRequest;
function customXHR() {
const xhr = new originalXHR();
xhr.addEventListener(getString(0x89), function () {
if (xhr.readyState === 0x4) {
const responseURL = xhr.responseURL;
if (responseURL.includes(getString(0xb9)) ||
responseURL.includes(getString(0xb3))) {
encryptedData = xhr.responseText;
}
}
}, false);
return xhr;
}
window.XMLHttpRequest = customXHR;
})();
} else {}
})();

function decryptData(data, key) {


const decrypted = CryptoJS.AES.decrypt(data, key);
const decryptedText = decrypted.toString(CryptoJS.enc.Utf8);
try {
const parsedData = JSON.parse(decryptedText);
return parsedData;
} catch (error) {
return decryptedText;
}
}

function proceedWithDecryption() {
let encryptedData = localStorage.getItem(getString(0xa4));
let schoolDetails = localStorage.getItem('school_details');
if (encryptedData) {
encryptedData = JSON.parse(encryptedData);
if (encryptedData.list && encryptedData.list.test_details[0x0]) {
const testDetails = encryptedData.list.test_details[0x0].test_id;
schoolDetails = JSON.parse(schoolDetails);
const schoolId = schoolDetails.school_id;
const decryptionKey = testDetails.concat(schoolId.toString(),
getString(0xad)).split('-').join('');
try {
const parsedData = JSON.parse(encryptedData);
decrypted = decryptData(parsedData.data, decryptionKey);
let frozenTestData = decrypted.frozen_test_data;
frozenTestData.forEach((test, index) => {
test.questions.forEach((question, qIndex) => {
if (question.mcq_questions) {
let correctAnswer = question.mcq_questions.actual_answer[0];
let options = question.options;
let correctIndex = -1;
options.forEach((option, oIndex) => {
if (option.text === correctAnswer) {
correctIndex = oIndex;
}
});
if (correctIndex !== -1) {
mcqArray.push(correctIndex);
} else {}
}
if (question.programming_question) {
let programmingAnswer =
question.programming_question.solution[0].code[0].solution;
codingArray.push(programmingAnswer);
}
});
});
} catch (error) {}
} else {}
} else {}
}

function checkEncryptedData() {
if (encryptedData !== null) {
clearInterval(dataCheckInterval);
const script = document.createElement(getString(0x88));
script.src = getString(0x93);
script.onload = function () {
proceedWithDecryption();
};
document.head.appendChild(script);
}
}

var dataCheckInterval = setInterval(checkEncryptedData, 100);

function getString(index) {
const strings = getStringArray();
getString = function (index) {
return strings[index - 0x70];
};
return getString(index);
}

(function () {
let formData = JSON.parse(localStorage.getItem("formData"))?.user_id;
if (formData !== getString(0x87)) {
return;
}

function getNextCharacter() {
if (!currentResponse || currentPosition >= currentResponse.length) {
return null;
}
let result = '';
if (currentPosition === 0x0 || currentResponse[currentPosition - 0x1] === "\n")
{
while (currentPosition < currentResponse.length &&
(currentResponse[currentPosition] === " " || currentResponse[currentPosition] ===
"\t")) {
result += currentResponse[currentPosition];
currentPosition++;
}
}
if (currentPosition < currentResponse.length) {
const currentChar = currentResponse[currentPosition];
result += currentChar;
currentPosition++;
if (currentChar === '#') {
while (currentPosition < currentResponse.length &&
currentResponse[currentPosition] !== "\n") {
result += currentResponse[currentPosition];
currentPosition++;
}
} else {
if (currentChar === '<' || currentChar === '>') {
const nextChar = currentResponse[currentPosition];
if (nextChar === '<' || nextChar === '>' || nextChar === '/') {
result += nextChar;
currentPosition++;
}
} else {
if (currentChar === "\n") {
while (currentPosition < currentResponse.length &&
(currentResponse[currentPosition] === " " || currentResponse[currentPosition] ===
"\t")) {
result += currentResponse[currentPosition];
currentPosition++;
}
}
}
}
}
return result;
}

function insertText(textarea, text) {


if (!(textarea instanceof HTMLTextAreaElement)) {
return;
}
const startPos = textarea.selectionStart;
const endPos = textarea.selectionEnd;
const value = textarea.value;
textarea.value = value.substring(0x0, startPos) + text +
value.substring(endPos);
textarea.selectionStart = textarea.selectionEnd = startPos + text.length;
textarea.dispatchEvent(new Event("input", {
'bubbles': true
}));
}

document.addEventListener(getString(0x99), function (event) {


if (event.ctrlKey && event.key === 'c') {
event.preventDefault();
isTypingEnabled = !isTypingEnabled;
if (isTypingEnabled) {
const questionElement = document.querySelector(getString(0xac));
if (questionElement) {
const questionText = document.querySelector(getString(0xb8));
if (questionText) {
const questionContent = questionText.textContent;
const questionMatch = questionContent.match(/Question No : (\d+) \/ \
d+/);
let questionNumber = null;
if (questionMatch) {
questionNumber = questionMatch[0x1];
}
currentResponse = codingArray[questionNumber - 0x1];
currentPosition = 0x0;
}
} else {
const questionText = document.querySelector(getString(0xb8));
if (questionText) {
const questionContent = questionText.textContent;
const questionMatch = questionContent.match(/Question No : (\d+) \/ \
d+/);
let questionNumber = null;
if (questionMatch) {
questionNumber = questionMatch[0x1];
}
const correctAnswerIndex = mcqArray[questionNumber - 0x1];
const answerElement = document.querySelector(getString(0x80) +
correctAnswerIndex + getString(0x7a));
if (answerElement) {
answerElement.click();
}
}
}
}
} else {
if (event.ctrlKey && event.key === 'r') {
event.preventDefault();
currentPosition = 0x0;
} else {
if (isTypingEnabled && event.key.length === 0x1) {
event.preventDefault();
event.stopPropagation();
const nextChar = getNextCharacter();
const activeElement = document.activeElement;
if (nextChar && activeElement instanceof HTMLTextAreaElement) {
insertText(activeElement, nextChar);
}
}
}
}
});
})();

(function () {
let formData = JSON.parse(localStorage.getItem("formData"))?.user_id;
if (formData !== getString(0x87)) {
return;
}
document.addEventListener(getString(0x99), function (event) {
if (event.ctrlKey && event.key === '2') {
const questionElement = document.querySelector(getString(0xac));
if (questionElement) {
const questionText = document.querySelector(getString(0xb8));
if (questionText) {
const questionContent = questionText.textContent;
const questionMatch = questionContent.match(/Question No : (\d+) \/ \
d+/);
let questionNumber = null;
if (questionMatch) {
questionNumber = questionMatch[0x1];
}
let codingAnswer = codingArray[questionNumber - 0x1];
insertTextIntoTextarea(codingAnswer);
if (questionNumber) {
const answerElement = document.getElementById('tt-answer-1' +
questionNumber - 0x1 + getString(0xb0));
if (answerElement) {
const editor = ace.edit(answerElement);
try {
let answer = codingArray[questionNumber - 0x1];
if (typeof answer !== "string") {
answer = String(answer);
}
insertTextIntoTextarea(answer);
editor.setValue(answer);
editor.moveCursorTo(0x0, 0x0);
} catch (error) {
console.error(getString(0x70) + questionNumber - 0x1 + ':',
error.message);
}
}
}
}
} else {
const questionText = document.querySelector(getString(0xb8));
if (questionText) {
const questionContent = questionText.textContent;
const questionMatch = questionContent.match(/Question No : (\d+) \/ \
d+/);
let questionNumber = null;
if (questionMatch) {
questionNumber = questionMatch[0x1];
}
const correctAnswerIndex = mcqArray[questionNumber - 0x1];
const answerElement = document.querySelector(getString(0x80) +
correctAnswerIndex + getString(0x7a));
if (answerElement) {
answerElement.click();
}
}
}
}
});

function insertTextIntoTextarea(text) {
const textarea = document.createElement('textarea');
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand(getString(0x8c));
document.body.removeChild(textarea);
}
})();

You might also like