Thread: Fixing a pi exploit/crash

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Fixing a pi exploit/crash 
    Banned
    Join Date
    Oct 2009
    Age
    27
    Posts
    320
    Thanks given
    43
    Thanks received
    45
    Rep Power
    0
    Some servers may have this some may not

    Basically you open trade/duel get any noted item offer it and then remove x
    and do 2147m and it will crash the whole server.

    fixed code.
    Code:
    public boolean fromTrade(int itemID, int fromSlot, int amount) {
    		Client o = (Client) PlayerHandler.players[c.tradeWith];
    		if (o == null) {
    			return false;
    		}
    		try {
    			if (!c.inTrade || !c.canOffer) {
    				declineTrade();
    				return false;
    			}
                            if (amount < 0) {
    			         return false;
    		        }
    			c.tradeConfirmed = false;
    			o.tradeConfirmed = false;
    			if (!Item.itemStackable[itemID]) {
    				if (amount > 28) {
    					amount = 28;
    				}
    				for (int a = 0; a < amount; a++) {
    					for (GameItem item : offeredItems) {
    						if (item.id == itemID) {
    							if (!item.stackable) {
    								offeredItems.remove(item);
    								c.getItems().addItem(itemID, 1);
    							} else if (item.amount > amount) {
    								item.amount -= amount;
    								c.getItems().addItem(itemID, amount);
    							} else {
    								amount = item.amount;
    								offeredItems.remove(item);
    								c.getItems().addItem(itemID, amount);
    							}
    							break;
    						}
    					}
    				}
    			}
    			for (GameItem item : offeredItems) {
    				if (item.id == itemID) {
    					if (!item.stackable) {
    					} else if (item.amount > amount) {
    						item.amount -= amount;
    						c.getItems().addItem(itemID, amount);
    					} else {
    						amount = item.amount;
    						offeredItems.remove(item);
    						c.getItems().addItem(itemID, amount);
    
    					}
    					break;
    				}
    			}
    			c.tradeConfirmed = false;
    			o.tradeConfirmed = false;
    			c.getItems().resetItems(3322);
    			resetTempItems(3415);
    			o.getTradeAndDuel().resetOTItems(3416);
    			displayWAndI(c);
    			c.getPA().sendFrame126("", 3431);
    			o.getPA().sendFrame126("", 3431);
    		} catch (Exception e) {
    
    		}
    		return true;
    	}
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,135
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    Nice
    Reply With Quote  
     

  4. #3  
    Registered Member Killer 99's Avatar
    Join Date
    Dec 2007
    Posts
    1,484
    Thanks given
    171
    Thanks received
    503
    Rep Power
    414
    Why doesn't your code check for negative amounts
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Banned
    Join Date
    Oct 2009
    Age
    27
    Posts
    320
    Thanks given
    43
    Thanks received
    45
    Rep Power
    0
    never thought about that.

    thanks
    Reply With Quote  
     

  7. #5  
    Banned
    Join Date
    Oct 2009
    Age
    27
    Posts
    320
    Thanks given
    43
    Thanks received
    45
    Rep Power
    0
    Updated plus u will have to do the same for duel
    Reply With Quote  
     

  8. #6  
    Registered Member
    gomomo11's Avatar
    Join Date
    May 2010
    Posts
    2,383
    Thanks given
    268
    Thanks received
    196
    Rep Power
    177
    Im pretty sure recent released base already have this, correct me if im wrong.

    no external links without affiliate
    Reply With Quote  
     

  9. #7  
    Banned
    Join Date
    Dec 2011
    Posts
    190
    Thanks given
    27
    Thanks received
    21
    Rep Power
    0
    Didnt had this but thanks for releasing anyways
    Reply With Quote  
     

  10. #8  
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    Every server has had this fixed since 2011, lol.
    [Only registered and activated users can see links. ]


    Reply With Quote  
     

  11. #9  
    Banned
    Join Date
    Oct 2009
    Age
    27
    Posts
    320
    Thanks given
    43
    Thanks received
    45
    Rep Power
    0
    Quote Originally Posted by phl0w View Post
    Every server has had this fixed since 2011, lol.
    Quote Originally Posted by gomomo11 View Post
    Im pretty sure recent released base already have this, correct me if im wrong.
    I just downloaded a pi and it didint have this.

    i already stated that some servers may have this fixed.
    Reply With Quote  
     

  12. #10  
    Why you reading this?

    LoveandPower's Avatar
    Join Date
    Sep 2010
    Posts
    2,156
    Thanks given
    897
    Thanks received
    282
    Rep Power
    365
    should highlight what was exactly changed to make this fix s as some people may not want to just blindly exchange codes.
    Spoiler for sig too large:


    Reply With Quote  
     

  13. Thankful users:


Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 16
    Last Post: 04-12-2011, 10:10 PM
  2. Fixing crash when no name is inserted at login
    By owner blade in forum Snippets
    Replies: 13
    Last Post: 06-12-2010, 06:10 PM
  3. Replies: 21
    Last Post: 08-04-2009, 01:56 PM
  4. Fixing Npc Health Client Crash
    By Sub in forum Snippets
    Replies: 3
    Last Post: 04-13-2009, 07:46 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •