Browse Source

Remove some false positives

pull/46/head
coomdev 2 years ago
parent
commit
8cf9ce6d71
  1. 24
      chrome/dist/main.js
  2. 2
      chrome/manifest.json
  3. 24
      dist/main.js
  4. 2
      main.meta.js
  5. 26
      main.user.js
  6. 27
      src/pngv3.ts

24
chrome/dist/main.js

@ -51,7 +51,7 @@
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 254];
define_BUILD_VERSION_default = [0, 255];
}
});
@ -16679,11 +16679,18 @@
}
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length);
const decoded = import_buffer3.Buffer.from(passed.toString(), "base64").toString().split(" ").map((e) => {
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(" ");
const k = await decodeCoom3Payload(import_buffer3.Buffer.from(decoded));
ret.push(...k.filter((e) => e).map((e) => e));
if (!passed.toString().match(/^[0-9a-zA-Z+/=]+$/g))
continue;
try {
const decoded = import_buffer3.Buffer.from(passed.toString(), "base64").toString().split(" ").map((e) => {
if (!(e[0] in rprefs))
throw "Uhh";
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(" ");
const k = await decodeCoom3Payload(import_buffer3.Buffer.from(decoded));
ret.push(...k.filter((e) => e).map((e) => e));
} finally {
}
}
break;
case "IDAT":
@ -16767,7 +16774,10 @@
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
if (passed.match(/^[0-9a-zA-Z+/=]+$/g)) {
if (import_buffer3.Buffer.from(passed, "base64").toString().split(" ").every((l) => l[0] in rprefs))
return true;
}
}
break;
case "IDAT":

2
chrome/manifest.json

@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "PngExtraEmbedder",
"description": "Discover embedded files on 4chan and archives!",
"version": "0.254",
"version": "0.255",
"icons": {
"64": "1449696017588.png"
},

24
dist/main.js

@ -51,7 +51,7 @@
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 254];
define_BUILD_VERSION_default = [0, 255];
}
});
@ -16510,11 +16510,18 @@
}
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length);
const decoded = import_buffer3.Buffer.from(passed.toString(), "base64").toString().split(" ").map((e) => {
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(" ");
const k = await decodeCoom3Payload(import_buffer3.Buffer.from(decoded));
ret.push(...k.filter((e) => e).map((e) => e));
if (!passed.toString().match(/^[0-9a-zA-Z+/=]+$/g))
continue;
try {
const decoded = import_buffer3.Buffer.from(passed.toString(), "base64").toString().split(" ").map((e) => {
if (!(e[0] in rprefs))
throw "Uhh";
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(" ");
const k = await decodeCoom3Payload(import_buffer3.Buffer.from(decoded));
ret.push(...k.filter((e) => e).map((e) => e));
} finally {
}
}
break;
case "IDAT":
@ -16598,7 +16605,10 @@
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
if (passed.match(/^[0-9a-zA-Z+/=]+$/g)) {
if (import_buffer3.Buffer.from(passed, "base64").toString().split(" ").every((l) => l[0] in rprefs))
return true;
}
}
break;
case "IDAT":

2
main.meta.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.254
// @version 0.255
// @description uhh
// @author You
// @match https://boards.4channel.org/*

26
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.254
// @version 0.255
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -87,7 +87,7 @@ const _DOMParser = DOMParser;
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 254];
define_BUILD_VERSION_default = [0, 255];
}
});
@ -16546,11 +16546,18 @@ const _DOMParser = DOMParser;
}
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length);
const decoded = import_buffer3.Buffer.from(passed.toString(), "base64").toString().split(" ").map((e) => {
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(" ");
const k = await decodeCoom3Payload(import_buffer3.Buffer.from(decoded));
ret.push(...k.filter((e) => e).map((e) => e));
if (!passed.toString().match(/^[0-9a-zA-Z+/=]+$/g))
continue;
try {
const decoded = import_buffer3.Buffer.from(passed.toString(), "base64").toString().split(" ").map((e) => {
if (!(e[0] in rprefs))
throw "Uhh";
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(" ");
const k = await decodeCoom3Payload(import_buffer3.Buffer.from(decoded));
ret.push(...k.filter((e) => e).map((e) => e));
} finally {
}
}
break;
case "IDAT":
@ -16634,7 +16641,10 @@ const _DOMParser = DOMParser;
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
if (passed.match(/^[0-9a-zA-Z+/=]+$/g)) {
if (import_buffer3.Buffer.from(passed, "base64").toString().split(" ").every((l) => l[0] in rprefs))
return true;
}
}
break;
case "IDAT":

27
src/pngv3.ts

@ -82,11 +82,23 @@ const extract = async (png: Buffer) => {
}
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length);
const decoded = Buffer.from(passed.toString(), 'base64').toString().split(' ').map(e => {
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(' ');
const k = await decodeCoom3Payload(Buffer.from(decoded));
ret.push(...k.filter(e => e).map(e => e as EmbeddedFile));
if (!passed.toString().match(/^[0-9a-zA-Z+/=]+$/g)) continue;
try {
const decoded = Buffer
.from(passed.toString(), 'base64')
.toString()
.split(' ')
.map(e => {
if (!(e[0] in rprefs))
throw "Uhh";
// should also check if the id has a len of 6-8 or ends in .pee
return `https://${rprefs[e[0]]}/${e.slice(1)}`;
}).join(' ');
const k = await decodeCoom3Payload(Buffer.from(decoded));
ret.push(...k.filter(e => e).map(e => e as EmbeddedFile));
} finally {
//
}
}
break;
case 'IDAT':
@ -179,7 +191,10 @@ const has_embed = async (png: Buffer) => {
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
if (passed.match(/^[0-9a-zA-Z+/=]+$/g)) {
if (Buffer.from(passed, "base64").toString().split(" ").every(l => l[0] in rprefs))
return true;
}
}
break;
case 'IDAT':

Loading…
Cancel
Save