xjoao xjoao  • 27.06.16 14:50

(NEW) Fix para plus emulador segurança e Outros (NEW) Empty (NEW) Fix para plus emulador segurança e Outros (NEW) 27.06.16 14:50

Reputação da mensagem: 100% (1 votos)
Olá venho postar aqui os fix de segurança e da source
Abaixo contém os fixes dos:
exploits
pisos
lajota
catálogo
banco de dados
delay do catálogo
e muito mais..


Fix de segurança :

1-
HabboHotel\Items\Wired\Boxes\Effects\BotChangesClothesBox.cs


Procure:

Código:
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `bots` SET `look` = '" + User.BotData.Look + "', `gender` = '" + User.BotData.Gender + "' WHERE `id` = '" + User.BotData.Id + "' LIMIT 1");
}

Substitua:


Código:
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) {
dbClient.SetQuery("UPDATE `bots` SET `look` = @look, `gender` = '" + User.BotData.Gender + "' WHERE `id` = '" + User.BotData.Id + "' LIMIT 1");
dbClient.AddParameter("look", User.BotData.Look);
dbClient.RunQuery();
}



2-
Communication\Packets\Incoming\Rooms\AI\Bots\SaveBotActionEvent.cs


Procure:

Código:
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `bots` SET `look` = '" + Session.GetHabbo().Look + "', `gender` = '" + Session.GetHabbo().Gender + "' WHERE `id` = '" + Bot.BotData.Id + "' LIMIT 1");
}



Substitua:

Código:
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `bots` SET `look` = @look, `gender` = '" + Session.GetHabbo().Gender + "' WHERE `id` = '" + Bot.BotData.Id + "' LIMIT 1");
dbClient.AddParameter("look", Session.GetHabbo().Look);
dbClient.RunQuery();
}



3-
HabboHotel/Moderation/ModerationManager.cs


Procure:
[ltr]dbClient.SetQuery("REPLACE INTO `bans` (`bantype`, `value`, `reason`, `expire`, `added_by`,`added_date`) VALUES ('" + BanType + "', '" + BanValue + "', @ReasoN, " + ExpireTimestamp + ", '" + Mod + "', '" + PlusEnvironment.GetUnixTimestamp() + "');");
dbClient.AddParameter("reason", Reason);
dbClient.RunQuery();[/ltr]


Substitua:

[ltr]dbClient.SetQuery("REPLACE INTO `bans` (`bantype`, `value`, `reason`, `expire`, `added_by`,`added_date`) VALUES ('" + BanType + "', @value, @ReasoN, " + ExpireTimestamp + ", '" + Mod + "', '" + PlusEnvironment.GetUnixTimestamp() + "');");
dbClient.AddParameter("reason", Reason);
dbClient.AddParameter("value", BanValue);
dbClient.RunQuery();[/ltr]


4-

HabboHotel/Rooms/Chat/Commands/User/Fun/FacelessCommand.cs



Procure:
[ltr]dbClient.RunQuery("UPDATE `users` SET `look` = '" + Session.GetHabbo().Look + "' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");[/ltr]


