Logo Khaganat

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
fr:decrypter_ryzom_patch [2019/05/15 09:05] – [Analyse du fichier bnp_patch.h] aleajactaestfr:decrypter_ryzom_patch [2021/12/03 19:19] (Version actuelle) – modification externe 127.0.0.1
Ligne 2: Ligne 2:
  
  
-{{tag>Tag_a_ajouter}} 
  
 Nous allons expliquer comment décrypter le fichier "ryzom_xxx.idx". Nous allons expliquer comment décrypter le fichier "ryzom_xxx.idx".
Ligne 8: Ligne 7:
 De plus, on retrouve la base de la communication réseau (enfin je pense) De plus, on retrouve la base de la communication réseau (enfin je pense)
 Par la suite, je vais considéré le fichier comme un document. Par la suite, je vais considéré le fichier comme un document.
 +
 +
 +
 +{{INLINETOC}}
 +
 +===== Fonction de ce fichier =====
 +
 +Ce fichier a pour fonction de lister tous les fichiers contenu dans le patch ainsi que la catégorie pour ces fichiers.
 +
 +Catégorie permette de désigné si le fichier est complet (ou incrémentale), caché, ....
 +
 +Dans les fait, nous avons deux listes.
 +
 +  * Une liste définissant les fichiers (nom, taille, checksum, date de modification)
 +  * Une liste catégorie qui définit le type de fichier (et la liste de fichier dans cette catégorie)
  
  
Ligne 3151: Ligne 3165:
           - _HashKey           - _HashKey
  
-Résumé du fichier  +Résumé du fichier :
 <code> <code>
 #include "persistent_data.h" #include "persistent_data.h"
