Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Inventory Expansion 3 & 4 Help  (Visto 1154 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline animator Posteado: April 20, 2022, 05:44:27 PM | Modificado: April 20, 2022, 06:01:49 PM by animator

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 16
  • Gracias recibida: 5
  • sk
Did anyone try to make the third and forth inventory expansion work in the client side ?

Here are offset which enables the expansions to 4:
Code: [Select]
Memory::SetByte(0x7D4C3A, 4); //CNewUIInvenExpansion Constructor  
Memory::SetByte(0x7D4DB2, 4); //CNewUIInvenExpansion::Create
Memory::SetByte(0x7D4EA8, 4); //CNewUIInvenExpansion::SetPos
Memory::SetByte(0x7D531E, 4); //CNewUIInvenExpansion::InitExpansion
Memory::SetByte(0x7D57DF, 4); //CNewUIInvenExpansion::RenderInvenExpansion
Memory::SetByte(0x7D6C3F, 4 + 1); //CNewUIInvenExpansion::SetEnableExpansionInven
Memory::SetByte(0x835730, 4 + 1); //CNewUIInvenExpansion::GetInventoryCtrl(i)->ShowInventory()
Memory::SetByte(0x83CBB7, 4 + 1); //CNewUIInventoryCtrl::SetInventoryEnabledCount <--- THIS WILL CRASH THE GAME AFTER CHAR SELECT
Memory::SetByte(0x83CBFD, 4 + 1); //CNewUIInventoryCtrl::GetInventoryEnabledCount

There must be some function or array size problem which crashes the game. Can someone help to achieve this?

EDIT: This function crashes the game
Code: [Select]
0x515EA0

Gracias:


Offline Rindy #1 Posteado: April 20, 2022, 09:05:20 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 73
  • Gracias recibida: 1607
  • gb
Use what to use. or need to do on both gameserver and dataserver


Offline animator #2 Posteado: April 21, 2022, 04:21:18 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 16
  • Gracias recibida: 5
  • sk
Gameserver and dataserver can send the inventoryexpansion count, thats not an issue here. Its client side issue.

The function I observed that crashes the game seems like insertion into a vector. So the crash happens somewhere else when the vector is looped through I think.


Offline takumi12 #3 Posteado: April 21, 2022, 01:07:35 PM

  • MAESTRO

  • US. DE HONOR

  • LEYENDA

  • Php Coder
  • +11 puntos por ventas
  • *
  • *
  • Rank: Puto amo
  • Posts: 1.310
  • Gracias recibida: 40289
  • mx
friend, this does not work, for this you need to extend the structure of newuimyinventory

#define MAX_EQUIPMENT_INDEX  12
typedef struct
{
   char         byClass[16];
   DWORD*         m_pNewUIMng;
   DWORD*         m_pNewUI3DRenderMng;
   DWORD*         m_pNewInventoryCtrl1; //-- inventory principal
   DWORD*         m_pNewInventoryCtrl2; //-- inventory ext1
   DWORD*         m_pNewInventoryCtrl3; //-- inventory ext2
   POINT         m_Pos;
   EQUIPMENT_ITEM   m_EquipmentSlots[MAX_EQUIPMENT_INDEX];
   int            m_iPointedSlot;
   char         m_BtnRepair[172];
   char         m_BtnExit[172];
   char         m_BtnMyShop[172];
   DWORD         m_MyShopMode;
   DWORD         m_RepairMode;
   DWORD         m_dwStandbyItemKey;
   bool         m_bRepairEnableLevel;
   bool         m_bMyShopOpen;
} UIMyInventory;

if you don't modify the structure then you are using 4 byte memory data for each already existing parameter, in short you would be rewriting the position Pos.x, Pos.y... for this reason it crashes


Las offset no se crea, ni se destruye, solo se transforma

Offline animator #4 Posteado: April 21, 2022, 05:04:48 PM | Modificado: April 22, 2022, 05:54:53 AM by animator

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 16
  • Gracias recibida: 5
  • sk
Hi @takumi12, thank you very much for the struct.

I already figured that out the problem you pointed out when I looked at the UIMyInventory Constructor, when I overwrite the 3 to 5.
Code: [Select]
 
for ( i = 0; i < 3; ++i )
  this[i + 6] = 0; //Ext inventory controllers
this[10] = 0; //POINT
this[9] = 0;  //POINT

The new Extended Inventory controllers would overwrite the POINT in memory, so it crashes. Do you have any ideas how to workaround that without manually shifting all pointers in the class functions? I am not a total expert in the c++ and asm so this is maybe out of my scope to do it somehow easily.

EDIT: I extended the class size and used the POINT 2x 4bytes as inventory controller pointers and manually rerouted the original POINT pointer to the extended memory space. It works but it is ugly.


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1051 Views
Last post July 03, 2019, 12:51:52 PM
by marian500
10 Replies
6358 Views
Last post May 15, 2023, 10:36:01 AM
by cartel
18 Replies
2322 Views
Last post January 24, 2021, 10:24:16 AM
by Deidad
8 Replies
6864 Views
Last post July 11, 2023, 07:53:18 AM
by koito89
1 Replies
238 Views
Last post April 12, 2023, 07:03:46 PM
by lunaticodeveloper