PDA

View Full Version : MD5 Version File Generator


Marco van Herwaarden
21 Feb 2006, 21:41
MD5 Version File Generator - Version 1.00

Hack: MD5 Version File generator
Version: v1.00
Author: MarcoH64
vB Version: 3.5.4 and higher (WILL NOT WORK ON LOWER VERSIONS!)

See for the "announcement" of this new function in vB3.5.4: http://www.vbulletin.com/forum/showpost.php?p=1079119&postcount=16

Description
This Modification is a tool for Hack Coders.

Since vB version 3.5.4 there is an improved File Version checker included as part of the diagnostics. All files in the forumhome directory will be checked if they are know and if the content is not changed.

To do this vBulletin uses a file called ./includes/md5_sums_PRODUCTID.php
This file contains all known files (for the hack the file is written for) and a MD5 hash of the files.

If you don't supply this file, admins will be warned for unknown files in their forumhome directory if you hack upload new files there. To create such a file by hand is not easy, but this hack can do it for you.

How to use:

AdminCP->Plugin System->Version File Manager
You will see a list of all Products installed on the board.
Click edit behind your Product and on the next screen, place all files that will be uploaded for your Hack in the text box. Each on their own line, with a absolut path as from the forumhome directory.
When you are ready to package and release your product, choose Generate MD5 File from the Dropdown menu.
There will now a new file be generated in your includes directory named md5_sums_PRODUCTID.php
Include this file in your Product zip-file (upload/includes directory).
Finished
You must have write access to your ./includes directory!
Not tested on systems with open_basedir restriction.

Example generated file:
<?php
// Checksum file
// Product: mh_md5gen - MD5 Version File generator
// Version: 1.00
// File generated by: $RCSfile: mh_md5gen.php,v $ - $Revision: 1.00 $
// Generator: MD5 Version File generator by MarcoH64 (c)
$md5_sums = array(
'/admincp' => array(
'mh_md5gen.php' => '0fef72130b665a6537d1b410c4337e1b',
),
'/includes/xml' => array(
'cpnav_mh_md5gen.xml' => 'eaca42281128a61f40cc820596b4af41',
),
);
?>


Copyright etc.
# Copyright 2006 MarcoH64
# This Modification may not be redistributed in whole or significant part or changed without prior written agreement of author.
Please don't forget to click Install at vbulletin.org.
If you like this work and would like to support the author, donations are always welcome at Paypal: marcoh64@gmail.com

Marco van Herwaarden
21 Feb 2006, 21:49
Product file uploaded

/me proud to be the first to release a (real!) vB 3.5.4 modification

Revan
21 Feb 2006, 21:57
/me clix install.
Cheers =D

Brad
21 Feb 2006, 21:57
/me installs :)

Smiry Kin's
21 Feb 2006, 22:01
3.5.4 out whats new? lol

Marco van Herwaarden
21 Feb 2006, 22:07
3.5.4 out whats new? lolThis new function was "announced" in the vB3.5.4 discussion thread at vb.com: http://www.vbulletin.com/forum/showpost.php?p=1079119&postcount=16

For other changes, see the official announcements at vb.com

Reeve of shinra
21 Feb 2006, 22:26
Nice work Marco!!

Marco van Herwaarden
21 Feb 2006, 22:34
HEhe just a quick job that i started when i saw that post at vb.com.

Couldn't imagine that anybody wanted to create these files manual. :)

Marco van Herwaarden
22 Feb 2006, 11:33
Could anyone provide feedback if all work correct on a Mac/Linux client?

Floris
22 Feb 2006, 12:14
Nice stuff Marco :D banana-thumbsup

Marco van Herwaarden
22 Feb 2006, 12:17
Thx Floris

msgotit
24 Mar 2006, 18:25
Probably a user error, but it wasn't working so I replace this line:

$filehash = @md5_file(DIR . $productfile['filename']);
With this:

$filehash = @md5(str_replace("\r\n", "\n", file_get_contents(DIR . $productfile['filename'])));

That seemed to solve my problem... Is there a reason? Or just user error.

IamLoBAS
28 Mar 2006, 15:15
Sorry, I don't have AdminCP->Plugin System->Version File Manager. So I can't click it.

Pls., Help me.

msgotit
29 Mar 2006, 02:57
Take the debug="1" out of the navoptions tab. I think that will do it.

IamLoBAS
29 Mar 2006, 08:41
Take the debug="1" out of the navoptions tab. I think that will do it.
Thanks msgotit. I already saw it. :banana: OK. I could made MD5 then How do I compare it?

msgotit
29 Mar 2006, 14:59
When you click on the diagnostic tool and suspect version, the files that you have done this too should no longer show up as suspect. If it isn't doing what it is supposed to it will say that they don't contain the expected contents.

IamLoBAS
30 Mar 2006, 08:29
When you click on the diagnostic tool and suspect version, the files that you have done this too should no longer show up as suspect. If it isn't doing what it is supposed to it will say that they don't contain the expected contents.

Thanks very much for your ans. msgotit :)

IamLoBAS
02 Apr 2006, 08:20
Probably a user error, but it wasn't working so I replace this line:

$filehash = @md5_file(DIR . $productfile['filename']);
With this:

$filehash = @md5(str_replace("\r\n", "\n", file_get_contents(DIR . $productfile['filename'])));

That seemed to solve my problem... Is there a reason? Or just user error.

Thanks very much for your mod. :banana:

Marco van Herwaarden
12 May 2006, 15:58
Probably a user error, but it wasn't working so I replace this line:

$filehash = @md5_file(DIR . $productfile['filename']);
With this:

$filehash = @md5(str_replace("\r\n", "\n", file_get_contents(DIR . $productfile['filename'])));

That seemed to solve my problem... Is there a reason? Or just user error.And that still gives you a valid MD5?

If you don't tell what was not working, i can't fix it.

msgotit
25 May 2006, 18:20
I'm an idiot. Sorry about that and sorry that I didn't respond sooner, when I would run the md5 generator on the files, then go back to the diagnostic tools it would say that the file did not contain the expected content. So what I did was go into the code in vbulletin and grab the function that they were using and it seemed to work, like I said it very likely could be user error but it didn't seem to create an md5 hash that matched what vbulletin would get. Sorry about the lack of explanation, I hate it when people do that ;)

Mark