Ligne 3201: Ligne 3214:
 }; };
 </code> </code>
 +
 +Remarque:
 +  le type "std::vector" est la définition d'une liste
 +  
 +Le fichier [code/ryzom/common/src/game_share/bnp_patch.cpp] contient la définition du type et du mot de clef recherché
 +
 +Par exemple pour CBNPFileVersion:
 +^Mot de clef ^Type^
 +| _VersionNumber | uint32 |
 +| _FileSize | uint32 |
 +| _7ZFileSize | uint32 |
 +| _FileTime | uint32 |
 +| _PatchSize | uint32 |
 +| _HashKey | liste de uint32 |
 +
 +
 +Résumé du fichier :
 +<code>
 +#define PERSISTENT_TOKEN_FAMILY RyzomTokenFamily
 +
 +#define PERSISTENT_CLASS CBNPFileVersion
 +#define PERSISTENT_DATA \
 + PROP(uint32,_VersionNumber) \
 + PROP(uint32,_FileSize) \
 + PROP(uint32,_7ZFileSize) \
 + PROP(uint32,_FileTime) \
 + PROP(uint32,_PatchSize) \
 + PROP_VECT(uint32,_HashKey)
 +
 +//#      pragma message( PERSISTENT_GENERATION_MESSAGE )
 +#include "persistent_data_template.h"
 +
 +#undef PERSISTENT_CLASS
 +#undef PERSISTENT_DATA
 +
 +
 +#define PERSISTENT_CLASS CBNPFile
 +#define PERSISTENT_DATA\
 + PROP(std::string,_FileName)\
 + STRUCT_VECT(_Versions)
 +
 +//#      pragma message( PERSISTENT_GENERATION_MESSAGE )
 +#include "persistent_data_template.h"
 +
 +#undef PERSISTENT_CLASS
 +#undef PERSISTENT_DATA
 +
 +
 +#define PERSISTENT_CLASS CBNPFileSet
 +#define PERSISTENT_DATA\
 + STRUCT_VECT(_Files)
 +//#      pragma message( PERSISTENT_GENERATION_MESSAGE )
 +#include "persistent_data_template.h"
 +
 +#undef PERSISTENT_CLASS
 +#undef PERSISTENT_DATA
 +
 +
 +#define PERSISTENT_CLASS CBNPCategory
 +#define PERSISTENT_DATA\
 + PROP(std::string, _Name)\
 + LPROP(bool, _IsOptional, if(!_IsOptional))\
 + LPROP(std::string, _UnpackTo, if(!_UnpackTo.empty()))\
 + LPROP(bool, _IsIncremental, if(!_IsIncremental))\
 + LPROP(std::string, _CatRequired, if(!_CatRequired.empty()))\
 + LPROP(bool, _Hidden, if(_Hidden))\
 + PROP_VECT(std::string, _Files)\
 +
 +//#      pragma message( PERSISTENT_GENERATION_MESSAGE )
 +#include "persistent_data_template.h"
 +
 +#undef PERSISTENT_CLASS
 +#undef PERSISTENT_DATA
 +
 +
 +#define PERSISTENT_CLASS CBNPCategorySet
 +#define PERSISTENT_DATA\
 + STRUCT_VECT(_Category)
 +//#      pragma message( PERSISTENT_GENERATION_MESSAGE )
 +#include "persistent_data_template.h"
 +
 +#undef PERSISTENT_CLASS
 +#undef PERSISTENT_DATA
 +
 +
 +#define PERSISTENT_CLASS CProductDescriptionForClient
 +#define PERSISTENT_DATA\
 + STRUCT(_Files)\
 + STRUCT(_Categories)
 +
 +//#      pragma message( PERSISTENT_GENERATION_MESSAGE )
 +#include "persistent_data_template.h"
 +
 +#undef PERSISTENT_CLASS
 +#undef PERSISTENT_DATA
 +</code>
 +
 +Dans le fichier [code/ryzom/common/src/game_share/persistent_data_template.h] on retrouve la définition des defines.
 +<code>
 +#define PROP(type,varName) _PROP(__Tok##varName,#varName,type,DEFAULT_LOGIC,varName,varName=val)
 +#define LPROP(type,varName,logic) _PROP(__Tok##varName,#varName,type,logic,varName,varName=val)
 +#define PROP_VECT(type,varName) _PROP(__Tok##varName,#varName,type,VECT_LOGIC(varName),varName[i],varName.push_back(val))
 +#define STRUCT(varName) _STRUCT(__Tok##varName,#varName,DEFAULT_LOGIC,(varName).store(pdr),(varName).apply(pdr))
 +#define STRUCT_VECT(varName) _STRUCT(__Tok##varName,#varName,VECT_LOGIC(varName),varName[i].store(pdr),vectAppend(varName).apply(pdr))
 +
 +
 +
 +#ifdef PERSISTENT_TOKEN_FAMILY
 +
 +//#pragma message( "Using token family "NL_MACRO_TO_STR(PERSISTENT_TOKEN_FAMILY)" for persistent data class " NL_MACRO_TO_STR(PERSISTENT_CLASS) )
 +
 +// setup some macros for constructing the classname and object name that we need for
 +// the 'persistent token family' constants class
 +#define _EVAL(b,c) b##c
 +#define _BUILD_TOKENS_CLASSNAME(c) _EVAL(c,__constants__class)
 +#define _BUILD_TOKENS_OBJNAME(c) _EVAL(c,__constants__obj)
 +
 +// setup the class name and object name for the 'persistent token family' constants class and its instance
 +#ifdef PERSISTENT_TOKEN_CLASS
 + #define _TOKENS_CLASSNAME _BUILD_TOKENS_CLASSNAME(PERSISTENT_TOKEN_CLASS)
 + #define _TOKENS_OBJNAME _BUILD_TOKENS_OBJNAME(PERSISTENT_TOKEN_CLASS)
 +#else
 + #define _TOKENS_CLASSNAME _BUILD_TOKENS_CLASSNAME(PERSISTENT_CLASS)
 + #define _TOKENS_OBJNAME _BUILD_TOKENS_OBJNAME(PERSISTENT_CLASS)
 +#endif
 +
 +
 +// define the set of tokens required by this class
 +// adding them to some pre-defined token family
 +struct _TOKENS_CLASSNAME
 +{
 + // the ctor is used to setup the values of the static tokens
 + _TOKENS_CLASSNAME()
 + {
 + #define _ADD_TOKEN(token) CPdrTokenRegistry::getInstance()->addToken(NL_MACRO_TO_STR(PERSISTENT_TOKEN_FAMILY),token)
 +
 + __Tok__MapKey= _ADD_TOKEN("__Key__");
 + __Tok__MapVal= _ADD_TOKEN("__Val__");
 + #define _PROP(token,name,type,logic,get,set) token= _ADD_TOKEN(name);
 + #define _STRUCT(token,name,logic,write,read) token= _ADD_TOKEN(name);
 + #define _PROP_MAP(token,name,keyType,valType,logic,getKey,getVal,set) token= _ADD_TOKEN(name);
 + #define _STRUCT_MAP(token,name,keyType,logic,getKey,valWrite,read) token= _ADD_TOKEN(name);
 + #define _FLAG(token,name,logic,code) token= _ADD_TOKEN(name);
 + PERSISTENT_DATA
 + #undef _PROP
 + #undef _STRUCT
 + #undef _PROP_MAP
 + #undef _STRUCT_MAP
 + #undef _FLAG
 +
 + #undef _ADD_TOKEN
 + }
 +
 + // define the set of static variables to act as constants for stocking the set of tokens for this persistet data class
 + uint16 __Tok__MapKey;
 + uint16 __Tok__MapVal;
 + #define _PROP(token,name,type,logic,get,set) uint16 token;
 + #define _STRUCT(token,name,logic,write,read) uint16 token;
 + #define _PROP_MAP(token,name,keyType,valType,logic,getKey,getVal,set) uint16 token;
 + #define _STRUCT_MAP(token,name,keyType,logic,getKey,valWrite,read) uint16 token;
 + #define _FLAG(token,name,logic,code) uint16 token;
 + PERSISTENT_DATA
 + #undef _PROP
 + #undef _STRUCT
 + #undef _PROP_MAP
 + #undef _STRUCT_MAP
 + #undef _FLAG
 +};
 +static _TOKENS_CLASSNAME _TOKENS_OBJNAME;
 +
 +#undef _TOKENS_CLASSNAME
 +#undef _TOKENS_OBJNAME
 +
 +#else
 +
 +#ifdef NL_OS_WINDOWS
 + #pragma message( " ")
 + #pragma message( "NON-OPTIMISED: Persistent data class " NL_MACRO_TO_STR(PERSISTENT_CLASS) " not using a token family")
 + #pragma message( " ")
 +#endif
 +</code>
 +
 +==== Vers l'infini et l'au delà ==== 
 +
 +Pour trouver les autres structures du même type, il suffit de recherche la clef qui active/déclenche la génération de ces structures.
 +
 +Il faut rechercher "PERSISTENT_TOKEN_FAMILY"
 +
 +<code>
 +code/ryzom/common/src/game_share/bnp_patch.cpp 
 +code/ryzom/common/src/game_share/type_skill_mod.cpp 
 +code/ryzom/tools/patch_gen/patch_gen_common.cpp 
 +code/ryzom/tools/stats_scan/character.cpp 
 +code/ryzom/server/src/server_share/stat_db_tree_pd.cpp 
 +code/ryzom/server/src/pd_support_service/stat_character.cpp 
 +code/ryzom/server/src/general_utilities_service/stat_character.cpp 
 +code/ryzom/server/src/ai_service/ai_script_data_manager.cpp 
 +code/ryzom/server/src/entities_game_service/player_manager/character_statistics_recorder.cpp 
 +code/ryzom/server/src/entities_game_service/player_manager/character_name_extraction.cpp 
 +code/ryzom/server/src/entities_game_service/player_manager/ring_reward_points.cpp 
 +code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp 
 +code/ryzom/server/src/entities_game_service/player_manager/persistent_effect.cpp 
 +code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp 
 +code/ryzom/server/src/entities_game_service/outpost_manager/outpost_squad.cpp 
 +code/ryzom/server/src/entities_game_service/outpost_manager/outpost.cpp 
 +code/ryzom/server/src/entities_game_service/shop_type/item_for_sale.cpp 
 +code/ryzom/server/src/entities_game_service/shop_type/items_for_sale.cpp 
 +code/ryzom/server/src/entities_game_service/shop_type/solded_items.cpp 
 +code/ryzom/server/src/entities_game_service/shop_type/dynamic_items.cpp 
 +code/ryzom/server/src/entities_game_service/mission_manager/mission_queue.cpp 
 +code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp 
 +code/ryzom/server/src/entities_game_service/game_event_manager.cpp 
 +code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp 
 +code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/totem_base.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_forage_success_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/enchant_weapon_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_craft_success_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/s_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/power_shielding_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_magic_protection_effet.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_range_success_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_magic_success_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_defense_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/mod_melee_success_effect.cpp 
 +code/ryzom/server/src/entities_game_service/phrase_manager/chg_charac_effect.cpp 
 +code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp 
 +</code>
 +
 +Il suffit de regarder le fichier header (remplacer l'extension ".cpp" par ".h") pour trouver la définition de toutes les entités.
 +
 +<WRAP caution>On remarque que l'on n'a pas beacoup de définition coté client.
 +Soit on utilise une autre structure, soit on utilise la définition coté serveur.
 +Bref, il faut analyser
 +</WRAP>
 +
  
 ==== Little endian ==== ==== Little endian ====
 +
 little endian : structure des nombres (le poids de plus faible en premier et ainsi de suite) little endian : structure des nombres (le poids de plus faible en premier et ainsi de suite)
  
Ligne 3220: Ligne 3469:
 | ryzom/common/src/game_share/persistent_data.h | struct CArg | Qui lit les données, et définit les types de token | | ryzom/common/src/game_share/persistent_data.h | struct CArg | Qui lit les données, et définit les types de token |
  
 +
 +
 +{{tag>Classification MMORPG Ryzom_Core Programmation Serveur client_rc_obsolete}}
CC Attribution-Share Alike 4.0 International Driven by DokuWiki
fr/decrypter_ryzom_patch.1557903937.txt.gz · Dernière modification : 2021/12/03 19:18 (modification externe)

Licences Mentions légales Accueil du site Contact