Substitua:
[ltr]dbClient.SetQuery( "UPDATE `users` SET `look` = @Look WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
dbClient.AddParameter("look", Session.GetHabbo().Look);
dbClient.RunQuery();[/ltr]



5-
Outros fixes:

1-
Communication\Packets\Incoming\Rooms\Furni\Wired\SaveWiredConfigEvent.cs


Procure:

Código:
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;

Substitua:


Código:
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;

if (!Room.CheckRights(Session, false) && !Room.CheckRights(Session, true))
return;

2-

Communication\Packets\Incoming\Catalog\CheckGnomeNameEvent.cs



Procure:

Código:
if (Item == null || Item.Data == null)
return;

Substitua:


Código:
if (Item == null || Item.Data == null || Item.UserID != Session.GetHabbo().Id || Item.Data.InteractionType != InteractionType.GNOME_BOX)
return;



3-
PurchaseFromCatalogEvent.cs



Procure:
[ltr]if (Amount < 1 || Amount > 100)[/ltr]



Substitua:
[ltr]if (Amount < 1 || Amount > 100 || !Item.HaveOffer)[/ltr]


5-
HabboHotel\Rooms\RoomItemHandling.cs



Procure:
[ltr]public bool SetFloorItem(GameClient Session, Item Item, int newX, int newY, int newRot, bool newItem, bool OnRoller, bool sendMessage, bool updateRoomUserStatuses = false)[/ltr]


Substitua:
[ltr]public bool SetFloorItem(GameClient Session, Item Item, int newX, int newY, int newRot, bool newItem, bool OnRoller, bool sendMessage, bool updateRoomUserStatuses = false)
{
// Questions -> Skype: keiz.er
bool NeedsReAdd = false;


if (newItem)
if (Item.IsWired)
if (Item.GetBaseItem().WiredType == WiredBoxType.EffectRegenerateMaps && _room.GetRoomItemHandler().GetFloor.Where(x => x.GetBaseItem().WiredType == WiredBoxType.EffectRegenerateMaps).Count() > 0)
return false;


List<Item> ItemsOnTile = GetFurniObjects(newX, newY);
if (Item.GetBaseItem().InteractionType == InteractionType.ROLLER && ItemsOnTile.Where(x => x.GetBaseItem().InteractionType == InteractionType.ROLLER && x.Id != Item.Id).Count() > 0)
return false;


if (!newItem)
NeedsReAdd = _room.GetGameMap().RemoveFromMap(Item);


Dictionary<int, ThreeDCoord> AffectedTiles = Gamemap.GetAffectedTiles(Item.GetBaseItem().Length, Item.GetBaseItem().Width, newX, newY, newRot);


if (!_room.GetGameMap().ValidTile(newX, newY) || _room.GetGameMap().SquareHasUsers(newX, newY) && !Item.GetBaseItem().IsSeat)
{
if (NeedsReAdd)
_room.GetGameMap().AddToMap(Item);
return false;
}


foreach (ThreeDCoord Tile in AffectedTiles.Values)
{
if (!_room.GetGameMap().ValidTile(Tile.X, Tile.Y) ||
(_room.GetGameMap().SquareHasUsers(Tile.X, Tile.Y) && !Item.GetBaseItem().IsSeat))
{
if (NeedsReAdd)
{
_room.GetGameMap().AddToMap(Item);
}
return false;
}
}

Double newZ = _room.GetGameMap().Model.SqFloorHeight[newX, newY];


if (!OnRoller)
{
if (_room.GetGameMap().Model.SqState[newX, newY] != SquareState.OPEN && !Item.GetBaseItem().IsSeat)
{
return false;
}


foreach (ThreeDCoord Tile in AffectedTiles.Values)
{
if (_room.GetGameMap().Model.SqState[Tile.X, Tile.Y] != SquareState.OPEN &&
!Item.GetBaseItem().IsSeat)
{
if (NeedsReAdd)
{
//AddItem(Item);
_room.GetGameMap().AddToMap(Item);
}
return false;
}
}

if (!Item.GetBaseItem().IsSeat && !Item.IsRoller)
{
foreach (ThreeDCoord Tile in AffectedTiles.Values)
{
if (_room.GetGameMap().GetRoomUsers(new Point(Tile.X, Tile.Y)).Count > 0)
{
if (NeedsReAdd)
_room.GetGameMap().AddToMap(Item);
return false;
}
}
}
}


// Find affected objects
var ItemsAffected = new List<Item>();
var ItemsComplete = new List<Item>();


foreach (ThreeDCoord Tile in AffectedTiles.Values.ToList())
{
List<Item> Temp = GetFurniObjects(Tile.X, Tile.Y);


if (Temp != null)
{
ItemsAffected.AddRange(Temp);
}
}




ItemsComplete.AddRange(ItemsOnTile);
ItemsComplete.AddRange(ItemsAffected);


if (!OnRoller)
{
foreach (Item I in ItemsComplete.ToList())
{
if (I == null)
continue;


if (I.Id == Item.Id)
continue;


if (I.GetBaseItem() == null)
continue;


}
}

{
if (Item.Rotation != newRot && Item.GetX == newX && Item.GetY == newY)
newZ = Item.GetZ;

foreach (Item I in ItemsComplete.ToList())
{
if (I == null)
continue;
if (I.Id == Item.Id)
continue;


if (I.GetBaseItem().InteractionType == InteractionType.STACKTOOL)
{ // Basically the core of the fix
// Questions -> Skype: keiz.er
newZ = I.GetZ;
break;
}


if (I.TotalHeight > newZ)
{
newZ = I.TotalHeight;
}


}
}

if (newRot != 0 && newRot != 2 && newRot != 4 && newRot != 6 && newRot != 8 && !Item.GetBaseItem().ExtraRot)
newRot = 0;


Item.Rotation = newRot;
int oldX = Item.GetX;
int oldY = Item.GetY;
Item.SetState(newX, newY, newZ, AffectedTiles);


if (!OnRoller && Session != null)
Item.Interactor.OnPlace(Session, Item);




if (newItem)
{
if (_floorItems.ContainsKey(Item.Id))
{
if (Session != null)
Session.SendNotification(PlusEnvironment.GetGame().GetLanguageLocale().TryGetValue("room_item_placed"));
_room.GetGameMap().RemoveFromMap(Item);
return true;
}


if (Item.IsFloorItem && !_floorItems.ContainsKey(Item.Id))
_floorItems.TryAdd(Item.Id, Item);
else if (Item.IsWallItem && !_wallItems.ContainsKey(Item.Id))
_wallItems.TryAdd(Item.Id, Item);


if (sendMessage)
_room.SendMessage(new ObjectAddComposer(Item, _room));
}
else
{
UpdateItem(Item);
if (!OnRoller && sendMessage)
_room.SendMessage(new ObjectUpdateComposer(Item, _room.OwnerId));
}
_room.GetGameMap().AddToMap(Item);


if (Item.GetBaseItem().IsSeat)
updateRoomUserStatuses = true;


if (updateRoomUserStatuses)
_room.GetRoomUserManager().UpdateUserStatusses();


if (Item.GetBaseItem().InteractionType == InteractionType.TENT || Item.GetBaseItem().InteractionType == InteractionType.TENT_SMALL)
{
_room.RemoveTent(Item.Id, Item);
_room.AddTent(Item.Id);
}


using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `items` SET `room_id` = '" + _room.RoomId + "', `x` = '" + Item.GetX + "', `y` = '" + Item.GetY + "', `z` = '" + Item.GetZ + "', `rot` = '" + Item.Rotation + "' WHERE `id` = '" + Item.Id + "' LIMIT 1");
}
return true;
}[/ltr]




