update log analyzer tool

This commit is contained in:
Belim
2025-05-21 17:46:25 +02:00
parent 75295d3fff
commit 6f5f61c5f7
3 changed files with 88 additions and 142 deletions
-52
View File
@@ -1,52 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Crapfixer Log Analyzer</title>
<style>
body { font-family: sans-serif; margin: 2rem; background: #f4f4f4; }
textarea { width: 100%; height: 200px; font-family: monospace; margin-bottom: 1rem; }
.result { background: white; border: 1px solid #ddd; padding: 1rem; }
.issue { color: #c62828; margin-bottom: 0.5rem; }
.key { font-family: monospace; color: #37474f; }
.plugin { color: #1565c0; margin-bottom: 0.3rem; }
</style>
</head>
<body>
<h1>🧠 Crapfixer Log Analyzer</h1>
<p>
To get started, please follow these simple steps:
<ol>
<li>Run the analysis in your Crapfixer app and <strong>export or copy the full log</strong> from the results window.</li>
<li>Come back here and <strong>paste the entire log</strong> into the textbox below.</li>
<li>Click the <strong>🔍 Analyze</strong> button to see a detailed breakdown of issues, registry keys, and plugin files.</li>
</ol>
</p>
<textarea id="logInput" placeholder="Paste your Crapfixer log here..."></textarea>
<button onclick="analyzeLog()">🔍 Analyze</button>
<div class="result" id="output"></div>
<script>
function analyzeLog() {
const log = document.getElementById('logInput').value;
const output = document.getElementById('output');
const lines = log.split('\n');
const issues = lines.filter(line => line.startsWith('❌'));
const regKeys = lines.filter(line => line.includes('HKEY_') || line.includes('➤'));
const plugins = lines.filter(line => line.match(/Plugin ready: .*\.ps1/i));
output.innerHTML = `
<h3>🧪 Found ${issues.length} Issues</h3>
<div>${issues.map(i => `<div class="issue">${i}</div>`).join('')}</div>
<hr>
<h3>🗂 Registry Keys</h3>
<div>${regKeys.map(k => `<div class="key">${k}</div>`).join('')}</div>
<hr>
<h3>📦 Loaded Plugins</h3>
<div>${plugins.map(p => `<div class="plugin">${p}</div>`).join('')}</div>
`;
}
</script>
</body>
</html>
+2 -90
View File
@@ -141,96 +141,8 @@
<div class="result" id="output"></div>
</main>
<!-- ---------- JAVASCRIPT SECTION ---------- -->
<script>
// read text from clipboard
async function pasteResult() {
try {
const text = await navigator.clipboard.readText();
if (!text) {
alert("Clipboard is emoty");
return;
}
document.getElementById("logInput").value = text;
analyzeLog(); // !analyze directly!
} catch (err) {
alert("No access to clipboard " + err);
}
}
// Analyze the pasted log and extract issues, registry keys, and plugin info
function analyzeLog() {
const log = document.getElementById("logInput").value;
const output = document.getElementById("output");
const lines = log.split("\n");
const issues = lines.filter((line) => line.startsWith("❌"));
const regKeys = lines.filter((line) => line.includes("HKEY_") || line.includes("➤"));
const plugins = lines.filter((line) => line.match(/Plugin ready: .*\.ps1/i));
output.innerHTML = `
<h3>🧪 Found ${issues.length} issues</h3>
<div>${issues.map((i) => `<div class="issue">${i}</div>`).join("")}</div>
<hr>
<h3>🗂 Registry Keys</h3>
<div>${regKeys.map((k) => `<div class="key">${k}</div>`).join("")}</div>
<hr>
<h3>📦 Loaded Plugins</h3>
<div>${plugins.map((p) => `<div class="plugin">${p}</div>`).join("")}</div>
`;
}
// Save screenshot of the output section
function captureResult() {
html2canvas(document.getElementById("output")).then((canvas) => {
const link = document.createElement("a");
link.download = "CrapFixer-results.png";
link.href = canvas.toDataURL();
link.click();
});
}
// Native share (for mobile browsers)
function shareResult() {
const text = document.getElementById("output").innerText;
if (navigator.share) {
navigator
.share({
title: "CrapFixer Analysis Results",
text: text,
})
.catch((err) => console.log("Share failed:", err));
} else {
alert("Sharing is not supported by your browser.");
}
}
// Share the result as an image on Twitter/X
function shareOnTwitter() {
const outputEl = document.getElementById("output");
if (!outputEl.innerText.trim()) return alert("No results to share yet.");
// Create screenshot from result div
html2canvas(outputEl).then((canvas) => {
const dataUrl = canvas.toDataURL("image/png");
// Convert image to base64 string (can't upload directly to Twitter)
// Instead, show preview and user uploads manually via prompt
const win = window.open();
win.document.write(`<h2>📷 Screenshot ready for X / Twitter</h2>`);
win.document.write(
`<p>Right-click the image below and save it to upload on Twitter manually.</p>`
);
win.document.write(
`<img src="${dataUrl}" style="max-width:100%;border:1px solid #ccc;" />`
);
win.document.write(
`<p><a href="https://twitter.com/intent/tweet?text=Check%20out%20my%20CrapFixer%20analysis!&hashtags=CrapFixer,loganalyzer" target="_blank">➡️ Click here to post on X</a></p>`
);
});
}
</script>
<!-- ---------- JS FUNCTIONS--------- -->
<script src="js/main.js"></script>
<!-- ---------- HTML2CANVAS LIBRARY FOR SCREENSHOTS ---------- -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
+86
View File
@@ -0,0 +1,86 @@
// read text from clipboard
async function pasteResult() {
try {
const text = await navigator.clipboard.readText();
if (!text) {
alert("Clipboard is empty");
return;
}
document.getElementById("logInput").value = text;
analyzeLog(); // direkt analysieren
} catch (err) {
alert("No access to clipboard " + err);
}
}
// Analyze the pasted log and extract issues, registry keys, and plugin info
function analyzeLog() {
const log = document.getElementById("logInput").value;
const output = document.getElementById("output");
const lines = log.split("\n");
const issues = lines.filter((line) => line.startsWith("❌"));
const regKeys = lines.filter((line) => line.includes("HKEY_") || line.includes("➤"));
const plugins = lines.filter((line) => line.match(/Plugin ready: .*\.ps1/i));
output.innerHTML = `
<h3>🧪 Found ${issues.length} issues</h3>
<div>${issues.map((i) => `<div class="issue">${i}</div>`).join("")}</div>
<hr>
<h3>🗂 Registry Keys</h3>
<div>${regKeys.map((k) => `<div class="key">${k}</div>`).join("")}</div>
<hr>
<h3>📦 Loaded Plugins</h3>
<div>${plugins.map((p) => `<div class="plugin">${p}</div>`).join("")}</div>
`;
}
// Save screenshot of the output section
function captureResult() {
html2canvas(document.getElementById("output")).then((canvas) => {
const link = document.createElement("a");
link.download = "CrapFixer-results.png";
link.href = canvas.toDataURL();
link.click();
});
}
// Native share (for mobile browsers)
function shareResult() {
const text = document.getElementById("output").innerText;
if (navigator.share) {
navigator
.share({
title: "CrapFixer Analysis Results",
text: text,
})
.catch((err) => console.log("Share failed:", err));
} else {
alert("Sharing is not supported by your browser.");
}
}
// Share the result as an image on Twitter/X
function shareOnTwitter() {
const outputEl = document.getElementById("output");
if (!outputEl.innerText.trim()) return alert("No results to share yet.");
// Create screenshot from result div
html2canvas(outputEl).then((canvas) => {
const dataUrl = canvas.toDataURL("image/png");
// Convert image to base64 string (can't upload directly to Twitter)
// Instead, show preview and user uploads manually via prompt
const win = window.open();
win.document.write(`<h2>📷 Screenshot ready for X / Twitter</h2>`);
win.document.write(
`<p>Right-click the image below and save it to upload on Twitter manually.</p>`
);
win.document.write(
`<img src="${dataUrl}" style="max-width:100%;border:1px solid #ccc;" />`
);
win.document.write(
`<p><a href="https://twitter.com/intent/tweet?text=Check%20out%20my%20CrapFixer%20analysis!&hashtags=CrapFixer,loganalyzer" target="_blank">➡️ Click here to post on X</a></p>`
);
});
}