Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| fr:decrypter_ryzom_patch [2019/05/14 21:36] – aleajactaest | fr:decrypter_ryzom_patch [2021/12/03 18:19] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 2: | Ligne 2: | ||
| - | {{tag> | ||
| Nous allons expliquer comment décrypter le fichier " | Nous allons expliquer comment décrypter le fichier " | ||
| 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), | ||
| + | |||
| + | 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 3121: | Ligne 3135: | ||
| ===== Remarque ===== | ===== Remarque ===== | ||
| + | |||
| + | ==== Plus loin ==== | ||
| + | |||
| + | === Analyse du fichier bnp_patch.h === | ||
| + | |||
| + | Ce fichier [code/ | ||
| + | |||
| + | On commence par la fin pour trouver la structure principale. | ||
| + | |||
| + | - CProductDescriptionForClient | ||
| + | - CBNPCategorySet | ||
| + | - CBNPCategory | ||
| + | - _Name | ||
| + | - _IsOptional | ||
| + | - _UnpackTo | ||
| + | - _IsIncremental | ||
| + | - _CatRequired | ||
| + | - _Hidden | ||
| + | - _Files | ||
| + | - CBNPFileSet | ||
| + | - CBNPFile | ||
| + | - _IsIncremental | ||
| + | - _Versions | ||
| + | - _VersionNumber | ||
| + | - _FileTime | ||
| + | - _FileSize | ||
| + | - _7ZFileSize | ||
| + | - _PatchSize | ||
| + | - _HashKey | ||
| + | |||
| + | Résumé du fichier : | ||
| + | < | ||
| + | #include " | ||
| + | |||
| + | class CBNPFileVersion | ||
| + | { | ||
| + | private: | ||
| + | uint32 _VersionNumber; | ||
| + | uint32 _FileTime; | ||
| + | uint32 _FileSize; | ||
| + | uint32 _7ZFileSize; | ||
| + | uint32 _PatchSize; | ||
| + | std:: | ||
| + | }; | ||
| + | class CBNPFile | ||
| + | { | ||
| + | private: | ||
| + | bool _IsIncremental; | ||
| + | std:: | ||
| + | std:: | ||
| + | }; | ||
| + | class CBNPFileSet | ||
| + | { | ||
| + | private: | ||
| + | std:: | ||
| + | }; | ||
| + | class CBNPCategory | ||
| + | { | ||
| + | private: | ||
| + | std:: | ||
| + | bool _IsOptional; | ||
| + | std:: | ||
| + | bool _IsIncremental; | ||
| + | std:: | ||
| + | bool _Hidden; | ||
| + | std:: | ||
| + | }; | ||
| + | class CBNPCategorySet | ||
| + | { | ||
| + | private: | ||
| + | std:: | ||
| + | }; | ||
| + | class CProductDescriptionForClient | ||
| + | { | ||
| + | private: | ||
| + | CBNPCategorySet _Categories; | ||
| + | CBNPFileSet _Files; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | Remarque: | ||
| + | le type " | ||
| + | | ||
| + | Le fichier [code/ | ||
| + | |||
| + | 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 : | ||
| + | < | ||
| + | #define PERSISTENT_TOKEN_FAMILY RyzomTokenFamily | ||
| + | |||
| + | #define PERSISTENT_CLASS CBNPFileVersion | ||
| + | #define PERSISTENT_DATA \ | ||
| + | PROP(uint32, | ||
| + | PROP(uint32, | ||
| + | PROP(uint32, | ||
| + | PROP(uint32, | ||
| + | PROP(uint32, | ||
| + | PROP_VECT(uint32, | ||
| + | |||
| + | //# pragma message( PERSISTENT_GENERATION_MESSAGE ) | ||
| + | #include " | ||
| + | |||
| + | #undef PERSISTENT_CLASS | ||
| + | #undef PERSISTENT_DATA | ||
| + | |||
| + | |||
| + | #define PERSISTENT_CLASS CBNPFile | ||
| + | #define PERSISTENT_DATA\ | ||
| + | PROP(std:: | ||
| + | STRUCT_VECT(_Versions) | ||
| + | |||
| + | //# pragma message( PERSISTENT_GENERATION_MESSAGE ) | ||
| + | #include " | ||
| + | |||
| + | #undef PERSISTENT_CLASS | ||
| + | #undef PERSISTENT_DATA | ||
| + | |||
| + | |||
| + | #define PERSISTENT_CLASS CBNPFileSet | ||
| + | #define PERSISTENT_DATA\ | ||
| + | STRUCT_VECT(_Files) | ||
| + | //# pragma message( PERSISTENT_GENERATION_MESSAGE ) | ||
| + | #include " | ||
| + | |||
| + | #undef PERSISTENT_CLASS | ||
| + | #undef PERSISTENT_DATA | ||
| + | |||
| + | |||
| + | #define PERSISTENT_CLASS CBNPCategory | ||
| + | #define PERSISTENT_DATA\ | ||
| + | PROP(std:: | ||
| + | LPROP(bool, | ||
| + | LPROP(std:: | ||
| + | LPROP(bool, | ||
| + | LPROP(std:: | ||
| + | LPROP(bool, | ||
| + | PROP_VECT(std:: | ||
| + | |||
| + | //# pragma message( PERSISTENT_GENERATION_MESSAGE ) | ||
| + | #include " | ||
| + | |||
| + | #undef PERSISTENT_CLASS | ||
| + | #undef PERSISTENT_DATA | ||
| + | |||
| + | |||
| + | #define PERSISTENT_CLASS CBNPCategorySet | ||
| + | #define PERSISTENT_DATA\ | ||
| + | STRUCT_VECT(_Category) | ||
| + | //# pragma message( PERSISTENT_GENERATION_MESSAGE ) | ||
| + | #include " | ||
| + | |||
| + | #undef PERSISTENT_CLASS | ||
| + | #undef PERSISTENT_DATA | ||
| + | |||
| + | |||
| + | #define PERSISTENT_CLASS CProductDescriptionForClient | ||
| + | #define PERSISTENT_DATA\ | ||
| + | STRUCT(_Files)\ | ||
| + | STRUCT(_Categories) | ||
| + | |||
| + | //# pragma message( PERSISTENT_GENERATION_MESSAGE ) | ||
| + | #include " | ||
| + | |||
| + | #undef PERSISTENT_CLASS | ||
| + | #undef PERSISTENT_DATA | ||
| + | </ | ||
| + | |||
| + | Dans le fichier [code/ | ||
| + | < | ||
| + | #define PROP(type, | ||
| + | #define LPROP(type, | ||
| + | #define PROP_VECT(type, | ||
| + | #define STRUCT(varName) _STRUCT(__Tok## | ||
| + | #define STRUCT_VECT(varName) _STRUCT(__Tok## | ||
| + | |||
| + | |||
| + | |||
| + | #ifdef PERSISTENT_TOKEN_FAMILY | ||
| + | |||
| + | //#pragma message( "Using token family " | ||
| + | |||
| + | // setup some macros for constructing the classname and object name that we need for | ||
| + | // the ' | ||
| + | #define _EVAL(b,c) b##c | ||
| + | #define _BUILD_TOKENS_CLASSNAME(c) _EVAL(c, | ||
| + | #define _BUILD_TOKENS_OBJNAME(c) _EVAL(c, | ||
| + | |||
| + | // setup the class name and object name for the ' | ||
| + | #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:: | ||
| + | |||
| + | __Tok__MapKey= _ADD_TOKEN(" | ||
| + | __Tok__MapVal= _ADD_TOKEN(" | ||
| + | #define _PROP(token, | ||
| + | #define _STRUCT(token, | ||
| + | #define _PROP_MAP(token, | ||
| + | #define _STRUCT_MAP(token, | ||
| + | #define _FLAG(token, | ||
| + | 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, | ||
| + | #define _STRUCT(token, | ||
| + | #define _PROP_MAP(token, | ||
| + | #define _STRUCT_MAP(token, | ||
| + | #define _FLAG(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( " | ||
| + | #pragma message( " ") | ||
| + | #endif | ||
| + | </ | ||
| + | |||
| + | ==== Vers l' | ||
| + | |||
| + | Pour trouver les autres structures du même type, il suffit de recherche la clef qui active/ | ||
| + | |||
| + | Il faut rechercher " | ||
| + | |||
| + | < | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | code/ | ||
| + | </ | ||
| + | |||
| + | Il suffit de regarder le fichier header (remplacer l' | ||
| + | |||
| + | <WRAP caution> | ||
| + | Soit on utilise une autre structure, soit on utilise la définition coté serveur. | ||
| + | Bref, il faut analyser | ||
| + | </ | ||
| + | |||
| ==== 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 3140: | Ligne 3469: | ||
| | ryzom/ | | ryzom/ | ||
| + | |||
| + | |||
| + | {{tag> | ||