6-

vá até sua database procure por furniture tudo que for default_type substitua por default
esse erro faz seus mobs não virem para seu inventario 


7-
para fixar o delay do catálogo na compra de 100 mobs use um servidor com SSD em vez de HD porque o processo do banco de dados fica mais rápido


8-
vá na sua database e procure por furniture todos os pisos de cinema aqueles eles estão com a STACK 0,1 coloque a stack deles para 0,0 eles bugam com essa stack


9-
execute este código na sua database:
[ltr]SET @@global.sql_mode= '';[/ltr]



se caso vocês souberem de mais fixes podem postar neste tópico abaixo irá ajudar vários users !!



Caso vocês queiram utilizar o Satis Server que tem muitos fixes de exploit etc Cliquem no link abaixo:
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]



Depois de ter colocado e feito de debug no visual estudio recomendo usar o VS 2015

Créditos:
wulles
trylix
Plus developers

Pesc Pesc  • 27.06.16 15:21

(NEW) Fix para plus emulador segurança e Outros (NEW) Empty Re: (NEW) Fix para plus emulador segurança e Outros (NEW) 27.06.16 15:21

Acho que já tenho todos esses fixes, mas vai ajudar muitos xjoao, obrigado pela iniciativa !

xjoao xjoao  • 27.06.16 18:12

(NEW) Fix para plus emulador segurança e Outros (NEW) Empty Re: (NEW) Fix para plus emulador segurança e Outros (NEW) 27.06.16 18:12

tem alguns que você não tem são esses

6-
vá até sua database procure por furniture tudo que for default_type substitua por default
esse erro faz seus mobs não virem para seu inventario 


7-
para fixar o delay do catálogo na compra de 100 mobs use um servidor com SSD em vez de HD porque o processo do banco de dados fica mais rápido


8-
vá na sua database e procure por furniture todos os pisos de cinema aqueles eles estão com a STACK 0,1 coloque a stack deles para 0,0 eles bugam com essa stack
Permissões neste sub-fórum
Não podes responder a tópicos

BH Servers

Recomendamos a BH Servers com proteção DDOS gratuita em Cloud Server de alta performance. Entrega imediata.