Hack Forums
[.NET] [Preview/Opinion Needed] Shebang's Byte Difference Engine (SBDE) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [Preview/Opinion Needed] Shebang's Byte Difference Engine (SBDE) (/showthread.php?tid=3969154)

Pages: Pages 1 2


[Preview/Opinion Needed] Shebang's Byte Difference Engine (SBDE) - shebang - Jan 2, 2014

I was really wondering if it would be worth finishing this project for people to use. I was given the idea when updating a game I play, and the file size was massive. I figured there had to be a better way.

I'm absolutely positive this has been done before, but I've never seen in included in a HackForums program. Most of them use updaters that require the user to update their entire application through Net Seal or an updater they've coded themselves. The instruction file this generates would make the updating extremely easy, and require less bandwith (especially for small updates).

Obviously this isn't beneficial when there are massive differences in files, as they will probably end up being similar in size, but small updates to large applications could benefit from a byte difference engine to patch what's needed in a few bytes. Here's a GIF example where I modified 4 bytes of MonsterSocial (realistically this would be more):

[img]http://i.minus.com/iIP4EASJabThD.gif[/img]

Is this something worth continuing? I'm not sure if I should even bother finishing the instruction interpreter, or making a library that could easily be implemented by the program creator.


* - Ace of Spades - Jan 2, 2014

(Jan 2, 2014 10:24 AM)shebang Wrote:  I was really wondering if it would be worth finishing this project for people to use. I was given the idea when updating a game I play, and the file size was massive. I figured there had to be a better way.

I'm absolutely positive this has been done before, but I've never seen in included in a HackForums program. Most of them use updaters that require the user to update their entire application through Net Seal or an updater they've coded themselves. The instruction file this generates would make the updating extremely easy, and require less bandwith (especially for small updates).

Obviously this isn't beneficial when there are massive differences in files, as they will probably end up being similar in size, but small updates to large applications could benefit from a byte difference engine to patch what's needed in a few bytes. Here's a GIF example where I modified 4 bytes of MonsterSocial (realistically this would be more):

[img]http://i.minus.com/iIP4EASJabThD.gif[/img]

Is this something worth continuing? I'm not sure if I should even bother finishing the instruction interpreter, or making a library that could easily be implemented by the program creator.

I vote finish it, this is very nice looking and it's not a Theme/Crypter/Rat/SMS Bomber. So keep going and post updates!


* - Golden Kappa - Jan 2, 2014

Yeah I agree with Frozen, you should definitely finish that, it looks very good.


* - shebang - Jan 2, 2014

Just ended up finding a little bit of a fun issue. Accidentally removed 8 bytes from the beginning of a file, not realizing it would offset everything else. Left me with a 240MB text file :P


* - frontenhack - Jan 2, 2014

Looks promising, keep it up.
My vote is for continuing :D


* - Temploit - Jan 2, 2014

Definitely continue! Actually looking forward to this, in contrary of most thing released here.


* - SubGenius - Jan 2, 2014

Well it's not something new,but it's awesome.
Client patchers for Metin2 using this method were being sold very expensive.

So yes. Continue coding this.


* - Ajumma - Jan 2, 2014

Your GIF died so I can't see it anymore, but I know what this is so I would say finish it ^_^
I would love a library or something where I could implement this into my own programs.


* - shebang - Jan 2, 2014

(Jan 2, 2014 12:18 PM)iStar Wrote:  Your GIF died so I can't see it anymore, but I know what this is so I would say finish it ^_^
I would love a library or something where I could implement this into my own programs.

Weird. The image is hosted on minus, so you shouldn't have an issue.


* - Sutton2k9 - Jan 2, 2014

This look very nice.
You should finish it


* - KingCobraXD - Jan 2, 2014

I took a quick look and it seems that you only change the bytes that are different. That's a good start but something you might want to think about is byte insertion/removal. For example, we have two files, one with a size of 100 bytes and another with a size of 101 bytes. The only difference between the two files is that there is a random byte inserted somewhere in the second file, thus making it one byte larger than the first file. Using the method you use right now will mean that every byte after the inserted byte will require a change. If you can detect removed/inserted bytes, you can definitely make it much more efficient.


* - Meerkat. - Jan 2, 2014

(Jan 2, 2014 04:09 PM)KingCobraXD Wrote:  I took a quick look and it seems that you only change the bytes that are different. That's a good start but something you might want to think about is byte insertion/removal. For example, we have two files, one with a size of 100 bytes and another with a size of 101 bytes. The only difference between the two files is that there is a random byte inserted somewhere in the second file, thus making it one byte larger than the first file. Using the method you use right now will mean that every byte after the inserted byte will require a change. If you can detect removed/inserted bytes, you can definitely make it much more efficient.

This!
Also, storing the bytes as a text file is maybe not that clever, especially not since you use more text than the actual bytes itself.
The idea is definitely nice and you should continue, but there's a lot of room for improvement.


* - Assault - Jan 2, 2014

Tip. Instead of writing a set of string as your instruction, work on serializing something else
Write a class that represent a change & an enum that represents the instruction that you need to modify.
So this way you can have something like this

Code
enum Instruction
{
  ChangeByte,
  AddByte,
  RemByte,
  etc
}

class Change
{
  public Instruction Instruction;
  public object Value;
}

This way you can store everything in a List<Change> rather then storing it all in a string.


* - shebang - Jan 2, 2014

(Jan 2, 2014 04:09 PM)KingCobraXD Wrote:  I took a quick look and it seems that you only change the bytes that are different. That's a good start but something you might want to think about is byte insertion/removal. For example, we have two files, one with a size of 100 bytes and another with a size of 101 bytes. The only difference between the two files is that there is a random byte inserted somewhere in the second file, thus making it one byte larger than the first file. Using the method you use right now will mean that every byte after the inserted byte will require a change. If you can detect removed/inserted bytes, you can definitely make it much more efficient.

So it should analyse the files entirely and look for patterns around the different bytes? I'm trying to think of how to do this..


* - KingCobraXD - Jan 2, 2014

(Jan 2, 2014 04:20 PM)shebang Wrote:  So it should analyse the files entirely and look for patterns around the different bytes? I'm trying to think of how to do this..

Yup. It's not gonna be easy. The first thing that comes to my mind is to find an algorithm that would get blocks of bytes that exists in both files.