Joomla-SMF Registration Generator

Enter your Joomla URL (i.e. http://www.yoururl.com) :




Update:

Since I re-incarnated this generator the author of JSMF has gone about removing my posts off his site regarding the new location. I will now post my messages that I orignally posted in July 2007 on his site here.

While I am all for giving credit to copyright holders of GPL code and for a system to encourage donations, I feel that making someone donate to get rid of the "Joomla Bridge by Joomlahacks.com" copyright notice is not right. So I have created a tool for users to get the registration key to enter into their site if the wish. You can find it here: http://www.parkerhome.org/component/option,com_wrapper/Itemid,45/.


All you need to do is enter your URL for your Joomla site. Note this is not the URL to your SMF directory but to your root Joomla site. This has only been tested with the 2.0.2 version of the JSMF Bridge since this is the version that I run. If there is interest for testing of other versions please let me know and I will see if this works with them.
I have done this for 2 reasons:
1. To encourage the maintainers of this GPL'd code to remove the check for this which adds a ton of unnecessary overhead to the execution of this script. I will gladly provide patch files to them that removes the offending code.


2. Because normal non-hacker end users can not easily find the obscured code and find out how to remove it like I have. They should at least be able to remove the copyright notice on the output which is not required under the GPL of any version.


Since I have had a few people ask "where is it in the code" already.
Those of you who know how to read php well, below is the non-obscured functions and sections of code that rewrite the copyright and check for the existence and verification of the registration code. The code you receive and enter is stored in the jsmf_config database schema under the "code" option. After you save the entry in the install screen it adds it to the data base entry which is defaulted to "code=".


Feel free to find these on your own in their obscured form, I will give you a hint: convert hex data into ascii strings. For those who don't know how to read php take this an exercise on boning up on php. A hint for you the php online manual at www.php.net.


These examples remove all of the obscuring and I do not include the code used to make the code non-obscured to the program, but it is trivial and easy to find if you can find these lines anyway.


Code in 3 different places of smf.php is as follows:
1.

if (!defined('_SMF_')) {
/**#@+
* Constants
*/
/**
* _SMF_
*/
define ('_SMF_', "
Joomla Bridge by JoomlaHacks.com");
/**#@-*/
}




2.

$last = $jsmfConfig->code;



3.

if (defined(_SMF1_) || run($last)) {
if ($jsmfConfig->pathway) {
$jsmf->setPathway();
}
if ($jsmfConfig->pagetitles && $mosConfig_pagetitles) {
$jsmf->setTitle();
}
if ($jsmfConfig->css) {
$jsmf->setCSS();
}
if ($jsmfConfig->description) {
$jsmf->setDescription();
}
if ($jsmfConfig->def_keywords) {
$jsmf->setDefaultKeywords();
}
if ($jsmfConfig->keywords) {
$jsmf->setKeywords();
echo $buffer;
unset($buffer);
}



In the smf.class.php file there is this 1 section of code in the fixbuffer function and one additional function:
1.

$code = $jsmfConfig->code;

global $forum_copyright;
if(!(run($code)))
$buffer = str_replace($forum_copyright, _SMF1_($forum_copyright, _SMF_), $buffer);
str_replace($forum_copyright, _SMF1_($forum_copyright), $buffer);



2.

function _SMF1_($a, $b)
{
/**#@+
* Constants
*/
/**
* _SMF1_
*/
defined( '_SMF1_' ) or define('_SMF1_', 1);
/**#@-*/
return $a.$b;
}



And in the admin.smf.class.php there is this function:

function run($debug) {
$debug=substr($debug,1);
if(substr($debug,0,1))
$debug=strrev($debug);
$debug = substr($debug,0,1) . pack('H*', $debug);
global $mosConfig_live_site;
return strpos($debug,$mosConfig_live_site . md5(_JSMF_)) ? 1 : 0;
}



This above function in the admin.smf.class.php file is what does the code verification. I leave it up to you to decipher the trivial method used to encode the keys they send out. When you have you can create a php script that does the same thing that mine on my site does. NO I will not give out the source to my script but the information I have given above should be enough spoon feeding to get you to be able to make one yourself if you wish. A hint on this is don't forget the leading extra bit.


[EDIT1: Added missing line from smf.class.php]
[EDIT2: Oops forgot one function out of the smf.class.php]
[EDIT3: Fix type-o in run function]