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

2
chrome/manifest.json

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

24
dist/main.js

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

2
main.meta.js

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

26
main.user.js

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

27
src/pngv3.ts

@ -82,11 +82,23 @@ const extract = async (png: Buffer) => {
} }
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) { if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length); const passed = buff.slice(4 + CUM6.length);
const decoded = Buffer.from(passed.toString(), 'base64').toString().split(' ').map(e => { if (!passed.toString().match(/^[0-9a-zA-Z+/=]+$/g)) continue;
return `https://${rprefs[e[0]]}/${e.slice(1)}`; try {
}).join(' '); const decoded = Buffer
const k = await decodeCoom3Payload(Buffer.from(decoded)); .from(passed.toString(), 'base64')
ret.push(...k.filter(e => e).map(e => e as EmbeddedFile)); .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; break;
case 'IDAT': case 'IDAT':
@ -179,7 +191,10 @@ const has_embed = async (png: Buffer) => {
return true; return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) { if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString(); 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; break;
case 'IDAT': case 'IDAT':

Loading…
Cancel
Save