Jump to content
Sign in to follow this  
jakj

JAKJ's "Fair Trade" (discontinued)

Recommended Posts

I already have the code on my machine to do foolproof binary patching

How can I also do this? Is this code you made yourself or something readily available?

Share this post


Link to post
Share on other sites

	public static boolean Rotate ( InputStream Base , InputStream Fulcrum , OutputStream Result )

	{

		final int Complement = 0xFF ;

		final int Width = 8 ;



		try

		{

			int Carry = 1 ;



			while ( true )

			{

				int FulcrumByte = Fulcrum . read ( ) ;



				if ( FulcrumByte < 0 )

				{

					return ( true ) ;

				}



				int BaseByte = Base . read ( ) ;



				if ( BaseByte < 0 )

				{

					BaseByte = 0 ;

				}



				int ResultByte = BaseByte + ( Complement - FulcrumByte ) + Carry ;



				Result . write ( ResultByte & Complement ) ;



				Carry = ResultByte >> Width ;

			}

		}

		catch ( Exception Exception )

		{

			return ( false ) ;

		}

	}

To create the patch file, the first parameter/argument is the file that you want to patch (the original, that will be on their computer, that you do not distribute), the second is the new version of the file that you made, and the result is the patch file.

To do the patch, the first parameter/argument is the original file on their computer, the second is the patch that you distribute, and the result is the new file you made.

It works by simple math: It treats the entire file as one massive integer, and uses the "method of complements" (http://en.wikipedia.org/wiki/Method_of_complements) to subtract one from the other. In effect, if the original file is O, the changed file is N, and the patch file is P, then "O - N = P" and "O - P = N".

The reason all this is necessary, and you can't just use something simple like XOR or binary diff, is because both XOR and binary diff can leave very large sections of the original file plain to see if the changes you make are very small (like if you were to just change one function, or a single constant). XOR will leave all unchanged portions of the file plain to see in the patch (meaning you are distrubting them) and binary diff includes both the changed and unchanged portions of the code for comparative purposes.

This method, though, works flawlessly (so far as I have tested), because it includes information for only the changed parts, and the information is not decipherable without the original. Imagine the original file is "99864516548" and the new file is "98924516548". The patch file will be "00940000000", which as you can see, doesn't include any of the original number at all, and is useless unless you have the original number available.

(You should use something like a checksum, digest, or md5sum to verify the original file before patching.)

Share this post


Link to post
Share on other sites

I wonder what the most popular nonbroken hash function for file verification is now.

I'm not even going to mention or link to the mod and author I'm talking about here

You don't have to. This is almost all of them. With most of them contributing no more non-code assets than a greyish texture or recoloured icons, it's hard to understand why the single player modders are so toxic as a whole compared to the server modders.

Share this post


Link to post
Share on other sites
I wonder what the most popular nonbroken hash function for file verification is now.
Define "broken" in current context. For file hashing pretty much all of them work perfectly fine.

Share this post


Link to post
Share on other sites

it's hard to understand why the single player modders are so toxic as a whole

Their e-status is their substitute for self-respect and actual life purpose. Maintaining strict control over how and where and when something you make is used, is a placebic prosthetic to make people feel as if they have power and authority when in reality they are just another peon in middle-class society.

In other words, "Fuck you, because fuck me."

Share this post


Link to post
Share on other sites

Wait, if modders are breaking the TOS several times, then do they even have legal copyright in their derivative works? If they don't, then why should you care if one gets mad that you modded their mod? If it's legal and they're being a toxic stain on the Minecraft modding community, then I'd just ignore them and tell them to get bent.

In fact, I think this problem in the modding community is exactly why you and others should continue to make mods the right way, without the overly restrictive rules that only serve to hurt the community. The bad apples will still exist, but if there's a strong push toward bettering the community, others will follow, and we can have more good things like Technic and Yogbox.

On a related note, I had a dream last night that Mojang changed their TOS to require modders to allow distribution of their mods as part of mod packs. It was great until I woke up.

Share this post


Link to post
Share on other sites

Mojang doesn't want the shitfest that enforcing the tos...even a modified tos supporting modding...would entail. It would consume a year profit in legal fees.

Modders have copyright on anything independent of Minecraft's code, like gui elements not adapted from base gui (which means doesn't use the builtin slot functionality either) or an abstract or generic algorithm that does not rely on minecraft data structure or class hierarchy to function. So really, very little of any mod.

Here's a fun little game for the skeptical: Name a mod, and ai will detail its parts and why each is ether copyrightable or not by the modder.

Share this post


Link to post
Share on other sites

Jakj don't give up because some users are calling Heresy! on you. They're a bunch of bigots and you know it. I was modding games when a lot of these Minecraft players were in diapers. Back in the days of Viper Racing, we didn't have ad.fly, overly restrictive ToS on car mods, and political bull to deal with. It was a community, and all the modders knew eachother to an extent, and respected one another. While some modders released stuff that wasn't ready, and they had to pull their stuff, or did poor enough a job that the original author of stuff would have them pull it, we complied, and sometimes, got one better out of the deal (I once made a realistic conversion of someone's awesome Porsche 917K LM after another modder did a very generic conversion using the tried and true "put the specs of the Viper GTSR 768 HP car on it and call it a day" method, which the OA didn't like at all, thus saving our tiny community from the wrath of 3D modellers). We didn't have drama lamas like Minecraft has seen, and we certainly didn't have game modders forcing players to download through ad.fly links that cock up everyone using Windows or force them through rubbish surveys which potentially puts their personal ID at risk or starts flooding their inbox with more penis cream adverts.

Remeber, what would Commander Taggert say? "Never give up! Never surrender!"

Share this post


Link to post
Share on other sites

I haven't completely given up, really. I've just taken a rather long break from it, and I'm just not releasing anything I'm doing. (No, I'm not doing anything amazing, so don't think you're missing out. It's just tiny tweaks.)

I am considering doing something when 1.3 comes out, though. I am slowly working my way around the psychological cul-de-sac toward a heading of "I like what I like, and it doesn't matter if nobody else does; It's still cool to me", which is a much more pleasant road to drive.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...