Browse Source

Change signature magic

pull/46/head
coomdev 2 years ago
parent
commit
d82b6d8665
  1. 2
      main.meta.js
  2. 6
      main.user.js
  3. 5
      src/pngv3.ts
  4. 2
      src/utils.ts

2
main.meta.js

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

6
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.125
// @version 0.126
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -11392,7 +11392,7 @@
return new Blob([ret]);
};
var decodeCoom3Payload = async (buff) => {
const pees = buff.toString().split("\0").slice(0, 5).filter((e) => e.startsWith("http"));
const pees = buff.toString().split(" ").slice(0, 5).filter((e) => e.startsWith("http"));
return Promise.all(pees.map(async (pee) => {
const headers = headerStringToObject(await GM_head(pee));
const res = await GM_fetch(pee, {
@ -11448,7 +11448,7 @@
};
// src/pngv3.ts
var CUM3 = import_buffer3.Buffer.from("CUM\x003");
var CUM3 = import_buffer3.Buffer.from("doo\0m");
var BufferReadStream2 = (b) => {
const ret = new ReadableStream({
pull(cont) {

5
src/pngv3.ts

@ -4,7 +4,7 @@ import { PNGDecoder, PNGEncoder } from "./png";
import { buildPeeFile, decodeCoom3Payload, fireNotification } from "./utils";
import { GM_fetch } from "./requests";
const CUM3 = Buffer.from("CUM\0" + "3");
const CUM3 = Buffer.from("doo\0" + "m");
const BufferReadStream = (b: Buffer) => {
const ret = new ReadableStream<Buffer>({
@ -99,7 +99,8 @@ const inject = async (container: File, injs: File[]) => {
if (magic && name != "IDAT")
break;
if (!magic && name == "IDAT") {
await encoder.insertchunk(["tEXt", buildChunk("tEXt", Buffer.concat([CUM3, injb])), 0, 0]);
await encoder.insertchunk(["tEXt", buildChunk("tEXt",
Buffer.concat([CUM3, injb])), 0, 0]);
magic = true;
}
await encoder.insertchunk([name, chunk, crc, offset]);

2
src/utils.ts

@ -74,7 +74,7 @@ rest: [X bytes of thumbnail data])[file bytes]
&4 => has thumbnail
*/
export const decodeCoom3Payload = async (buff: Buffer) => {
const pees = buff.toString().split('\0').slice(0, 5).filter(e => e.startsWith("http"));
const pees = buff.toString().split(' ').slice(0, 5).filter(e => e.startsWith("http"));
return Promise.all(pees.map(async pee => {
const headers = headerStringToObject(await GM_head(pee));
const res = await GM_fetch(pee, {

Loading…
Cancel
Save