PDA

View Full Version : Help! Bank Hack Overflow Hack


DalaiLamaBob
09-25-2002, 03:25 AM
I am trying to help create a hack for www.aForums.com

I don't own the site so I can't post to the other forums here. I am just trying to help with the coding.

The point of the hack of the hack is to make it so people don't horde money in the bank. So my idea was to make it so that anything over 5000 is put back into their pocket. After looking at the code I figured the best place to add the change was after the interest was calculated so any interest would be overflowed too.

The problem is my changes don't seem to do anything. Nothing good or bad. At least nothing I have been able to see.

Original Code
//########################## functions ##################

function showbankmoney() {
global $DB_site,$bbuserinfo;

$savemoneytime= $DB_site->query_first("
SELECT savemt FROM user WHERE userid='$bbuserinfo[userid]'");
$banktime = $savemoneytime[savemt];
if ($banktime != 0){
$presenttime=(time()-$banktime)/86400;

if ($presenttime>1)
{
$presenttime=floor($presenttime);
$userbank = $DB_site->query_first("
SELECT bank FROM user WHERE userid='$bbuserinfo[userid]'");
$userbankmoney= $userbank[bank];
$userbankmoney=floor($userbankmoney*(pow(1.1,$pres enttime)));
$DB_site->query("UPDATE user SET
bank=$userbankmoney,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'");
}

}
}

Modified Code
//########################## functions ##################

function showbankmoney() {
global $DB_site,$bbuserinfo;

$savemoneytime= $DB_site->query_first("
SELECT savemt FROM user WHERE userid='$bbuserinfo[userid]'");
$banktime = $savemoneytime[savemt];
if ($banktime != 0){
$presenttime=(time()-$banktime)/86400;

if ($presenttime>1)
{
$presenttime=floor($presenttime);
$userbank = $DB_site->query_first("
SELECT bank,storep FROM user WHERE userid='$bbuserinfo[userid]'");
$userbankmoney= $userbank[bank];
$usermoney= $userbank[storep];
$userbankmoney=floor($userbankmoney*(pow(1.1,$pres enttime)));
if ($userbankmoney>5000)
{
$usermoney= $usermoney+$userbankmoney-5000;
$userbankmoney= 5000;
}
$DB_site->query("UPDATE user SET
storep=$usermoney,bank=$userbankmoney,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'");
}

}
}

Steve Machol
09-25-2002, 04:41 AM
DalaiLamaBob, please have the licensed owner of that forum go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are working on a licensed forum. Thank you.

Cold Steel
09-25-2002, 09:07 AM
Originally posted by Steve Machol
DalaiLamaBob, please have the licensed owner of that forum go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are working on a licensed forum. Thank you.

Done.

Steve Machol
09-25-2002, 08:45 PM
Thanks! :)

DalaiLamaBob
09-26-2002, 05:42 AM
I guess it just took a couple days to kick in. It works....