GGPK

Old: chuanhsing 2024-07-20 07:37:20

New: chuanhsing 2024-07-20 07:40:25

OldNewDifferences
1-# Developer API
1+# GGPK
22
3-There are 2 api sets:
4-* POESESSID used in the website API is not officially supported.
5-* [OAuth](https://www.pathofexile.com/developer/docs) apis are officially supported, but less functions.
3+## GGPK schema
64
7-## Development Tool
5+### Record Structures
86
7+
8+
9+```
10+struct GGPK {
11+ uint32 Length;
12+ char[4] Tag; // ="GGPK"
13+ uint32 Version;
14+ GgpkEntry[2] Entries;
15+}
16+
17+struct GgpkEntry {
18+ uint64 offset;
19+}
20+```
21+
22+```
23+struct FREE {
24+ uint32 Length;
25+ char[4] Tag; // = "FREE"
26+ Byte[Length-8] Data;
27+}
28+```
29+
30+```
31+struct PDIR {
32+ uint32 Length;
33+ char[4] Tag; // ="PDIR"
34+ uint32 NameLength;
35+ uint32 TotalEntries;
36+ byte[32] SHA256Hash;
37+ wchar_t[NameLength] Name;
38+ DirectoryEntry[TotalEntries];
39+}
40+
41+struct DirectoryEntry {
42+ int32 entryNameHash;
43+ uint64 offset;
44+}
45+```
46+
47+```
48+struct FILE {
49+ uint32 Length;
50+ char[4] Tag; // ="FILE"
51+ uint32 NameLength;
52+ byte[32] SHA256Hash;
53+ wchar_t[NameLength] Name;
54+ byte[reminder] Data;
55+}
56+```
57+
58+<a href="https://i.imgur.com/VRBetTX.png" data-lightbox="panel"></a>
59+
60+### Sample Tree
61+<a href="https://i.imgur.com/EP7QRal.png" data-lightbox="panel"></a>
62+
63+
64+### Reference
965 Site | Description
1066 - | -
11-[Tooldev Discord Channel](https://discord.gg/pathofexile) | #tooldev-general
12-[PoeSharp](https://github.com/andreandersen/PoeSharp) | C# Library to deal with PoE stuff
13-[PoE Go](https://github.com/ccbrown/poe-go) | an entry-level guide to writing tools for PoE in the Go programming language.
67+[Path of Go](https://github.com/oriath-net/pogo) | Golang tools for reading PoE data files
68+[LibGGPK3](https://github.com/aianlinb/LibGGPK3) | Windows GUI tool to view Content.ggpk and export
69+[libbun](https://github.com/zao/ooz) | Ooz shared library (libooz.dll/liblibooz.so) for Oodle decompression and Bun library/tool with a C API suitable for FFI/interop - reads and extracts bundle contents from a Steam game directory or a PC Standalone GGPK. Tested on x64 Windows and Debian. <br>Original Ooz code by powzix/rarten, adapted into a library.
1470
71+## Bundle schema
1572
16-## APIs
73+[Bundle schema](Bundle_schema)
74+
75+## Dat schema
76+
77+```
78+struct DAT {
79+ uint32 rowCounts;
80+ Data[rowCounts] rows;
81+ REFERENCE refer;
82+}
83+
84+struct Data {
85+ blob row;
86+}
87+
88+struct REFERENCE {
89+ char[8]; // 0xBB * 8
90+ blob reference;
91+}
92+```
93+
94+### Data Export
95+
96+The game data does not have any official API, and only possible data can be analyzed from the game files.
97+
98+Almost all data is stored in .dat64 files within Content.ggpk. But they only have data, no headers. You can start with the .dat64 format, the [PoE dat schema](https://github.com/poe-tool-dev/dat-schema) project is the latest format. Or try to parse the .dat format from [PoE Dat Viewer](https://snosme.github.io/poe-dat-viewer/) yourself. [RePoE](https://github.com/lvlvllvlvllvlvl/RePoE) collects many common and processed .dat files and exports them to .json format.
99+
100+### Reference
17101 Site | Description
18102 - | -
19-[PoE API swagger](https://poedb.tw/us/poe-api) | PoEDB collections of POESESSID and OAuth API
20-[Official Website API](https://www.pathofexile.com/developer/docs) | OAuth API endpoints of Path of Exile
21-[POESESSID](POESESSID) | how to get your POESESSID
22-[API:Passive_Skill_Tree](API%3APassive_Skill_Tree)
23-[API:OAuth](API%3AOAuth) | how to use OAuth
24-[API:Ladder](API%3ALadder)
25-[API:Trade](API%3ATrade) | Official Trade API (POESESSID)
26-[API:Public_Stashes](API%3APublic_Stashes) | OAuth Public Stashes API
27-[GGPK](GGPK) | Content.ggpk file format
28-[Atlas Tree Export](https://github.com/grindinggear/skilltree-export/tree/atlas)
103+[PyPoE](https://github.com/Project-Path-of-Exile-Wiki/PyPoE) | Collection of Python Tools for Path of Exile, mostly used by wiki
104+[RePoE](https://github.com/lvlvllvlvllvlvl/RePoE) | Repository of Path of Exile resources for tool developers.
105+[Poe Dat Viewer](https://snosme.github.io/poe-dat-viewer/) | Web-base Poe Dat Viewer
106+[PoE dat schema](https://github.com/poe-tool-dev/dat-schema) | Source of truth schema for dat files.
107+[Path Of Building Fork schema](https://github.com/PathOfBuildingCommunity/PathOfBuilding/blob/dev/src/Export/spec.lua) | Source of Path Of Building Fork schema
29108
30-## Path Of Building Fork schema
31-
32-Site | Description
33-- | -
34-[Pastebin](Pastebin)
35-[Pobbin](Pobbin)
109+### PyPoe stable.py to spec.json
110+```
111+from PyPoE.poe.file.specification.data import stable
112+from json import dump
113+with open('D:/spec.json', 'w') as f:
114+ dump(stable.specification.as_dict(), f)
115+```