Bhx 3.1

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Bhx 3.1

#1 Post by carlos » 20 Dec 2012 23:07

This version was deprecated because bugs and the latest version is found here:
http://www.dostips.com/forum/viewtopic.php?f=3&t=6400
Last edited by carlos on 14 Apr 2015 07:28, edited 20 times in total.

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: [utility] Bhx 2.0

#2 Post by carlos » 09 Jan 2013 18:31

Posted version 2.0.
Last edited by carlos on 04 Jan 2014 22:18, edited 1 time in total.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: [utility] Bhx 2.0

#3 Post by abc0502 » 10 Jan 2013 06:43

Nice Tool, and thanks for the new features too.
BTW, It can convert a dll files too :o without any errors and the re-generated files is the same, i checked the md5 hash. i think now we can convert a complete application and re-generate it again using a batch file :)

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: [utility] Bhx 2.1

#4 Post by carlos » 04 Jan 2014 22:19

Hello. I posted the version 2.1. I hope you find it useful. :)

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: [utility] Bhx 2.1

#5 Post by Squashman » 05 Jan 2014 08:49

Still have not figured out what to use this utility for.

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: [utility] Bhx 2.1

#6 Post by carlos » 05 Jan 2014 13:59

Squashman wrote:Still have not figured out what to use this utility for.

With it you can rebuild a binary file that you need:
For example: the image in Wikipedia Sokoban article:
download it from:

Code: Select all

http://upload.wikimedia.org/wikipedia/en/4/4b/Sokoban_ani.gif

to folder c:\examples:

look the size of the file:

Code: Select all

C:\examples>dir
05-01-2014  16:34            21.547 Sokoban_ani.gif


reduce the file size from 21547 to 12210 bytes (making a cabinet file with extension like this .??_):

Code: Select all

C:\examples>makecab Sokoban_ani.gif
Cabinet Maker - Lossless Data Compression Tool
100.00% [flushing current folder]

C:\examples>dir
05-01-2014  16:34            21.547 Sokoban_ani.gif
05-01-2014  16:42            12.210 Sokoban_ani.gi_


make the rebuilder script:

Code: Select all

C:\examples>bhx Sokoban_ani.gi_
"mybin.cmd" generated.


delete the cabinet file:

Code: Select all

C:\examples>del Sokoban_ani.gi_


rename the original image for compare later:

Code: Select all

C:\examples>ren Sokoban_ani.gif Sokoban_ani.gif.bak


look the files in the folder:

Code: Select all

C:\examples>dir
05-01-2014  16:42            28.717 mybin.cmd
05-01-2014  16:34            21.547 Sokoban_ani.gif.bak


do the rebuild:

Code: Select all

C:\examples>mybin.cmd


look if the file was rebuilded:

Code: Select all

C:\examples>dir
05-01-2014  16:42            28.717 mybin.cmd
05-01-2014  16:34            21.547 Sokoban_ani.gif
05-01-2014  16:34            21.547 Sokoban_ani.gif.bak


do a binary comparision:

Code: Select all

C:\examples>fc /b Sokoban_ani.gif Sokoban_ani.gif.bak
Comparing files Sokoban_ani.gif and SOKOBAN_ANI.GIF.BAK
FC: no differences encountered

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: [utility] Bhx 2.1

#7 Post by Squashman » 05 Jan 2014 14:27

What I meant was I was trying to figure out a real world example to use the utility in my daily job. Guess I am not really understanding the purpose of the utility. Compressing a gif and umcompressing it really doesn't make much sense to me.

npocmaka_
Posts: 516
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: [utility] Bhx 2.1

#8 Post by npocmaka_ » 05 Jan 2014 15:02

you can create an executables with a .bat and put all your script logic (including the exe file or whatever you want) within a single file.Eventually you can also avoid a security constraints of an antivirus/security settings/...

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: [utility] Bhx 2.1

#9 Post by foxidrive » 05 Jan 2014 16:30

A benefit is that you can include a binary in your batch file, without needing the OP to download it.

You paste in the reconstruction code as a subroutine, and it recreates the executable, or whatever file you need.

npocmaka beat me...

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: [utility] Bhx 2.1

#10 Post by carlos » 05 Jan 2014 18:46

@npocmaka_, @foxidrive: thanks for the help with the explications.
Last edited by carlos on 06 Jan 2014 03:09, edited 2 times in total.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: [utility] Bhx 2.1

#11 Post by Squashman » 05 Jan 2014 19:08

foxidrive wrote:A benefit is that you can include a binary in your batch file, without needing the OP to download it.

You paste in the reconstruction code as a subroutine, and it recreates the executable, or whatever file you need.

npocmaka beat me...

Thought that was hex to bin utility was used for?
So you are saying if I wanted to distribute a batch file with Native SED code I could put it into the batch file without having to distribute SED with my batch file or tell the user they need to download SED to use it?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: [utility] Bhx 2.1

#12 Post by foxidrive » 05 Jan 2014 19:51

Squashman wrote:Thought that was hex to bin utility was used for?
So you are saying if I wanted to distribute a batch file with Native SED code I could put it into the batch file without having to distribute SED with my batch file or tell the user they need to download SED to use it?


Yes. You could use the batch script created by BHX to decode the sed.exe and then run it, and optionally to delete the sed.exe again.


Just clarifying here that the script in the first post creates the file BHX.EXE utility in the same way that SED.EXE would be recreated.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: [utility] Bhx 2.1

#13 Post by berserker » 05 Jan 2014 20:05

while its a novel idea, like creating an "installer" but i think not much difference if I just download sed.exe and use it.
any benefits at all?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: [utility] Bhx 2.1

#14 Post by Squashman » 05 Jan 2014 20:37

berserker wrote:while its a novel idea, like creating an "installer" but i think not much difference if I just download sed.exe and use it.
any benefits at all?

I do see the benefits now. Again in your "World" you are allowed to download and install anything you want and you have the benefit of knowing more about Unix based utilities. Most people don't. This does seem to have the benefit of not having to download extra utilities if that is truly the case.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: [utility] Bhx 2.1

#15 Post by berserker » 05 Jan 2014 20:41

Squashman wrote: This does seem to have the benefit of not having to download extra utilities if that is truly the case.

yes, it does have that benefit. but you have to create all those hex stuff from sed.exe first and "repackage" it. Doesn't sound different to me as its still "downloading" from somewhere. if a facility disallow downloading stuff then I don't especially think this kind "installer" would be allowed.

Post Reply