PDA

View Full Version : Help! Bank Hack Overflow Hack


DalaiLamaBob
25 Sep 2002, 05:25
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,$presenttime)));
$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,$presenttime)));
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
25 Sep 2002, 06:41
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
25 Sep 2002, 11:07
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
25 Sep 2002, 22:45
Thanks! :)

DalaiLamaBob
26 Sep 2002, 07:42
I guess it just took a couple days to kick in. It works....