PDA

View Full Version : MD5 Version File Generator


Marco van Herwaarden
02-20-2006, 10:00 PM
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
02-21-2006, 07:49 PM
Product file uploaded

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

Revan
02-21-2006, 07:57 PM
/me clix install.
Cheers =D

Brad
02-21-2006, 07:57 PM
* Brad installs :)

Smiry Kin's
02-21-2006, 08:01 PM
3.5.4 out whats new? lol

Marco van Herwaarden
02-21-2006, 08:07 PM
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
02-21-2006, 08:26 PM
Nice work Marco!!

Marco van Herwaarden
02-21-2006, 08:34 PM
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
02-22-2006, 09:33 AM
Could anyone provide feedback if all work correct on a Mac/Linux client?

Floris
02-22-2006, 10:14 AM
Nice stuff Marco :D banana-thumbsup

Marco van Herwaarden
02-22-2006, 10:17 AM
Thx Floris

msgotit
03-24-2006, 04:25 PM
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
03-28-2006, 01:15 PM
Sorry, I don't have AdminCP->Plugin System->Version File Manager. So I can't click it.

Pls., Help me.

msgotit
03-29-2006, 12:57 AM
Take the debug="1" out of the navoptions tab. I think that will do it.

IamLoBAS
03-29-2006, 06:41 AM
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
03-29-2006, 12:59 PM
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
03-30-2006, 06:29 AM
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
04-02-2006, 06:20 AM
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
05-12-2006, 01:58 PM
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
05-25-2006, 04:20 PM
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