[Release] Prevent not allowed GMs from hacking you.

Skilled Illusionist
Joined
Apr 16, 2009
Messages
376
Reaction score
72
I don't know if this works I just made it because I was bored.. If your not a idiot you could fix it yourself. (bluepiexd)
Make sure you change the table name in the function and SQL to prevent other people from knowing which table to hack.

Execute this in MySQL:

PHP:
--
-- Definition of table `allowedgms`
-- MAKE SURE YOU CHANGE THE TABLE NAME IN THE SQL AND THE FUNCTION TO PREVENT PEOPLE FROM KNOWING ABOUT THE TABLE
--

DROP TABLE IF EXISTS `allowedgms`;
CREATE TABLE `allowedgms` (
  `gmid` int(10) unsigned NOT NULL auto_increment,
  `gm` varchar(40) NOT NULL default '',
  PRIMARY KEY  (`gmid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `allowedgms`
--

/*!40000 ALTER TABLE `allowedgms` DISABLE KEYS */;
/*!40000 ALTER TABLE `allowedgms` ENABLE KEYS */;

Put this in MapleCharacter.java:

PHP:
        public boolean hasAllowedGM() { // Made by WlZET to prevent all GM exploits :D
        boolean ret = false;
        try {
            Connection con = DatabaseConnection.getConnection();
            PreparedStatement ps = con.prepareStatement("SELECT COUNT(*) FROM allowedgms WHERE ? LIKE CONCAT(gm, '%')");
            ps.setString(1, this.getName()); 
            ResultSet rs = ps.executeQuery();
            rs.next();
            if (rs.getInt(1) > 0) {
                ret = true;
            }
            rs.close();
            ps.close();
        } catch (SQLException ex) {
            log.error("Error checking for allowed GM", ex);
        }
        return ret;
    }

Add this in GM, Admins, and etc.java before this:

PHP:
splitted[0] = splitted[0].toLowerCase();

Add this:

PHP:
        MapleCharacter player = c.getPlayer();
        if (player.hasAllowedGM()) {

Before this:

PHP:
    @Override
    public CommandDefinition[] getDefinition() {

Add this:
PHP:
 }
 
Wizet you are funny..

delete from allowedgms;
insert into allowedgms(gm) values('jvlaple');

seriously, this is a waste of space and memory
 
Wizet you are funny..

delete from allowedgms;
insert into allowedgms(gm) values('jvlaple');

seriously, this is a waste of space and memory

what if you didn't know it was allowedgms?
What if it was 950259dy?
also you couldn't use !sql..
it's only for GM exploits not cype injecting or w/e you guys call it
 
Back