Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Article length mismatch encountered #121

Open
Sonic3R opened this issue Oct 5, 2023 · 8 comments
Open

Error: Article length mismatch encountered #121

Sonic3R opened this issue Oct 5, 2023 · 8 comments

Comments

@Sonic3R
Copy link

Sonic3R commented Oct 5, 2023

Hi,

I changed the article.js for better obfuscation as following:

filename = require('crypto').randomBytes(Math.floor(Math.random() * 11) + 25).toString('hex');
var yiPre = ' total='+this.parts+' line='+this.line_size+' size='+size+' name=', yiSuf = '\r\n=ypart begin=';
this.yInfo = (Buffer.allocUnsafe || Buffer)(Buffer.byteLength(yiPre + yiSuf, this.encoding) + MAX_NAME_LENGTH);
var p = this.yInfo.write(yiPre, 0, this.yInfo.length, this.encoding);
p += this.yInfo.write(filename, p, MAX_NAME_LENGTH, this.encoding);
p += this.yInfo.write(yiSuf, p, this.yInfo.length-p, this.encoding);
this.yInfo = bufferSlice.call(this.yInfo, 0, p);
this.maxPostSize = y.maxSize(articleSize, this.line_size)
		+ 75 /* size of fixed strings (incl final CRC) assuming ASCII or similar encoding */
		+ this.yInfo.length
		+ ((this.parts+'').length *2)
		+ ((size+'').length *3);

and

bufPos += this.buf.write(' total='+this.parent.parts+' line='+this.parent.line_size+' size='+this.parent.size+' name='+filename+'\r\n=ypart begin=', bufPos, this.parent.encoding);
this.bufs.push(
		toBuffer('=ybegin part='+this.part, this.parent.encoding),
		this.parent.yInfo,
		toBuffer(' total='+this.parent.parts+' line='+this.parent.line_size+' size='+this.parent.size+' name='+filename+'\r\n=ypart begin=', this.parent.encoding),
		toBuffer(( this.pos+1 )+' end='+(this.pos + data.length)+'\r\n', this.parent.encoding),
		y.encode(data, this.parent.line_size),
		toBuffer('\r\n=yend size='+data.length+' part='+this.part+this.crcFrag+'\r\n.\r\n', this.parent.encoding)

I randomly get error Error: Article length mismatch encountered and I can't figure out why. Can take a look maybe you have better insight than me.

@animetosho
Copy link
Owner

I can't exactly tell from the info supplied, but generally the size of articles are not allowed to change once they have been generated.
I'm guessing your attempt to randomise the filename length is causing the article size to vary, triggering the error.

@Last0n
Copy link

Last0n commented Oct 5, 2023

I am facing similar errors when using Nyuu-obfuscated fork.

is there a better way to implement this? I tried using --yenc-name parameter present in nyuu's original repo with rand(n) but it keeps the same yenc name for all articles from a particular file.

The reason behind going such lengths is that easynews search can deobfuscate if all the articles related to a file have same yenc name

@animetosho
Copy link
Owner

animetosho commented Oct 5, 2023

You should probably report the issue in that fork.

Modifications which alter an article's length (without appropriate changes) will not work correctly in Nyuu.
If the cause is the same as above, ensuring that the length of the filename is constant, may solve the issue.

@Last0n
Copy link

Last0n commented Oct 5, 2023

Thanks for the tip!

Would it be possible to have something like that implemented in main nyuu repo?

@Sonic3R
Copy link
Author

Sonic3R commented Oct 5, 2023

Here is diff https://diffy.org/diff/6563ea7790c28 between original nyuu repo and my repo

@animetosho
Copy link
Owner

Would it be possible to have something like that implemented in main nyuu repo?

If you're asking for something to allow the filename to vary between across articles, then highly unlikely.
It's not intentional behaviour, violates yEnc spec, and I have little interest in supporting every crazy idea someone comes up with.

@Last0n
Copy link

Last0n commented Oct 6, 2023

Would it be possible to have something like that implemented in main nyuu repo?

If you're asking for something to allow the filename to vary between across articles, then highly unlikely. It's not intentional behaviour, violates yEnc spec, and I have little interest in supporting every crazy idea someone comes up with.

Oh, That's alright. Thanks for the help, keeping the length of the filenames same has solved this issue.

Cheers

@Sonic3R
Copy link
Author

Sonic3R commented Oct 6, 2023

@Last0n can give me a point how to do that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants