Difference between revisions of "Memory Management (USE/fREe)"
Jump to navigation
Jump to search
(Created page with "=Storage entry= {| class="wikitable" |- ! Position !! Length !! Type !! Description |- | 0x00 || 0x04 || string || Task token (TASK) |- | 0x10 || 0x08 || uint64_t* || Unknown...") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Static Storage= | |||
The static memory storage is 322 entries big and located at 0x142A760C0 (v1.07).<br> | |||
The entries have a max content size of 32 bytes.<br> | |||
Due to this restriction the memory de/allocation in this storage is way faster than in the dynamic storage.<br> | |||
=Dynamic Storage= | |||
The dynamic storage is allocated with the function at 0x140361A40 (v1.07).<br> | |||
Two HLib entries will be added, one at the start and one at the end of the allocated memory.<br> | |||
After the first HLib entry a new fREe entry will be added and looks like this.<br> | |||
This entry has the previous entry pointer set to the first HLib entry and the next entry pointer set to the HLib entry at the end.<br> | |||
=Free Storage= | |||
To free storage the function 0x14049CDD0 (v1.07) is used.<br> | |||
=Allocate Storage= | |||
To allocate storage the function 0x14049CB40 (v1.07) is used.<br> | |||
=Storage entry= | =Storage entry= | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 4: | Line 21: | ||
! Position !! Length !! Type !! Description | ! Position !! Length !! Type !! Description | ||
|- | |- | ||
| 0x00 || 0x04 || string || | | 0x00 || 0x04 || string || Memory type token | ||
|- | |- | ||
| | | 0x04 || 0x04 || ? || Padding? | ||
|- | |- | ||
| | | 0x08 || 0x08 || uint64_t || Content size | ||
|- | |- | ||
| | | 0x10 || 0x08 || uint64_t* || Previous storage entry pointer | ||
|- | |- | ||
| 0x40 || | | 0x18 || 0x08 || uint64_t* || Next storage entry pointer | ||
|- | |||
| 0x20 || 0x04 || string || USE/fREe token (determines if the space is being used) | |||
|- | |||
| 0x40 || Content size || ? || Storage data | |||
|} | |||
=Storage tokens= | |||
==Identified== | |||
{| class="wikitable" | |||
|- | |||
! Name !! Description | |||
|- | |||
| HLib || Root storage entry type | |||
|- | |||
| TASK || Contains various data for a task | |||
|- | |||
| MDL || MT7 model | |||
|- | |||
| INFO || Mapinfo | |||
|- | |||
| CHID || Character ID | |||
|} | |||
==Unidentified== | |||
{| class="wikitable" | |||
|- | |||
! Name !! Description | |||
|- | |||
| MAI || Model data? | |||
|- | |||
| SHDM || Model data | |||
|- | |||
| SCNC || Scene stuff? | |||
|- | |||
| WNDB || ? | |||
|- | |||
| SHAD || Textures? | |||
|- | |||
| WARN || Warning (uses textures?) | |||
|- | |||
| WARP || (uses textures?) | |||
|- | |||
| ITPH || (uses textures?) | |||
|- | |||
| SNCT || (uses textures?) | |||
|- | |||
| PAWN || Pawnshop? | |||
|- | |||
| FLDD || Collision data | |||
|- | |||
| ACPH || ? | |||
|- | |||
| ACPD || ? | |||
|- | |||
| DOME || Skybox dome? | |||
|- | |||
| CVIX || Indexing? | |||
|- | |||
| ADFS || ? | |||
|- | |||
| MODL || Model info? | |||
|- | |||
| MAIX || Model info? | |||
|- | |||
| PAKT || ? | |||
|- | |||
| PAKa || ? | |||
|- | |||
| PAKM || ? | |||
|- | |||
| CLIP || ? | |||
|- | |||
| WALL || ? | |||
|- | |||
| WALC || ? | |||
|- | |||
| FLAG || FLAG.BIN? | |||
|- | |||
| HMDL || Model? | |||
|- | |||
| STCH || NPC related | |||
|} | |} |
Latest revision as of 18:36, 20 January 2019
Static Storage
The static memory storage is 322 entries big and located at 0x142A760C0 (v1.07).
The entries have a max content size of 32 bytes.
Due to this restriction the memory de/allocation in this storage is way faster than in the dynamic storage.
Dynamic Storage
The dynamic storage is allocated with the function at 0x140361A40 (v1.07).
Two HLib entries will be added, one at the start and one at the end of the allocated memory.
After the first HLib entry a new fREe entry will be added and looks like this.
This entry has the previous entry pointer set to the first HLib entry and the next entry pointer set to the HLib entry at the end.
Free Storage
To free storage the function 0x14049CDD0 (v1.07) is used.
Allocate Storage
To allocate storage the function 0x14049CB40 (v1.07) is used.
Storage entry
Position | Length | Type | Description |
---|---|---|---|
0x00 | 0x04 | string | Memory type token |
0x04 | 0x04 | ? | Padding? |
0x08 | 0x08 | uint64_t | Content size |
0x10 | 0x08 | uint64_t* | Previous storage entry pointer |
0x18 | 0x08 | uint64_t* | Next storage entry pointer |
0x20 | 0x04 | string | USE/fREe token (determines if the space is being used) |
0x40 | Content size | ? | Storage data |
Storage tokens
Identified
Name | Description |
---|---|
HLib | Root storage entry type |
TASK | Contains various data for a task |
MDL | MT7 model |
INFO | Mapinfo |
CHID | Character ID |
Unidentified
Name | Description |
---|---|
MAI | Model data? |
SHDM | Model data |
SCNC | Scene stuff? |
WNDB | ? |
SHAD | Textures? |
WARN | Warning (uses textures?) |
WARP | (uses textures?) |
ITPH | (uses textures?) |
SNCT | (uses textures?) |
PAWN | Pawnshop? |
FLDD | Collision data |
ACPH | ? |
ACPD | ? |
DOME | Skybox dome? |
CVIX | Indexing? |
ADFS | ? |
MODL | Model info? |
MAIX | Model info? |
PAKT | ? |
PAKa | ? |
PAKM | ? |
CLIP | ? |
WALL | ? |
WALC | ? |
FLAG | FLAG.BIN? |
HMDL | Model? |
STCH | NPC related |